Compare commits
13 Commits
29057c8024
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| e53cde7f60 | |||
| 62e36359b8 | |||
| 265d393cdc | |||
| 797c4c7c52 | |||
| 6cc4694e1e | |||
| 334703ec43 | |||
| 6301c40c59 | |||
| 8fe8426cc2 | |||
| a2e29abf19 | |||
| 2f4b3c64fe | |||
|
|
177db26b69 | ||
| 0fd466d86d | |||
| 69aa02e303 |
@@ -144,6 +144,10 @@ extension BrowserViewController: ShortcutResponder
|
|||||||
webView.reload()
|
webView.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func stop(_ sender: Any?) {
|
||||||
|
webView.stopLoading()
|
||||||
|
}
|
||||||
|
|
||||||
override func increaseSize(_ sender: Any?) {
|
override func increaseSize(_ sender: Any?) {
|
||||||
currentTab.webView._viewScale += 0.10
|
currentTab.webView._viewScale += 0.10
|
||||||
}
|
}
|
||||||
@@ -151,6 +155,10 @@ extension BrowserViewController: ShortcutResponder
|
|||||||
override func decreaseSize(_ sender: Any?) {
|
override func decreaseSize(_ sender: Any?) {
|
||||||
currentTab.webView._viewScale -= 0.10
|
currentTab.webView._viewScale -= 0.10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func zoomToActualSize(_ sender: Any?) {
|
||||||
|
currentTab.webView._viewScale = 1.0
|
||||||
|
}
|
||||||
|
|
||||||
func showPreferences(_ sender: Any?) {
|
func showPreferences(_ sender: Any?) {
|
||||||
showSettingsWindow()
|
showSettingsWindow()
|
||||||
@@ -177,4 +185,40 @@ extension BrowserViewController: ShortcutResponder
|
|||||||
createNewTab(withURL: event.url)
|
createNewTab(withURL: event.url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func raiseScriptPolicyRestriction(_ sender: Any?) {
|
||||||
|
guard let hostOrigin = currentTab.webView.url?.securityOrigin else { return }
|
||||||
|
let currentPolicy = policyManager.scriptPolicy(forOrigin: hostOrigin)
|
||||||
|
policyManager.setScriptPolicyType(currentPolicy.policyType--, forOrigin: hostOrigin)
|
||||||
|
didChangeScriptPolicy()
|
||||||
|
}
|
||||||
|
|
||||||
|
func lowerScriptPolicyRestriction(_ sender: Any?) {
|
||||||
|
guard let hostOrigin = currentTab.webView.url?.securityOrigin else { return }
|
||||||
|
let currentPolicy = policyManager.scriptPolicy(forOrigin: hostOrigin)
|
||||||
|
policyManager.setScriptPolicyType(currentPolicy.policyType++, forOrigin: hostOrigin)
|
||||||
|
didChangeScriptPolicy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension ScriptPolicy.PolicyType {
|
||||||
|
static postfix func ++ (obj: ScriptPolicy.PolicyType) -> ScriptPolicy.PolicyType {
|
||||||
|
switch obj {
|
||||||
|
case .alpha: .bravo
|
||||||
|
case .bravo: .charlie
|
||||||
|
case .charlie: .delta
|
||||||
|
case .delta: .echo
|
||||||
|
default: obj
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static postfix func -- (obj: ScriptPolicy.PolicyType) -> ScriptPolicy.PolicyType {
|
||||||
|
switch obj {
|
||||||
|
case .bravo: .alpha
|
||||||
|
case .charlie: .bravo
|
||||||
|
case .delta: .charlie
|
||||||
|
case .echo: .delta
|
||||||
|
default: obj
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,30 +10,10 @@ import WebKit
|
|||||||
extension BrowserViewController: WKNavigationDelegate, WKUIDelegate
|
extension BrowserViewController: WKNavigationDelegate, WKUIDelegate
|
||||||
{
|
{
|
||||||
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
|
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
|
||||||
currentTab.loadError = nil
|
if let tab = tabController.tab(forWebView: webView) {
|
||||||
|
// We're alive!
|
||||||
// Check to make sure we have connected to the web content process
|
tab.contentProcessTerminated = false
|
||||||
if !currentTab.bridge.webContentProcessConnected {
|
tab.loadError = nil
|
||||||
// This means we started loading a page but the web content process hasn't loaded, which means
|
|
||||||
// scripts are not getting blocked.
|
|
||||||
|
|
||||||
// If you're ad-hoc signing this, you'll need to disable library validation:
|
|
||||||
// sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation DisableLibraryValidation -bool YES
|
|
||||||
|
|
||||||
DispatchQueue.main.async { [unowned self] in
|
|
||||||
// Stop loading now
|
|
||||||
webView.stopLoading()
|
|
||||||
|
|
||||||
// Show an alert
|
|
||||||
let alert = UIAlertController(title: "Web Process Not Loaded",
|
|
||||||
message: "The web content process never contacted the host application",
|
|
||||||
preferredStyle: .alert)
|
|
||||||
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in
|
|
||||||
alert.dismiss(animated: true, completion: nil)
|
|
||||||
}))
|
|
||||||
|
|
||||||
present(alert, animated: true, completion: nil)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset tracking this
|
// Reset tracking this
|
||||||
@@ -120,6 +100,10 @@ extension BrowserViewController: WKNavigationDelegate, WKUIDelegate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
|
||||||
|
tabController.tab(forWebView: webView)?.contentProcessTerminated = true
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: WKUIDelegate
|
// MARK: WKUIDelegate
|
||||||
|
|
||||||
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView?
|
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView?
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class BrowserViewController: UIViewController
|
|||||||
|
|
||||||
// Script button
|
// Script button
|
||||||
toolbarController.scriptControllerIconView.addAction(UIAction(handler: { [unowned self] action in
|
toolbarController.scriptControllerIconView.addAction(UIAction(handler: { [unowned self] action in
|
||||||
let hostOrigin = self.webView.url?.host ?? ""
|
let hostOrigin = self.webView.url?.securityOrigin ?? ""
|
||||||
let loadedScripts = currentTab.allowedScriptOrigins.union(currentTab.blockedScriptOrigins)
|
let loadedScripts = currentTab.allowedScriptOrigins.union(currentTab.blockedScriptOrigins)
|
||||||
let scriptViewController = ScriptPolicyViewController(policyManager: self.policyManager,
|
let scriptViewController = ScriptPolicyViewController(policyManager: self.policyManager,
|
||||||
hostOrigin: hostOrigin,
|
hostOrigin: hostOrigin,
|
||||||
@@ -520,6 +520,8 @@ class BrowserViewController: UIViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal func updateTitleAndURL(forWebView webView: WKWebView) {
|
internal func updateTitleAndURL(forWebView webView: WKWebView) {
|
||||||
|
guard let tab = tabController.tab(forWebView: webView) else { return }
|
||||||
|
|
||||||
if webView == browserView.webView {
|
if webView == browserView.webView {
|
||||||
browserView.titlebarView.setTitle(webView.title ?? "")
|
browserView.titlebarView.setTitle(webView.title ?? "")
|
||||||
|
|
||||||
@@ -531,8 +533,7 @@ class BrowserViewController: UIViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Figure out which tab this corresponds to
|
// Figure out which tab this corresponds to
|
||||||
let tab = tabController.tabs.first { $0.webView == webView }
|
if let tabIndex = tabController.tabs.firstIndex(of: tab) {
|
||||||
if let tab = tab, let tabIndex = tabController.tabs.firstIndex(of: tab) {
|
|
||||||
tabBarViewController.tabBarView.reloadTab(atIndex: tabIndex)
|
tabBarViewController.tabBarView.reloadTab(atIndex: tabIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -593,6 +594,19 @@ class BrowserViewController: UIViewController
|
|||||||
|
|
||||||
// Blur url bar, if applicable
|
// Blur url bar, if applicable
|
||||||
toolbarController.urlBar.textField.resignFirstResponder()
|
toolbarController.urlBar.textField.resignFirstResponder()
|
||||||
|
|
||||||
|
// If this tab's web content process was jettisoned while in background,
|
||||||
|
// its current page may appear blank and url be nil. Proactively reload
|
||||||
|
// when the tab becomes active again to restore state.
|
||||||
|
if tab.contentProcessTerminated {
|
||||||
|
if webView.url != nil || tab.url != nil {
|
||||||
|
webView.reload()
|
||||||
|
} else if let home = tab.homeURL {
|
||||||
|
tab.beginLoadingURL(home)
|
||||||
|
} else {
|
||||||
|
webView.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func target(forAction action: Selector, withSender sender: Any?) -> Any? {
|
override func target(forAction action: Selector, withSender sender: Any?) -> Any? {
|
||||||
@@ -617,6 +631,18 @@ class BrowserViewController: UIViewController
|
|||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
becomeFirstResponder()
|
becomeFirstResponder()
|
||||||
|
|
||||||
|
// If the app resumed and the current tab's web content process was
|
||||||
|
// terminated while in background, ensure we restore it now.
|
||||||
|
if currentTab.contentProcessTerminated {
|
||||||
|
if webView.url != nil || currentTab.url != nil {
|
||||||
|
webView.reload()
|
||||||
|
} else if let home = currentTab.homeURL {
|
||||||
|
currentTab.beginLoadingURL(home)
|
||||||
|
} else {
|
||||||
|
webView.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal func updateScriptBlockerButton() {
|
internal func updateScriptBlockerButton() {
|
||||||
@@ -769,7 +795,7 @@ extension BrowserViewController: UITextFieldDelegate
|
|||||||
|
|
||||||
currentTab.beginLoadingURL(url)
|
currentTab.beginLoadingURL(url)
|
||||||
} else {
|
} else {
|
||||||
let searchURL = Settings.shared.searchProvider.provider().searchURLWithQuery(text)
|
let searchURL = Settings.shared.currentSearchProvider().searchURLWithQuery(text)
|
||||||
currentTab.beginLoadingURL(searchURL)
|
currentTab.beginLoadingURL(searchURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,11 +804,7 @@ extension BrowserViewController: UITextFieldDelegate
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
func textFieldDidEndEditing(_ textField: UITextField) {
|
func textFieldDidEndEditing(_ textField: UITextField) {
|
||||||
if !changingFocusToAutocompleteController {
|
if !changingFocusToAutocompleteController {
|
||||||
autocompleteViewController.view.isHidden = true
|
autocompleteViewController.view.isHidden = true
|
||||||
|
|||||||
@@ -103,9 +103,16 @@ class DocumentControlItemView: UIControl
|
|||||||
separatorView.isHidden = !drawsBottomSeparator
|
separatorView.isHidden = !drawsBottomSeparator
|
||||||
}
|
}
|
||||||
|
|
||||||
override func setTracking(_ tracking: Bool) {
|
override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool {
|
||||||
super.setTracking(tracking)
|
super.beginTracking(touch, with: event)
|
||||||
highlightView.isHidden = !tracking
|
highlightView.isHidden = false
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override func endTracking(_ touch: UITouch?, with event: UIEvent?) {
|
||||||
|
super.endTracking(touch, with: event)
|
||||||
|
highlightView.isHidden = true
|
||||||
}
|
}
|
||||||
|
|
||||||
public func title(_ title: String) -> Self {
|
public func title(_ title: String) -> Self {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class FindOnPageViewController: UIViewController, _WKFindDelegate
|
|||||||
|
|
||||||
findOnPageView.textField.addAction(UIAction(handler: { [unowned self] _ in
|
findOnPageView.textField.addAction(UIAction(handler: { [unowned self] _ in
|
||||||
self.findString = findOnPageView.textField.text
|
self.findString = findOnPageView.textField.text
|
||||||
webView?._find(self.findString, options: self.findOptions, maxCount: Int(self.maxCount))
|
webView?._find(self.findString, options: self.findOptions, maxCount: UInt(self.maxCount))
|
||||||
}), for: .editingChanged)
|
}), for: .editingChanged)
|
||||||
|
|
||||||
findOnPageView.prevResultButton.addAction(UIAction(handler: { [unowned self] _ in
|
findOnPageView.prevResultButton.addAction(UIAction(handler: { [unowned self] _ in
|
||||||
@@ -82,24 +82,20 @@ class FindOnPageViewController: UIViewController, _WKFindDelegate
|
|||||||
|
|
||||||
@objc
|
@objc
|
||||||
override func findNext(_ sender: Any?) {
|
override func findNext(_ sender: Any?) {
|
||||||
webView?._find(self.findString, options: self.findOptions, maxCount: Int(self.maxCount))
|
webView?._find(self.findString, options: self.findOptions, maxCount: UInt(self.maxCount))
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
override func findPrevious(_ sender: Any?) {
|
override func findPrevious(_ sender: Any?) {
|
||||||
let options: _WKFindOptions = self.findOptions.union(.backwards)
|
let options: _WKFindOptions = self.findOptions.union(.backwards)
|
||||||
webView?._find(self.findString, options: options, maxCount: Int(self.maxCount))
|
webView?._find(self.findString, options: options, maxCount: UInt(self.maxCount))
|
||||||
}
|
}
|
||||||
|
|
||||||
func _webView(_ webView: WKWebView!, didFailToFind string: String!) {
|
func _webView(_ webView: WKWebView!, didFailToFind string: String!) {
|
||||||
// ??
|
// ??
|
||||||
}
|
}
|
||||||
|
|
||||||
private func _webView(_ webView: WKWebView!, didCountMatches matches: UInt, for string: String!) {
|
internal func _webView(_ webView: WKWebView!, didFindMatches matches: UInt, for string: String!, withMatch matchIndex: Int) {
|
||||||
// TODO: Update a label
|
|
||||||
}
|
|
||||||
|
|
||||||
private func _webView(_ webView: WKWebView!, didFindMatches matches: UInt, for string: String!, withMatch matchIndex: Int) {
|
|
||||||
findOnPageView.nextResultButton.isEnabled = matches > 0
|
findOnPageView.nextResultButton.isEnabled = matches > 0
|
||||||
findOnPageView.prevResultButton.isEnabled = matches > 0
|
findOnPageView.prevResultButton.isEnabled = matches > 0
|
||||||
}
|
}
|
||||||
|
|||||||
12
App/Hacks/Hacks.h
Normal file
12
App/Hacks/Hacks.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// Hacks.h
|
||||||
|
// App
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 5/5/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
extern Class DecodedClass(const char *encodedClassName);
|
||||||
|
extern SEL DecodedSelector(const char *encodedSelectorName);
|
||||||
|
extern void SwizzleClassMethod(Class targetClass, SEL originalSelector, IMP replacementIMP);
|
||||||
31
App/Hacks/Hacks.m
Normal file
31
App/Hacks/Hacks.m
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
//
|
||||||
|
// Hacks.m
|
||||||
|
// App
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 5/5/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "Hacks.h"
|
||||||
|
#import <objc/runtime.h>
|
||||||
|
|
||||||
|
Class DecodedClass(const char *encodedClassName) {
|
||||||
|
NSData *data = [NSData dataWithBytesNoCopy:(void *)encodedClassName length:strlen(encodedClassName) freeWhenDone:NO];
|
||||||
|
data = [[NSData alloc] initWithBase64EncodedData:data options:0];
|
||||||
|
|
||||||
|
NSString *str = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
|
||||||
|
return NSClassFromString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
SEL DecodedSelector(const char *encodedSelectorName) {
|
||||||
|
NSData *data = [NSData dataWithBytesNoCopy:(void *)encodedSelectorName length:strlen(encodedSelectorName) freeWhenDone:NO];
|
||||||
|
data = [[NSData alloc] initWithBase64EncodedData:data options:0];
|
||||||
|
|
||||||
|
NSString *str = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
|
||||||
|
return NSSelectorFromString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SwizzleClassMethod(Class targetClass, SEL originalSelector, IMP replacementIMP)
|
||||||
|
{
|
||||||
|
Method originalMethod = class_getClassMethod(targetClass, originalSelector);
|
||||||
|
method_setImplementation(originalMethod, replacementIMP);
|
||||||
|
}
|
||||||
@@ -7,27 +7,43 @@
|
|||||||
|
|
||||||
#import <CoreFoundation/CoreFoundation.h>
|
#import <CoreFoundation/CoreFoundation.h>
|
||||||
#import <MessageUI/MessageUI.h>
|
#import <MessageUI/MessageUI.h>
|
||||||
|
#import <WebKit/WKWebView.h>
|
||||||
#import <objc/runtime.h>
|
#import <objc/runtime.h>
|
||||||
|
#import "Hacks.h"
|
||||||
@interface MFMailComposeViewController (InternalMethods)
|
|
||||||
+ (BOOL)canSendMailSourceAccountManagement:(NSInteger)sourceAccountManagement;
|
|
||||||
@end
|
|
||||||
|
|
||||||
static void swizzleClassMethod(Class targetClass, SEL originalSelector, IMP replacementIMP)
|
|
||||||
{
|
|
||||||
Method originalMethod = class_getClassMethod(targetClass, originalSelector);
|
|
||||||
method_setImplementation(originalMethod, replacementIMP);
|
|
||||||
}
|
|
||||||
|
|
||||||
__attribute__((constructor))
|
__attribute__((constructor))
|
||||||
static void swizzleMFMailComposeViewController(void)
|
static void swizzleMFMailComposeViewController(void)
|
||||||
{
|
{
|
||||||
// Hacks to work around the fact that MFMailComposeViewController is broken in iOS 14+
|
// Hacks to work around the fact that MFMailComposeViewController is broken in iOS 14+
|
||||||
swizzleClassMethod(MFMailComposeViewController.class, @selector(canSendMail), imp_implementationWithBlock(^BOOL(void) {
|
SwizzleClassMethod(MFMailComposeViewController.class, @selector(canSendMail), imp_implementationWithBlock(^BOOL(void) {
|
||||||
return YES;
|
return YES;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
swizzleClassMethod(MFMailComposeViewController.class, @selector(canSendMailSourceAccountManagement:), imp_implementationWithBlock(^BOOL(NSInteger sam) {
|
SEL canSendMailSourceAccountManagement = DecodedSelector("Y2FuU2VuZE1haWxTb3VyY2VBY2NvdW50TWFuYWdlbWVudDo=");
|
||||||
|
SwizzleClassMethod(MFMailComposeViewController.class, canSendMailSourceAccountManagement, imp_implementationWithBlock(^BOOL(NSInteger sam) {
|
||||||
return YES;
|
return YES;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@interface WKWebView (Hacks)
|
||||||
|
+ (BOOL)orig_handlesURLScheme:(NSString *)scheme;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation WKWebView (Hacks)
|
||||||
|
+ (BOOL)orig_handlesURLScheme:(NSString *)scheme
|
||||||
|
{
|
||||||
|
if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [self orig_handlesURLScheme:scheme];
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
__attribute__((constructor))
|
||||||
|
static void swizzleWebKitConfiguration(void)
|
||||||
|
{
|
||||||
|
Method origMethod = class_getClassMethod(WKWebView.class, @selector(handlesURLScheme:));
|
||||||
|
Method replMethod = class_getClassMethod(WKWebView.class, @selector(orig_handlesURLScheme:));
|
||||||
|
method_exchangeImplementations(origMethod, replMethod);
|
||||||
|
}
|
||||||
|
|||||||
@@ -56,6 +56,15 @@ protocol ShortcutResponder: AnyObject {
|
|||||||
|
|
||||||
@objc
|
@objc
|
||||||
optional func handleOpenURL(_ sender: Any?, forEvent event: OpenURLEvent?)
|
optional func handleOpenURL(_ sender: Any?, forEvent event: OpenURLEvent?)
|
||||||
|
|
||||||
|
@objc
|
||||||
|
optional func lowerScriptPolicyRestriction(_ sender: Any?)
|
||||||
|
|
||||||
|
@objc
|
||||||
|
optional func raiseScriptPolicyRestriction(_ sender: Any?)
|
||||||
|
|
||||||
|
@objc
|
||||||
|
optional func zoomToActualSize(_ sender: Any?)
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OpenURLEvent: UIEvent {
|
public class OpenURLEvent: UIEvent {
|
||||||
@@ -153,6 +162,22 @@ public class KeyboardShortcuts {
|
|||||||
action: #selector(ShortcutResponder.stop)
|
action: #selector(ShortcutResponder.stop)
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
UIMenu(options: .displayInline, children: [
|
||||||
|
// Raise Script Policy Restriction
|
||||||
|
UIKeyCommand(
|
||||||
|
modifiers: [.alternate], input: "x",
|
||||||
|
title: "Raise Script Policy Restriction",
|
||||||
|
action: #selector(ShortcutResponder.raiseScriptPolicyRestriction)
|
||||||
|
),
|
||||||
|
|
||||||
|
// Lower Script Policy Restriction
|
||||||
|
UIKeyCommand(
|
||||||
|
modifiers: [.alternate], input: "c",
|
||||||
|
title: "Lower Script Policy Restriction",
|
||||||
|
action: #selector(ShortcutResponder.lowerScriptPolicyRestriction)
|
||||||
|
),
|
||||||
|
])
|
||||||
].removeNulls()
|
].removeNulls()
|
||||||
|
|
||||||
case .go:
|
case .go:
|
||||||
@@ -201,6 +226,30 @@ public class KeyboardShortcuts {
|
|||||||
|
|
||||||
case .view:
|
case .view:
|
||||||
return [
|
return [
|
||||||
|
// Zoom
|
||||||
|
UIMenu(options: .displayInline, children: [
|
||||||
|
// Actual Size
|
||||||
|
UIKeyCommand(
|
||||||
|
modifiers: .command, input: "0",
|
||||||
|
title: "Actual Size",
|
||||||
|
action: #selector(ShortcutResponder.zoomToActualSize)
|
||||||
|
),
|
||||||
|
|
||||||
|
// Increase Zoom
|
||||||
|
UIKeyCommand(
|
||||||
|
modifiers: .command, input: "=",
|
||||||
|
title: "Zoom In",
|
||||||
|
action: #selector(UIResponder.increaseSize)
|
||||||
|
),
|
||||||
|
|
||||||
|
// Go Forward
|
||||||
|
UIKeyCommand(
|
||||||
|
modifiers: .command, input: "-",
|
||||||
|
title: "Zoom Out",
|
||||||
|
action: #selector(UIResponder.decreaseSize)
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
|
||||||
// Toggle Dark Mode
|
// Toggle Dark Mode
|
||||||
UIKeyCommand(
|
UIKeyCommand(
|
||||||
modifiers: [.command], input: "M",
|
modifiers: [.command], input: "M",
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ html, iframe {
|
|||||||
-webkit-filter: invert(100%) !important;
|
-webkit-filter: invert(100%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
em,
|
|
||||||
img,
|
img,
|
||||||
svg,
|
svg,
|
||||||
form,
|
form,
|
||||||
|
|||||||
74
App/Settings/AddSearchEngineViewController.swift
Normal file
74
App/Settings/AddSearchEngineViewController.swift
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
//
|
||||||
|
// AddSearchEngineViewController.swift
|
||||||
|
// App
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 9/29/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
struct AddSearchEngineView: View
|
||||||
|
{
|
||||||
|
@State var model: ViewModel
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
Form {
|
||||||
|
Section {
|
||||||
|
HStack {
|
||||||
|
Text("Name")
|
||||||
|
TextField("Name", text: $model.name)
|
||||||
|
.multilineTextAlignment(.trailing)
|
||||||
|
.autocorrectionDisabled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
HStack {
|
||||||
|
Text("URL")
|
||||||
|
TextField("https://example.com/query=%q", text: $model.url)
|
||||||
|
.multilineTextAlignment(.trailing)
|
||||||
|
.autocorrectionDisabled()
|
||||||
|
.textContentType(.none)
|
||||||
|
}
|
||||||
|
} footer: {
|
||||||
|
Text("URL must contain %q, which will be replaced by the query. ")
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Toggle("Set as default", isOn: $model.makeDefault)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.navigationTitle("Add Search Engine")
|
||||||
|
}
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
@Observable
|
||||||
|
class ViewModel
|
||||||
|
{
|
||||||
|
var name: String = ""
|
||||||
|
var url: String = ""
|
||||||
|
var makeDefault: Bool = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
class AddSearchEngineViewController: UIHostingController<AddSearchEngineView>
|
||||||
|
{
|
||||||
|
public var viewModel: AddSearchEngineView.ViewModel
|
||||||
|
|
||||||
|
init() {
|
||||||
|
self.viewModel = AddSearchEngineView.ViewModel()
|
||||||
|
super.init(rootView: AddSearchEngineView(model: viewModel))
|
||||||
|
}
|
||||||
|
|
||||||
|
@MainActor @preconcurrency required dynamic init?(coder aDecoder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
@Previewable @State var model = AddSearchEngineView.ViewModel()
|
||||||
|
AddSearchEngineView(model: model)
|
||||||
|
}
|
||||||
@@ -23,8 +23,8 @@ struct AmberSettingsView: View {
|
|||||||
@Environment(\.presentationMode)
|
@Environment(\.presentationMode)
|
||||||
@Binding private var presentationMode
|
@Binding private var presentationMode
|
||||||
|
|
||||||
@State private var searchProvider = Settings.shared.searchProvider {
|
@State private var defaultSearchEngineName = Settings.shared.defaultSearchEngineName {
|
||||||
didSet { Settings.shared.searchProvider = searchProvider }
|
didSet { Settings.shared.defaultSearchEngineName = defaultSearchEngineName }
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -35,12 +35,12 @@ struct AmberSettingsView: View {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Section(header: Text("Search Provider"), content: {
|
Section(header: Text("Search Provider"), content: {
|
||||||
ForEach(Settings.SearchProviderSetting.allCases, id: \.self, content: { setting in
|
ForEach(Array(Settings.shared.searchEngines.keys).sorted(), id: \.self, content: { name in
|
||||||
Button(action: { searchProvider = setting }, label: {
|
Button(action: { defaultSearchEngineName = name }, label: {
|
||||||
HStack {
|
HStack {
|
||||||
Text(setting.rawValue)
|
Text(name)
|
||||||
Spacer()
|
Spacer()
|
||||||
if searchProvider == setting {
|
if defaultSearchEngineName == name {
|
||||||
Image(systemName: "checkmark")
|
Image(systemName: "checkmark")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,55 +109,56 @@ class GeneralSettingsViewController: UIViewController
|
|||||||
case searchEngine = "Search Engine"
|
case searchEngine = "Search Engine"
|
||||||
case syncServer = "Sync Server"
|
case syncServer = "Sync Server"
|
||||||
}
|
}
|
||||||
|
|
||||||
typealias Item = String
|
typealias Item = String
|
||||||
|
|
||||||
static let SearchProviderPopupItem = "searchProvider.popup"
|
static let SearchProviderPopupItem = "searchProvider.popup"
|
||||||
static let SyncServerItem = "syncServer.field"
|
static let SyncServerItem = "syncServer.field"
|
||||||
|
|
||||||
let dataSource: UICollectionViewDiffableDataSource<Section, Item>
|
let dataSource: UICollectionViewDiffableDataSource<Section, Item>
|
||||||
let collectionView: UICollectionView
|
let collectionView: UICollectionView
|
||||||
|
let viewModel: ViewModel
|
||||||
|
|
||||||
static func createLayout(forIdiom idiom: UIUserInterfaceIdiom) -> UICollectionViewLayout {
|
static func createLayout(forIdiom idiom: UIUserInterfaceIdiom) -> UICollectionViewLayout {
|
||||||
#if targetEnvironment(macCatalyst)
|
#if targetEnvironment(macCatalyst)
|
||||||
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),
|
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),
|
||||||
heightDimension: .fractionalHeight(1.0))
|
heightDimension: .fractionalHeight(1.0))
|
||||||
let item = NSCollectionLayoutItem(layoutSize: itemSize)
|
let item = NSCollectionLayoutItem(layoutSize: itemSize)
|
||||||
|
|
||||||
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.60),
|
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.60),
|
||||||
heightDimension: .absolute(44))
|
heightDimension: .absolute(44))
|
||||||
|
|
||||||
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 1)
|
|
||||||
group.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .flexible(1.0), top: nil, trailing: nil, bottom: nil)
|
|
||||||
|
|
||||||
let insets = NSDirectionalEdgeInsets(top: 24.0, leading: 64.0, bottom: 24.0, trailing: 64.0)
|
|
||||||
|
|
||||||
let headerFooterSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.40),
|
|
||||||
heightDimension: .estimated(44.0))
|
|
||||||
let sectionHeader = NSCollectionLayoutBoundarySupplementaryItem(
|
|
||||||
layoutSize: headerFooterSize,
|
|
||||||
elementKind: UICollectionView.elementKindSectionHeader,
|
|
||||||
alignment: .topLeading,
|
|
||||||
absoluteOffset: CGPoint(x: insets.leading, y: insets.top + 5.0)
|
|
||||||
)
|
|
||||||
sectionHeader.extendsBoundary = false
|
|
||||||
sectionHeader.contentInsets = insets
|
|
||||||
|
|
||||||
let section = NSCollectionLayoutSection(group: group)
|
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 1)
|
||||||
// section.interGroupSpacing = spacing
|
group.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .flexible(1.0), top: nil, trailing: nil, bottom: nil)
|
||||||
section.contentInsets = insets
|
|
||||||
section.supplementariesFollowContentInsets = true
|
|
||||||
section.boundarySupplementaryItems = [ sectionHeader ]
|
|
||||||
|
|
||||||
let layout = UICollectionViewCompositionalLayout(section: section)
|
let insets = NSDirectionalEdgeInsets(top: 24.0, leading: 64.0, bottom: 24.0, trailing: 64.0)
|
||||||
return layout
|
|
||||||
#else
|
let headerFooterSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.40),
|
||||||
var listConfiguration = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
|
heightDimension: .estimated(44.0))
|
||||||
listConfiguration.headerMode = .supplementary
|
let sectionHeader = NSCollectionLayoutBoundarySupplementaryItem(
|
||||||
return UICollectionViewCompositionalLayout.list(using: listConfiguration)
|
layoutSize: headerFooterSize,
|
||||||
#endif
|
elementKind: UICollectionView.elementKindSectionHeader,
|
||||||
|
alignment: .topLeading,
|
||||||
|
absoluteOffset: CGPoint(x: insets.leading, y: insets.top + 5.0)
|
||||||
|
)
|
||||||
|
sectionHeader.extendsBoundary = false
|
||||||
|
sectionHeader.contentInsets = insets
|
||||||
|
|
||||||
|
let section = NSCollectionLayoutSection(group: group)
|
||||||
|
// section.interGroupSpacing = spacing
|
||||||
|
section.contentInsets = insets
|
||||||
|
section.supplementariesFollowContentInsets = true
|
||||||
|
section.boundarySupplementaryItems = [ sectionHeader ]
|
||||||
|
|
||||||
|
let layout = UICollectionViewCompositionalLayout(section: section)
|
||||||
|
return layout
|
||||||
|
#else
|
||||||
|
var listConfiguration = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
|
||||||
|
listConfiguration.headerMode = .supplementary
|
||||||
|
return UICollectionViewCompositionalLayout.list(using: listConfiguration)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static func sectionHeaderConfiguration(forIdiom idiom: UIUserInterfaceIdiom, sectionName: String) -> UIContentConfiguration {
|
static func sectionHeaderConfiguration(forIdiom idiom: UIUserInterfaceIdiom, sectionName: String) -> UIContentConfiguration {
|
||||||
if idiom == .mac {
|
if idiom == .mac {
|
||||||
return LabelContentConfiguration(
|
return LabelContentConfiguration(
|
||||||
@@ -166,33 +167,41 @@ class GeneralSettingsViewController: UIViewController
|
|||||||
textAlignment: .right
|
textAlignment: .right
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
var config = UIListContentConfiguration.plainHeader()
|
var config = UIListContentConfiguration.header()
|
||||||
config.text = sectionName
|
config.text = sectionName
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if targetEnvironment(macCatalyst)
|
#if targetEnvironment(macCatalyst)
|
||||||
static let staticIdiom = UIUserInterfaceIdiom.mac
|
static let staticIdiom = UIUserInterfaceIdiom.mac
|
||||||
#else
|
#else
|
||||||
static let staticIdiom = UIUserInterfaceIdiom.pad
|
static let staticIdiom = UIUserInterfaceIdiom.pad
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
let actionHandler = { (action: UIAction) in
|
let actionHandler = { (action: UIAction) in
|
||||||
let providerString = action.title
|
let engineName = action.title
|
||||||
let provider = Settings.SearchProviderSetting(rawValue: providerString)!
|
Settings.shared.defaultSearchEngineName = engineName
|
||||||
Settings.shared.searchProvider = provider
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let viewModel = ViewModel()
|
||||||
let itemCellRegistry = UICollectionView.CellRegistration<UICollectionViewCell, Item> { cell, indexPath, identifier in
|
let itemCellRegistry = UICollectionView.CellRegistration<UICollectionViewCell, Item> { cell, indexPath, identifier in
|
||||||
if identifier == Self.SearchProviderPopupItem {
|
if identifier == Self.SearchProviderPopupItem {
|
||||||
let menu = UIMenu(children: Settings.SearchProviderSetting.allCases.map { provider in
|
let names = Settings.shared.searchEngines.keys.sorted()
|
||||||
let action = UIAction(title: provider.rawValue, handler: actionHandler)
|
var engineMenuItems: [UIMenuElement] = names.map { name in
|
||||||
action.state = Settings.shared.searchProvider == provider ? .on : .off
|
let action = UIAction(title: name, handler: actionHandler)
|
||||||
|
action.state = (Settings.shared.defaultSearchEngineName == name) ? .on : .off
|
||||||
return action
|
return action
|
||||||
})
|
}
|
||||||
|
|
||||||
|
engineMenuItems.append(UIMenu(options: .displayInline, children: [
|
||||||
|
UIAction(title: "Manage Search Engines…", handler: { _ in
|
||||||
|
viewModel.onManageSearchEngines()
|
||||||
|
})
|
||||||
|
]))
|
||||||
|
|
||||||
|
let menu = UIMenu(children: engineMenuItems)
|
||||||
cell.contentConfiguration = ButtonContentConfiguration(menu: menu)
|
cell.contentConfiguration = ButtonContentConfiguration(menu: menu)
|
||||||
} else if identifier == Self.SyncServerItem {
|
} else if identifier == Self.SyncServerItem {
|
||||||
cell.contentConfiguration = TextFieldContentConfiguration(
|
cell.contentConfiguration = TextFieldContentConfiguration(
|
||||||
@@ -206,58 +215,114 @@ class GeneralSettingsViewController: UIViewController
|
|||||||
returnKeyType: .done
|
returnKeyType: .done
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !targetEnvironment(macCatalyst)
|
#if !targetEnvironment(macCatalyst)
|
||||||
cell.backgroundConfiguration = UIBackgroundConfiguration.listGroupedCell()
|
cell.backgroundConfiguration = UIBackgroundConfiguration.listCell()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
let sectionHeaderRegistry = UICollectionView.SupplementaryRegistration<UICollectionViewCell>(elementKind: UICollectionView.elementKindSectionHeader, handler: {
|
let sectionHeaderRegistry = UICollectionView.SupplementaryRegistration<UICollectionViewCell>(elementKind: UICollectionView.elementKindSectionHeader, handler: {
|
||||||
(cell, string, indexPath) in
|
(cell, string, indexPath) in
|
||||||
let sectionName = Section.allCases[indexPath.section].rawValue
|
let sectionName = Section.allCases[indexPath.section].rawValue
|
||||||
cell.contentConfiguration = Self.sectionHeaderConfiguration(forIdiom: Self.staticIdiom, sectionName: sectionName)
|
cell.contentConfiguration = Self.sectionHeaderConfiguration(forIdiom: Self.staticIdiom, sectionName: sectionName)
|
||||||
})
|
})
|
||||||
|
|
||||||
let layout = Self.createLayout(forIdiom: Self.staticIdiom)
|
let layout = Self.createLayout(forIdiom: Self.staticIdiom)
|
||||||
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
||||||
collectionView.backgroundColor = .systemGroupedBackground
|
collectionView.backgroundColor = .systemGroupedBackground
|
||||||
|
|
||||||
dataSource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView) {
|
dataSource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: collectionView) {
|
||||||
(collectionView, indexPath, identifier) in
|
(collectionView, indexPath, identifier) in
|
||||||
return collectionView.dequeueConfiguredReusableCell(using: itemCellRegistry, for: indexPath, item: identifier)
|
return collectionView.dequeueConfiguredReusableCell(using: itemCellRegistry, for: indexPath, item: identifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
dataSource.supplementaryViewProvider = { collectionView, elementKind, indexPath in
|
dataSource.supplementaryViewProvider = { collectionView, elementKind, indexPath in
|
||||||
return collectionView.dequeueConfiguredReusableSupplementary(using: sectionHeaderRegistry, for: indexPath)
|
return collectionView.dequeueConfiguredReusableSupplementary(using: sectionHeaderRegistry, for: indexPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.viewModel = viewModel
|
||||||
|
|
||||||
super.init(nibName: nil, bundle: nil)
|
super.init(nibName: nil, bundle: nil)
|
||||||
|
|
||||||
collectionView.delegate = self
|
collectionView.delegate = self
|
||||||
tabBarItem.title = "General"
|
tabBarItem.title = "General"
|
||||||
tabBarItem.image = UIImage(systemName: "gear")
|
tabBarItem.image = UIImage(systemName: "gear")
|
||||||
|
|
||||||
|
let resetPopup = { [weak self] in
|
||||||
|
guard let self else { return }
|
||||||
|
|
||||||
|
var snapshot = dataSource.snapshot()
|
||||||
|
snapshot.reloadItems([ Self.SearchProviderPopupItem ])
|
||||||
|
dataSource.apply(snapshot, animatingDifferences: false)
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel.onManageSearchEngines = { [weak self] in
|
||||||
|
guard let self else { return }
|
||||||
|
|
||||||
|
// Reset menu item (to show currently selected search engine)
|
||||||
|
resetPopup()
|
||||||
|
|
||||||
|
let viewController = ManageSearchEnginesViewController()
|
||||||
|
viewController.title = "Manage Search Engines"
|
||||||
|
|
||||||
|
viewController.model.onAddSearchEngine = { [weak self] in
|
||||||
|
guard let self else { return }
|
||||||
|
|
||||||
|
let addSearchEngineViewController = AddSearchEngineViewController()
|
||||||
|
let navController = UINavigationController(rootViewController: addSearchEngineViewController)
|
||||||
|
|
||||||
|
// Cancel
|
||||||
|
addSearchEngineViewController.navigationItem.leftBarButtonItem = UIBarButtonItem(systemItem: .cancel, primaryAction: UIAction { _ in
|
||||||
|
navController.dismiss(animated: true)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Done
|
||||||
|
addSearchEngineViewController.navigationItem.rightBarButtonItem = UIBarButtonItem(systemItem: .done, primaryAction: UIAction { [weak self] _ in
|
||||||
|
self?.saveCustomSearchEngine(model: addSearchEngineViewController.viewModel)
|
||||||
|
navController.dismiss(animated: true)
|
||||||
|
|
||||||
|
resetPopup()
|
||||||
|
viewController.model.reloadConfiguredEngines()
|
||||||
|
})
|
||||||
|
|
||||||
|
self.present(navController, animated: true)
|
||||||
|
}
|
||||||
|
|
||||||
|
viewController.model.onChangeEngines = {
|
||||||
|
resetPopup()
|
||||||
|
}
|
||||||
|
|
||||||
|
#if targetEnvironment(macCatalyst)
|
||||||
|
let alertController = UIAlertController(title: "Not yet implemented for macOS.", message: nil, preferredStyle: .alert)
|
||||||
|
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in alertController.dismiss(animated: true) }))
|
||||||
|
present(alertController, animated: true)
|
||||||
|
#else
|
||||||
|
navigationController?.pushViewController(viewController, animated: true)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func loadView() {
|
override func loadView() {
|
||||||
self.view = collectionView
|
self.view = collectionView
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
applySnapshot(animatingDifferences: false)
|
||||||
var snapshot = dataSource.snapshot()
|
|
||||||
snapshot.appendSections(Section.allCases)
|
|
||||||
// iOS
|
|
||||||
// snapshot.appendItems(Settings.SearchProviderSetting.allCases.map { $0.rawValue }, toSection: .searchEngine)
|
|
||||||
snapshot.appendItems([ Self.SearchProviderPopupItem ], toSection: .searchEngine)
|
|
||||||
snapshot.appendItems([ Self.SyncServerItem ], toSection: .syncServer)
|
|
||||||
dataSource.apply(snapshot, animatingDifferences: false)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Types
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
@Observable
|
||||||
|
class ViewModel
|
||||||
|
{
|
||||||
|
var onManageSearchEngines: () -> Void = {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension GeneralSettingsViewController : UICollectionViewDelegate {
|
extension GeneralSettingsViewController : UICollectionViewDelegate {
|
||||||
@@ -265,3 +330,36 @@ extension GeneralSettingsViewController : UICollectionViewDelegate {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension GeneralSettingsViewController {
|
||||||
|
func applySnapshot(animatingDifferences: Bool) {
|
||||||
|
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
|
||||||
|
snapshot.appendSections(Section.allCases)
|
||||||
|
snapshot.appendItems([ Self.SearchProviderPopupItem ], toSection: .searchEngine)
|
||||||
|
snapshot.appendItems([ Self.SyncServerItem ], toSection: .syncServer)
|
||||||
|
dataSource.apply(snapshot, animatingDifferences: animatingDifferences)
|
||||||
|
}
|
||||||
|
|
||||||
|
func saveCustomSearchEngine(model: AddSearchEngineView.ViewModel) {
|
||||||
|
let name = model.name.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
|
let url = model.url.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
|
guard !name.isEmpty, !url.isEmpty else { return }
|
||||||
|
|
||||||
|
// Require placeholder
|
||||||
|
guard url.contains("%q") || url.contains("%s") else { return }
|
||||||
|
|
||||||
|
// Save
|
||||||
|
var engines = Settings.shared.searchEngines
|
||||||
|
engines[name] = url
|
||||||
|
Settings.shared.searchEngines = engines
|
||||||
|
|
||||||
|
if model.makeDefault {
|
||||||
|
Settings.shared.defaultSearchEngineName = name
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset inputs and refresh UI
|
||||||
|
var snapshot = dataSource.snapshot()
|
||||||
|
snapshot.reloadItems([ Self.SearchProviderPopupItem ])
|
||||||
|
dataSource.apply(snapshot, animatingDifferences: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
139
App/Settings/ManageSearchEnginesViewController.swift
Normal file
139
App/Settings/ManageSearchEnginesViewController.swift
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
//
|
||||||
|
// ManageSearchEnginesViewController.swift
|
||||||
|
// App
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 9/29/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
struct ManageSearchEnginesView: View
|
||||||
|
{
|
||||||
|
@State var model: ViewModel
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
Form {
|
||||||
|
Section {
|
||||||
|
List($model.configuredEngines, editActions: .delete) { row in
|
||||||
|
HStack {
|
||||||
|
Image(uiImage: .checkmark)
|
||||||
|
.opacity(row.wrappedValue.isDefault ? 1.0 : 0.0)
|
||||||
|
|
||||||
|
VStack(alignment: .leading) {
|
||||||
|
Text(row.wrappedValue.name)
|
||||||
|
.font(.body)
|
||||||
|
.bold()
|
||||||
|
|
||||||
|
Text(row.wrappedValue.url)
|
||||||
|
.font(.caption)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.id(row.id)
|
||||||
|
|
||||||
|
.swipeActions(edge: .leading) {
|
||||||
|
Button { model.makeDefault(row.id) } label: {
|
||||||
|
Label("Make Default", systemImage: "checkmark")
|
||||||
|
}
|
||||||
|
.tint(.blue)
|
||||||
|
}
|
||||||
|
|
||||||
|
.swipeActions(edge: .trailing) {
|
||||||
|
Button(role: .destructive) { model.deleteEngine(row.id) } label: {
|
||||||
|
Label("Delete", systemImage: "trash")
|
||||||
|
}
|
||||||
|
.disabled(model.configuredEngines.count <= 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Button("Add Search Engine…") {
|
||||||
|
model.onAddSearchEngine()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Types
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
@Observable
|
||||||
|
class ViewModel
|
||||||
|
{
|
||||||
|
var configuredEngines: [ConfiguredEngine] = []
|
||||||
|
var onAddSearchEngine: () -> Void = {}
|
||||||
|
var onChangeEngines: () -> Void = {}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
reloadConfiguredEngines()
|
||||||
|
}
|
||||||
|
|
||||||
|
func reloadConfiguredEngines() {
|
||||||
|
let defaultEngine = Settings.shared.defaultSearchEngineName
|
||||||
|
self.configuredEngines = Settings.shared.searchEngines.map { val in
|
||||||
|
ConfiguredEngine(
|
||||||
|
name: val.key,
|
||||||
|
url: val.value,
|
||||||
|
isDefault: val.key == defaultEngine
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func deleteEngine(_ id: ConfiguredEngine.ID) {
|
||||||
|
let engine = configuredEngines.first { $0.url == id }!
|
||||||
|
|
||||||
|
var engines = Settings.shared.searchEngines
|
||||||
|
engines.removeValue(forKey: engine.name)
|
||||||
|
Settings.shared.searchEngines = engines
|
||||||
|
|
||||||
|
if engine.isDefault {
|
||||||
|
// Pick another default
|
||||||
|
if let firstEngine = engines.first {
|
||||||
|
Settings.shared.defaultSearchEngineName = firstEngine.key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadConfiguredEngines()
|
||||||
|
onChangeEngines()
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeDefault(_ id: ConfiguredEngine.ID) {
|
||||||
|
let engineName = configuredEngines.first { $0.url == id }!.name
|
||||||
|
Settings.shared.defaultSearchEngineName = engineName
|
||||||
|
|
||||||
|
reloadConfiguredEngines()
|
||||||
|
onChangeEngines()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ConfiguredEngine: Identifiable
|
||||||
|
{
|
||||||
|
let name: String
|
||||||
|
let url: String
|
||||||
|
let isDefault: Bool
|
||||||
|
|
||||||
|
var id: String { url }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
class ManageSearchEnginesViewController: UIHostingController<ManageSearchEnginesView>
|
||||||
|
{
|
||||||
|
let model: ManageSearchEnginesView.ViewModel
|
||||||
|
|
||||||
|
init() {
|
||||||
|
self.model = ManageSearchEnginesView.ViewModel()
|
||||||
|
super.init(rootView: ManageSearchEnginesView(model: model))
|
||||||
|
}
|
||||||
|
|
||||||
|
required dynamic init?(coder aDecoder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
@Previewable @State var model = ManageSearchEnginesView.ViewModel()
|
||||||
|
ManageSearchEnginesView(model: model)
|
||||||
|
}
|
||||||
@@ -74,26 +74,28 @@ extension String: RawRepresentable {
|
|||||||
class Settings
|
class Settings
|
||||||
{
|
{
|
||||||
static let shared = Settings()
|
static let shared = Settings()
|
||||||
|
|
||||||
public enum SearchProviderSetting: String, CaseIterable {
|
// Map of search engine name -> URL template containing %q or %s placeholder
|
||||||
case google = "Google"
|
// Defaults preserve the previous built-in engines
|
||||||
case duckduckgo = "DuckDuckGo"
|
@SettingProperty(key: "searchEngines")
|
||||||
case searxnor = "Searx.nor"
|
public var searchEngines: [String: String] = [
|
||||||
case whoogle = "Whoogle.nor"
|
"Google": "https://google.com/search?q=%q&gbv=1",
|
||||||
|
"DuckDuckGo": "https://html.duckduckgo.com/html/?q=%q",
|
||||||
func provider() -> SearchProvider {
|
]
|
||||||
switch self {
|
|
||||||
case .google: return SearchProvider.google
|
// Name of the default search engine from `searchEngines`
|
||||||
case .duckduckgo: return SearchProvider.duckduckgo
|
@SettingProperty(key: "defaultSearchEngine")
|
||||||
case .searxnor: return SearchProvider.searxnor
|
public var defaultSearchEngineName: String = "Searx.nor"
|
||||||
case .whoogle: return SearchProvider.whoogle
|
|
||||||
}
|
// Convenience to build a SearchProvider from current default
|
||||||
|
func currentSearchProvider() -> SearchProvider {
|
||||||
|
if let template = searchEngines[defaultSearchEngineName] {
|
||||||
|
return SearchProvider.fromTemplate(template)
|
||||||
}
|
}
|
||||||
|
// Fallback to Google if something goes wrong
|
||||||
|
return SearchProvider.fromTemplate("https://google.com/search?q=%q&gbv=1")
|
||||||
}
|
}
|
||||||
|
|
||||||
@SettingProperty(key: "searchProvider")
|
|
||||||
public var searchProvider: SearchProviderSetting = .searxnor
|
|
||||||
|
|
||||||
@SettingProperty(key: "redirectRules")
|
@SettingProperty(key: "redirectRules")
|
||||||
public var redirectRules: [String: String] = [:]
|
public var redirectRules: [String: String] = [:]
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
|
<key>LSApplicationCategoryType</key>
|
||||||
|
<string>public.app-category.utilities</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
#import "SBRProcessBundleBridge.h"
|
#import "SBRProcessBundleBridge.h"
|
||||||
#import "SBRScriptPolicy.h"
|
#import "SBRScriptPolicy.h"
|
||||||
|
|
||||||
|
#import "WebKitDefines.h"
|
||||||
|
|
||||||
// SPI
|
// SPI
|
||||||
#import <UIKit/UITextField_Private.h>
|
|
||||||
#import <WebKit/WKWebViewPrivate.h>
|
#import <WebKit/WKWebViewPrivate.h>
|
||||||
#import <WebKit/_WKFindDelegate.h>
|
#import <WebKit/_WKFindDelegate.h>
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,5 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.network.client</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.developer.web-browser</key>
|
|
||||||
<true/>
|
|
||||||
<key>com.apple.developer.device-information.user-assigned-device-name</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
19
App/Supporting Files/WebKitDefines.h
Normal file
19
App/Supporting Files/WebKitDefines.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// WebKitDefines.h
|
||||||
|
// SBrowser
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 4/11/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef WebKitDefines_h
|
||||||
|
#define WebKitDefines_h
|
||||||
|
|
||||||
|
#define WK_API_AVAILABLE(...)
|
||||||
|
#define WK_API_UNAVAILABLE(...)
|
||||||
|
#define WK_CLASS_AVAILABLE(...) __attribute__((visibility("default"))) WK_API_AVAILABLE(__VA_ARGS__)
|
||||||
|
#define WK_API_DEPRECATED(_message, ...) __attribute__((deprecated(_message)))
|
||||||
|
#define WK_API_DEPRECATED_WITH_REPLACEMENT(_replacement, ...) __attribute__((deprecated("use " #_replacement)))
|
||||||
|
#define WK_CLASS_DEPRECATED_WITH_REPLACEMENT(_replacement, ...) __attribute__((visibility("default"))) __attribute__((deprecated("use " #_replacement)))
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* WebKitDefines_h */
|
||||||
@@ -19,12 +19,8 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
|||||||
|
|
||||||
public var tabInfo: TabInfo {
|
public var tabInfo: TabInfo {
|
||||||
get {
|
get {
|
||||||
TabInfo(
|
updateMetadata()
|
||||||
title: loadedWebView?.title,
|
return _tabInfo
|
||||||
urlString: loadedWebView?.url?.absoluteString ?? self.homeURL?.absoluteString,
|
|
||||||
faviconData: self.favicon?.pngData(),
|
|
||||||
identifier: self.identifier
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,6 +39,8 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
|||||||
}
|
}
|
||||||
public var policyManager: ResourcePolicyManager
|
public var policyManager: ResourcePolicyManager
|
||||||
|
|
||||||
|
private var _tabInfo: TabInfo = TabInfo()
|
||||||
|
|
||||||
private var loadedWebView: WKWebView? = nil
|
private var loadedWebView: WKWebView? = nil
|
||||||
public var title: String? { get { tabInfo.title } }
|
public var title: String? { get { tabInfo.title } }
|
||||||
public var url: URL? {
|
public var url: URL? {
|
||||||
@@ -82,6 +80,7 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
|||||||
@Published public var favicon: UIImage?
|
@Published public var favicon: UIImage?
|
||||||
|
|
||||||
public var loadError: Error?
|
public var loadError: Error?
|
||||||
|
public var contentProcessTerminated: Bool = false
|
||||||
|
|
||||||
private var faviconHost: String?
|
private var faviconHost: String?
|
||||||
private var faviconRequest: AnyCancellable?
|
private var faviconRequest: AnyCancellable?
|
||||||
@@ -151,4 +150,15 @@ class Tab: NSObject, SBRProcessBundleBridgeDelegate
|
|||||||
.assign(to: \.favicon, on: self)
|
.assign(to: \.favicon, on: self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func updateMetadata() {
|
||||||
|
guard contentProcessTerminated == false else { return }
|
||||||
|
|
||||||
|
_tabInfo = TabInfo(
|
||||||
|
title: loadedWebView?.title,
|
||||||
|
urlString: loadedWebView?.url?.absoluteString ?? self.homeURL?.absoluteString,
|
||||||
|
faviconData: self.favicon?.pngData(),
|
||||||
|
identifier: self.identifier
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ class TabController
|
|||||||
tabs.first { $0.identifier == identifier }
|
tabs.first { $0.identifier == identifier }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func tab(forWebView webView: WKWebView) -> Tab? {
|
||||||
|
tabs.first { $0.webView == webView }
|
||||||
|
}
|
||||||
|
|
||||||
func createNewTab(url: URL?) -> Tab {
|
func createNewTab(url: URL?) -> Tab {
|
||||||
return self.createNewTab(url: url, webViewConfiguration: nil)
|
return self.createNewTab(url: url, webViewConfiguration: nil)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import QuartzCore_Private
|
|
||||||
|
|
||||||
class SecurityIndicatorView: UIView
|
class SecurityIndicatorView: UIView
|
||||||
{
|
{
|
||||||
@@ -70,7 +69,7 @@ class TitlebarView: UIView
|
|||||||
addSubview(separatorView)
|
addSubview(separatorView)
|
||||||
|
|
||||||
separatorView.backgroundColor = UIColor(white: 1.0, alpha: 0.20)
|
separatorView.backgroundColor = UIColor(white: 1.0, alpha: 0.20)
|
||||||
separatorView.layer.compositingFilter = kCAFilterPlusL
|
separatorView.layer.compositingFilter = "kCAFilterPlusL"
|
||||||
|
|
||||||
titleLabelView.textColor = .white
|
titleLabelView.textColor = .white
|
||||||
titleLabelView.layer.shadowColor = UIColor.black.cgColor
|
titleLabelView.layer.shadowColor = UIColor.black.cgColor
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ class URLBar: ReliefButton
|
|||||||
|
|
||||||
controlsView.autoresizingMask = []
|
controlsView.autoresizingMask = []
|
||||||
controlsView.clearButton.addAction(.init(handler: { [textField] _ in
|
controlsView.clearButton.addAction(.init(handler: { [textField] _ in
|
||||||
textField.clearText()
|
textField.text = ""
|
||||||
}), for: .primaryActionTriggered)
|
}), for: .primaryActionTriggered)
|
||||||
|
|
||||||
controlsView.autocorrectButton.addAction(.init(handler: { [unowned self] _ in
|
controlsView.autocorrectButton.addAction(.init(handler: { [unowned self] _ in
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ extension CGRect
|
|||||||
|
|
||||||
public func centeredY(inRect: CGRect) -> CGRect {
|
public func centeredY(inRect: CGRect) -> CGRect {
|
||||||
var rect = self
|
var rect = self
|
||||||
rect.origin.y = CGRound(inRect.origin.y + (inRect.height - rect.height) / 2.0)
|
rect.origin.y = (inRect.origin.y + (inRect.height - rect.height) / 2.0).rounded()
|
||||||
|
|
||||||
return rect
|
return rect
|
||||||
}
|
}
|
||||||
|
|
||||||
public func centeredX(inRect: CGRect) -> CGRect {
|
public func centeredX(inRect: CGRect) -> CGRect {
|
||||||
var rect = self
|
var rect = self
|
||||||
rect.origin.x = CGRound(inRect.origin.x + (inRect.width - rect.width) / 2.0)
|
rect.origin.x = (inRect.origin.x + (inRect.width - rect.width) / 2.0).rounded()
|
||||||
|
|
||||||
return rect
|
return rect
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,3 +24,10 @@ extension String {
|
|||||||
return replacingCharacters(in: startIndex..<endIndex, with: "…")
|
return replacingCharacters(in: startIndex..<endIndex, with: "…")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension URL {
|
||||||
|
internal var securityOrigin: String {
|
||||||
|
// TODO: This could be smarter…
|
||||||
|
return self.host() ?? ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ NS_SWIFT_NAME(ProcessBundleBridge)
|
|||||||
@property (nonatomic, assign) BOOL allowAllScripts; // default is NO
|
@property (nonatomic, assign) BOOL allowAllScripts; // default is NO
|
||||||
@property (nonatomic, assign) BOOL darkModeEnabled;
|
@property (nonatomic, assign) BOOL darkModeEnabled;
|
||||||
|
|
||||||
@property (nonatomic, readonly) BOOL webContentProcessConnected;
|
|
||||||
|
|
||||||
- (instancetype)initWithWebViewConfiguration:(nullable WKWebViewConfiguration *)webViewConfiguration NS_DESIGNATED_INITIALIZER;
|
- (instancetype)initWithWebViewConfiguration:(nullable WKWebViewConfiguration *)webViewConfiguration NS_DESIGNATED_INITIALIZER;
|
||||||
|
|
||||||
- (void)policyDataSourceDidChange;
|
- (void)policyDataSourceDidChange;
|
||||||
|
|||||||
@@ -7,64 +7,117 @@
|
|||||||
|
|
||||||
#import "SBRProcessBundleBridge.h"
|
#import "SBRProcessBundleBridge.h"
|
||||||
|
|
||||||
#import "SBRWebProcessDelegate.h"
|
#import "SBRScriptPolicy.h"
|
||||||
#import "SBRWebProcessProxy.h"
|
#import "Hacks.h"
|
||||||
|
|
||||||
|
#import <OSLog/OSLog.h>
|
||||||
|
|
||||||
#import <WebKit/_WKRemoteObjectInterface.h>
|
#import <WebKit/_WKRemoteObjectInterface.h>
|
||||||
#import <WebKit/_WKRemoteObjectRegistry.h>
|
#import <WebKit/_WKRemoteObjectRegistry.h>
|
||||||
#import <WebKit/_WKProcessPoolConfiguration.h>
|
#import <WebKit/_WKProcessPoolConfiguration.h>
|
||||||
#import <WebKit/_WKUserStyleSheet.h>
|
|
||||||
|
|
||||||
#import <WebKit/WKProcessPoolPrivate.h>
|
#import <WebKit/WKProcessPoolPrivate.h>
|
||||||
#import <WebKit/WKWebViewPrivate.h>
|
#import <WebKit/WKWebViewPrivate.h>
|
||||||
#import <WebKit/WKWebViewConfigurationPrivate.h>
|
#import <WebKit/WKWebViewConfigurationPrivate.h>
|
||||||
#import <WebKit/WKUserContentControllerPrivate.h>
|
|
||||||
|
|
||||||
@interface SBRProcessBundleBridge () <SBRWebProcessDelegate>
|
#define WKUserStyleSheet id
|
||||||
|
#define WKUserStyleSheetEncodedClassName "X1dLVXNlclN0eWxlU2hlZXQ="
|
||||||
|
|
||||||
|
@interface StyleSheet : NSObject <NSCopying>
|
||||||
|
@property (nonatomic, readonly, copy) NSString *source;
|
||||||
|
@property (nonatomic, readonly, copy) NSURL *baseURL;
|
||||||
|
@property (nonatomic, readonly, getter=isForMainFrameOnly) BOOL forMainFrameOnly;
|
||||||
|
|
||||||
|
- (instancetype)initWithSource:(NSString *)source forMainFrameOnly:(BOOL)forMainFrameOnly;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface WKUserContentController (Private)
|
||||||
|
- (void)__addUserStyleSheet:(WKUserStyleSheet)userStyleSheet;
|
||||||
|
- (void)__removeUserStyleSheet:(WKUserStyleSheet)userStyleSheet;
|
||||||
|
- (void)__addUserScriptImmediately:(WKUserScript *)userScript;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation WKUserContentController (Private)
|
||||||
|
|
||||||
|
- (void)__addUserStyleSheet:(id)userStyleSheet
|
||||||
|
{
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||||
|
[self performSelector:DecodedSelector("X2FkZFVzZXJTdHlsZVNoZWV0Og==") withObject:userStyleSheet];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)__removeUserStyleSheet:(id)userStyleSheet
|
||||||
|
{
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||||
|
[self performSelector:DecodedSelector("X3JlbW92ZVVzZXJTdHlsZVNoZWV0Og==") withObject:userStyleSheet];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)__addUserScriptImmediately:(WKUserScript *)userScript
|
||||||
|
{
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||||
|
[self performSelector:DecodedSelector("X2FkZFVzZXJTY3JpcHRJbW1lZGlhdGVseTo=") withObject:userScript];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#define LOG_DEBUG(format, ...) os_log_debug(_log, format, ##__VA_ARGS__)
|
||||||
|
#define LOG_ERROR(format, ...) os_log_error(_log, format, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
@interface NSURLResponse (BridgeAdditions)
|
||||||
|
@property (nonatomic, readonly) BOOL isJavascriptResponse;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation NSURLResponse (BridgeAdditions)
|
||||||
|
|
||||||
|
- (BOOL)isJavascriptResponse
|
||||||
|
{
|
||||||
|
NSString *extension = [[self URL] pathExtension];
|
||||||
|
if ([[extension lowercaseString] isEqualToString:@"js"]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *MIMEType = [self MIMEType];
|
||||||
|
if ([[MIMEType lowercaseString] containsString:@"javascript"]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface SBRProcessBundleBridge () <WKURLSchemeHandler>
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation SBRProcessBundleBridge {
|
@implementation SBRProcessBundleBridge {
|
||||||
|
os_log_t _log;
|
||||||
|
|
||||||
WKWebView *_webView;
|
WKWebView *_webView;
|
||||||
WKWebViewConfiguration *_webViewConfiguration;
|
WKWebViewConfiguration *_webViewConfiguration;
|
||||||
WKProcessPool *_processPool;
|
WKProcessPool *_processPool;
|
||||||
id<SBRWebProcessProxy> _webProcessProxy;
|
|
||||||
|
|
||||||
_WKUserStyleSheet *_darkModeStyleSheet;
|
WKUserStyleSheet _darkModeStyleSheet;
|
||||||
WKUserScript *_readabilityScript;
|
WKUserScript *_readabilityScript;
|
||||||
|
|
||||||
NSArray<WKUserScript *> *_userScripts;
|
NSArray<WKUserScript *> *_userScripts;
|
||||||
|
|
||||||
|
dispatch_queue_t _dataTasksAccessQueue;
|
||||||
|
NSMutableDictionary<NSURLRequest *, NSURLSessionDataTask *> *_dataTasks;
|
||||||
|
|
||||||
// These come from settings.
|
// These come from settings.
|
||||||
_WKUserStyleSheet *_customizedUserStylesheet;
|
WKUserStyleSheet _customizedUserStylesheet;
|
||||||
WKUserScript *_customizedUserScript;
|
WKUserScript *_customizedUserScript;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tearDown
|
- (void)tearDown
|
||||||
{
|
{
|
||||||
[[_webView _remoteObjectRegistry] unregisterExportedObject:self interface:[self _webProcessDelegateInterface]];
|
// This was used to unregister the delegate with the web process.
|
||||||
}
|
|
||||||
|
|
||||||
- (_WKRemoteObjectInterface *)_webProcessDelegateInterface
|
|
||||||
{
|
|
||||||
static dispatch_once_t onceToken;
|
|
||||||
static _WKRemoteObjectInterface *interface = nil;
|
|
||||||
dispatch_once(&onceToken, ^{
|
|
||||||
interface = [_WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:@protocol(SBRWebProcessDelegate)];
|
|
||||||
});
|
|
||||||
|
|
||||||
return interface;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (_WKRemoteObjectInterface *)_webProcessProxyInterface
|
|
||||||
{
|
|
||||||
static dispatch_once_t onceToken;
|
|
||||||
static _WKRemoteObjectInterface *interface = nil;
|
|
||||||
dispatch_once(&onceToken, ^{
|
|
||||||
interface = [_WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:@protocol(SBRWebProcessProxy)];
|
|
||||||
});
|
|
||||||
|
|
||||||
return interface;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithWebViewConfiguration:(WKWebViewConfiguration *)webViewConfiguration
|
- (instancetype)initWithWebViewConfiguration:(WKWebViewConfiguration *)webViewConfiguration
|
||||||
@@ -72,32 +125,22 @@
|
|||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
if (!webViewConfiguration) {
|
if (!webViewConfiguration) {
|
||||||
|
_log = os_log_create("net.buzzert.attractor.webview", "bridge");
|
||||||
|
|
||||||
webViewConfiguration = [[WKWebViewConfiguration alloc] init];
|
webViewConfiguration = [[WKWebViewConfiguration alloc] init];
|
||||||
|
|
||||||
// Inject bundle
|
|
||||||
_WKProcessPoolConfiguration *poolConfiguration = [[_WKProcessPoolConfiguration alloc] init];
|
|
||||||
NSURL *bundleURL = [[[NSBundle mainBundle] builtInPlugInsURL] URLByAppendingPathComponent:@"SBrowserProcessBundle.bundle"];
|
|
||||||
|
|
||||||
// Make sure it exists. Bail if otherwise.
|
|
||||||
NSBundle *pluginBundle = [NSBundle bundleWithURL:bundleURL];
|
|
||||||
NSAssert(pluginBundle != nil, @"Attix process bundle not found at %@", bundleURL.path);
|
|
||||||
|
|
||||||
[poolConfiguration setInjectedBundleURL:bundleURL];
|
|
||||||
|
|
||||||
// Set up process pool
|
// Set up process pool
|
||||||
_processPool = [[WKProcessPool alloc] _initWithConfiguration:poolConfiguration];
|
_processPool = [[WKProcessPool alloc] init];
|
||||||
|
|
||||||
// Initialize allowed origins now
|
|
||||||
NSDictionary<NSString *, NSNumber *> *policies = [_policyDataSource scriptPolicyTypeByOrigin];
|
|
||||||
NSArray<NSString *> *allowedOrigins = [[_policyDataSource allowedOriginsForScriptResources] allObjects];
|
|
||||||
[_processPool _setObject:allowedOrigins forBundleParameter:SBRGetAllowedOriginsKey()];
|
|
||||||
[_processPool _setObject:@(_allowAllScripts) forBundleParameter:SBRGetAllScriptsAllowedKey()];
|
|
||||||
[_processPool _setObject:policies forBundleParameter:SBRGetPolicyTypeByOriginKey()];
|
|
||||||
|
|
||||||
webViewConfiguration.processPool = _processPool;
|
webViewConfiguration.processPool = _processPool;
|
||||||
|
|
||||||
webViewConfiguration._waitsForPaintAfterViewDidMoveToWindow = NO;
|
webViewConfiguration._waitsForPaintAfterViewDidMoveToWindow = NO;
|
||||||
webViewConfiguration._applePayEnabled = YES;
|
webViewConfiguration._applePayEnabled = YES;
|
||||||
|
|
||||||
|
_dataTasks = [NSMutableDictionary dictionary];
|
||||||
|
_dataTasksAccessQueue = dispatch_queue_create("net.buzzert.attractor.dataTasksAccess", DISPATCH_QUEUE_SERIAL);
|
||||||
|
|
||||||
|
[webViewConfiguration setURLSchemeHandler:self forURLScheme:@"http"];
|
||||||
|
[webViewConfiguration setURLSchemeHandler:self forURLScheme:@"https"];
|
||||||
}
|
}
|
||||||
|
|
||||||
_webViewConfiguration = webViewConfiguration;
|
_webViewConfiguration = webViewConfiguration;
|
||||||
@@ -117,12 +160,6 @@
|
|||||||
webView.findInteractionEnabled = YES;
|
webView.findInteractionEnabled = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure proxy interface (interface to remote web process)
|
|
||||||
_webProcessProxy = [[webView _remoteObjectRegistry] remoteObjectProxyWithInterface:[self _webProcessProxyInterface]];
|
|
||||||
|
|
||||||
// Configure delegate interface (registering us as the web process delegate for the remote process)
|
|
||||||
[[webView _remoteObjectRegistry] registerExportedObject:self interface:[self _webProcessDelegateInterface]];
|
|
||||||
|
|
||||||
_webView = webView;
|
_webView = webView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,10 +188,8 @@
|
|||||||
- (void)reloadCustomizedUserScriptsAndStylesheets
|
- (void)reloadCustomizedUserScriptsAndStylesheets
|
||||||
{
|
{
|
||||||
WKUserContentController *userContentController = [_webViewConfiguration userContentController];
|
WKUserContentController *userContentController = [_webViewConfiguration userContentController];
|
||||||
if (_customizedUserScript) {
|
[userContentController removeAllUserScripts];
|
||||||
[userContentController _removeUserScript:_customizedUserScript];
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString *scriptSource = [[NSUserDefaults standardUserDefaults] stringForKey:@"userScript"];
|
NSString *scriptSource = [[NSUserDefaults standardUserDefaults] stringForKey:@"userScript"];
|
||||||
if ([scriptSource length]) {
|
if ([scriptSource length]) {
|
||||||
_customizedUserScript = [[WKUserScript alloc] initWithSource:scriptSource injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
|
_customizedUserScript = [[WKUserScript alloc] initWithSource:scriptSource injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
|
||||||
@@ -162,55 +197,123 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_customizedUserStylesheet) {
|
if (_customizedUserStylesheet) {
|
||||||
[userContentController _removeUserStyleSheet:_customizedUserStylesheet];
|
[userContentController __removeUserStyleSheet:_customizedUserStylesheet];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *stylesheetSource = [[NSUserDefaults standardUserDefaults] stringForKey:@"userStylesheet"];
|
NSString *stylesheetSource = [[NSUserDefaults standardUserDefaults] stringForKey:@"userStylesheet"];
|
||||||
if ([stylesheetSource length]) {
|
if ([stylesheetSource length]) {
|
||||||
_customizedUserStylesheet = [[_WKUserStyleSheet alloc] initWithSource:stylesheetSource forMainFrameOnly:YES];
|
_customizedUserStylesheet = [[DecodedClass(WKUserStyleSheetEncodedClassName) alloc] initWithSource:stylesheetSource forMainFrameOnly:YES];
|
||||||
[userContentController _addUserStyleSheet:_customizedUserStylesheet];
|
[userContentController __addUserStyleSheet:_customizedUserStylesheet];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark <SBRWebProcessDelegate>
|
#pragma mark Former <SBRWebProcessDelegate> methods
|
||||||
|
|
||||||
- (void)webProcessDidConnect
|
|
||||||
{
|
|
||||||
NSLog(@"SBRProcessBundleBridge: did connect. Saying hello, syncing allowlist");
|
|
||||||
_webContentProcessConnected = YES;
|
|
||||||
|
|
||||||
[_webProcessProxy hello];
|
|
||||||
[self policyDataSourceDidChange];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)webProcessDidAllowScriptWithOrigin:(NSString *)origin
|
- (void)webProcessDidAllowScriptWithOrigin:(NSString *)origin
|
||||||
{
|
{
|
||||||
[[self delegate] webProcess:self didAllowScriptResourceFromOrigin:origin];
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[[self delegate] webProcess:self didAllowScriptResourceFromOrigin:origin];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)webProcessDidBlockScriptWithOrigin:(NSString *)origin
|
- (void)webProcessDidBlockScriptWithOrigin:(NSString *)origin
|
||||||
{
|
{
|
||||||
[[self delegate] webProcess:self didBlockScriptResourceFromOrigin:origin];
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[[self delegate] webProcess:self didBlockScriptResourceFromOrigin:origin];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark <WKURLSchemeHandler>
|
||||||
|
|
||||||
|
- (void)webView:(WKWebView *)webView startURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask
|
||||||
|
{
|
||||||
|
NSString *hostOrigin = [[_webView URL] host];
|
||||||
|
NSURLRequest *request = [urlSchemeTask request];
|
||||||
|
|
||||||
|
LOG_DEBUG("Start URL scheme task: request: %@", request);
|
||||||
|
|
||||||
|
__weak __auto_type welf = self;
|
||||||
|
NSURLSessionDataTask *dataTask = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error)
|
||||||
|
{
|
||||||
|
if (!welf) return;
|
||||||
|
__strong __auto_type sself = welf;
|
||||||
|
|
||||||
|
if (error != nil) {
|
||||||
|
[urlSchemeTask didFailWithError:error];
|
||||||
|
} else if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
|
||||||
|
NSURL *requestURL = [request URL];
|
||||||
|
NSString *resourceOrigin = [requestURL host];
|
||||||
|
const __auto_type allowResource = ^{
|
||||||
|
os_log_debug(sself->_log, "Allowing resource: %@", requestURL.lastPathComponent);
|
||||||
|
[urlSchemeTask didReceiveResponse:response];
|
||||||
|
[urlSchemeTask didReceiveData:data];
|
||||||
|
[urlSchemeTask didFinish];
|
||||||
|
|
||||||
|
[self webProcessDidAllowScriptWithOrigin:resourceOrigin];
|
||||||
|
};
|
||||||
|
|
||||||
|
const __auto_type denyResource = ^{
|
||||||
|
os_log_debug(sself->_log, "Blocking resource: %@", requestURL.lastPathComponent);
|
||||||
|
NSHTTPURLResponse *altResponse = [[NSHTTPURLResponse alloc] initWithURL:requestURL
|
||||||
|
MIMEType:@"application/javascript"
|
||||||
|
expectedContentLength:0 textEncodingName:@"utf8"];
|
||||||
|
[urlSchemeTask didReceiveResponse:altResponse];
|
||||||
|
[urlSchemeTask didReceiveData:[NSData data]];
|
||||||
|
[urlSchemeTask didFinish];
|
||||||
|
|
||||||
|
[self webProcessDidBlockScriptWithOrigin:resourceOrigin];
|
||||||
|
};
|
||||||
|
|
||||||
|
// Check MIME type for JavaScript responses.
|
||||||
|
if ([response isJavascriptResponse] && ![sself allowAllScripts]) {
|
||||||
|
dispatch_async(sself->_dataTasksAccessQueue, ^{
|
||||||
|
NSDictionary<NSString *, NSNumber *> *policyTypes = [sself->_policyDataSource scriptPolicyTypeByOrigin];
|
||||||
|
NSNumber *policyType = [policyTypes objectForKey:hostOrigin];
|
||||||
|
|
||||||
|
SBRScriptPolicy *policy = [[SBRScriptPolicy alloc] initWithSecurityOrigin:hostOrigin policyType:[policyType integerValue]];
|
||||||
|
if ([policy allowsExternalJavaScriptResourceOrigin:resourceOrigin]) {
|
||||||
|
allowResource();
|
||||||
|
} else {
|
||||||
|
denyResource();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
allowResource();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
[urlSchemeTask didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:0 userInfo:nil]];
|
||||||
|
}
|
||||||
|
|
||||||
|
[sself->_dataTasks removeObjectForKey:request];
|
||||||
|
}];
|
||||||
|
|
||||||
|
[_dataTasks setObject:dataTask forKey:request];
|
||||||
|
[dataTask resume];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)webView:(WKWebView *)webView stopURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask
|
||||||
|
{
|
||||||
|
NSURLRequest *request = [urlSchemeTask request];
|
||||||
|
NSURLSessionDataTask *dataTask = [_dataTasks objectForKey:request];
|
||||||
|
if (dataTask) {
|
||||||
|
if ([dataTask state] != NSURLSessionTaskStateCanceling) {
|
||||||
|
[dataTask cancel];
|
||||||
|
}
|
||||||
|
|
||||||
|
[_dataTasks removeObjectForKey:request];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark Actions
|
#pragma mark Actions
|
||||||
|
|
||||||
- (void)policyDataSourceDidChange
|
- (void)policyDataSourceDidChange
|
||||||
{
|
{
|
||||||
NSArray<NSString *> *allowedOrigins = [[_policyDataSource allowedOriginsForScriptResources] allObjects];
|
// This was used when we had to signal the process bundle.
|
||||||
[_processPool _setObject:allowedOrigins forBundleParameter:SBRGetAllowedOriginsKey()];
|
|
||||||
[_webProcessProxy syncAllowedResourceOrigins:allowedOrigins];
|
|
||||||
|
|
||||||
NSDictionary<NSString *, NSNumber *> *policyTypes = [_policyDataSource scriptPolicyTypeByOrigin];
|
|
||||||
[_processPool _setObject:policyTypes forBundleParameter:SBRGetPolicyTypeByOriginKey()];
|
|
||||||
[_webProcessProxy syncPolicyTypes:policyTypes];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setAllowAllScripts:(BOOL)allowAllScripts
|
- (void)setAllowAllScripts:(BOOL)allowAllScripts
|
||||||
{
|
{
|
||||||
_allowAllScripts = allowAllScripts;
|
_allowAllScripts = allowAllScripts;
|
||||||
[_processPool _setObject:@(_allowAllScripts) forBundleParameter:SBRGetAllScriptsAllowedKey()];
|
|
||||||
[_webProcessProxy setAllScriptsAllowed:allowAllScripts];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setDarkModeEnabled:(BOOL)darkModeEnabled
|
- (void)setDarkModeEnabled:(BOOL)darkModeEnabled
|
||||||
@@ -223,16 +326,15 @@
|
|||||||
if (!_darkModeStyleSheet) {
|
if (!_darkModeStyleSheet) {
|
||||||
NSURL *styleSheetURL = [[NSBundle mainBundle] URLForResource:@"darkmode" withExtension:@"css"];
|
NSURL *styleSheetURL = [[NSBundle mainBundle] URLForResource:@"darkmode" withExtension:@"css"];
|
||||||
NSString *styleSheetSource = [NSString stringWithContentsOfURL:styleSheetURL encoding:NSUTF8StringEncoding error:nil];
|
NSString *styleSheetSource = [NSString stringWithContentsOfURL:styleSheetURL encoding:NSUTF8StringEncoding error:nil];
|
||||||
_darkModeStyleSheet = [[_WKUserStyleSheet alloc] initWithSource:styleSheetSource forMainFrameOnly:NO];
|
_darkModeStyleSheet = [[DecodedClass(WKUserStyleSheetEncodedClassName) alloc] initWithSource:styleSheetSource forMainFrameOnly:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
[userContentController _addUserStyleSheet:_darkModeStyleSheet];
|
[userContentController __addUserStyleSheet:_darkModeStyleSheet];
|
||||||
} else if (_darkModeStyleSheet) {
|
} else if (_darkModeStyleSheet) {
|
||||||
[userContentController _removeUserStyleSheet:_darkModeStyleSheet];
|
[userContentController __removeUserStyleSheet:_darkModeStyleSheet];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)parseDocumentForReaderMode:(void (^)(NSString * _Nonnull))completionBlock
|
- (void)parseDocumentForReaderMode:(void (^)(NSString * _Nonnull))completionBlock
|
||||||
{
|
{
|
||||||
WKUserContentController *userContentController = [_webViewConfiguration userContentController];
|
WKUserContentController *userContentController = [_webViewConfiguration userContentController];
|
||||||
@@ -241,16 +343,17 @@
|
|||||||
_readabilityScript = [self _loadScriptForResource:@"Readability" withExtension:@"js"];
|
_readabilityScript = [self _loadScriptForResource:@"Readability" withExtension:@"js"];
|
||||||
}
|
}
|
||||||
|
|
||||||
[userContentController _addUserScriptImmediately:_readabilityScript];
|
[userContentController __addUserScriptImmediately:_readabilityScript];
|
||||||
|
|
||||||
NSString *script = @""
|
NSString *script = @""
|
||||||
"var documentClone = document.cloneNode(true);"
|
"var documentClone = document.cloneNode(true);"
|
||||||
"var article = new Readability(documentClone).parse();"
|
"var article = new Readability(documentClone).parse();"
|
||||||
"article.content";
|
"article.content";
|
||||||
|
|
||||||
|
os_log_t log = _log;
|
||||||
[_webView evaluateJavaScript:script completionHandler:^(NSString *result, NSError * _Nullable error) {
|
[_webView evaluateJavaScript:script completionHandler:^(NSString *result, NSError * _Nullable error) {
|
||||||
if (error != nil) {
|
if (error != nil) {
|
||||||
NSLog(@"Bridge: Readability error: %@", error.localizedDescription);
|
os_log_error(log, "Bridge: Readability error: %@", error.localizedDescription);
|
||||||
} else {
|
} else {
|
||||||
completionBlock(result);
|
completionBlock(result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,18 @@ import Foundation
|
|||||||
|
|
||||||
class SearchProvider
|
class SearchProvider
|
||||||
{
|
{
|
||||||
|
// Build a provider from a URL template. Template should contain %q or %s
|
||||||
|
// which will be replaced with the sanitized query string.
|
||||||
|
static func fromTemplate(_ template: String) -> SearchProvider {
|
||||||
|
SearchProvider(resolver: { query in
|
||||||
|
let sanitized = query.sanitized()
|
||||||
|
let replaced = template
|
||||||
|
.replacingOccurrences(of: "%q", with: sanitized)
|
||||||
|
.replacingOccurrences(of: "%s", with: sanitized)
|
||||||
|
return URL(string: replaced) ?? URL(string: "https://google.com/search?q=\(sanitized)&gbv=1")!
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
static let google = SearchProvider(resolver: { query in
|
static let google = SearchProvider(resolver: { query in
|
||||||
// gbv=1: no JS
|
// gbv=1: no JS
|
||||||
URL(string: "https://google.com/search?q=\(query.sanitized())&gbv=1")!
|
URL(string: "https://google.com/search?q=\(query.sanitized())&gbv=1")!
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 50;
|
objectVersion = 70;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
@@ -27,10 +27,7 @@
|
|||||||
1ADFF46C24C7DE54006DC7AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1ADFF46A24C7DE54006DC7AE /* LaunchScreen.storyboard */; };
|
1ADFF46C24C7DE54006DC7AE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1ADFF46A24C7DE54006DC7AE /* LaunchScreen.storyboard */; };
|
||||||
1ADFF47424C7DE9C006DC7AE /* BrowserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF47324C7DE9C006DC7AE /* BrowserViewController.swift */; };
|
1ADFF47424C7DE9C006DC7AE /* BrowserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF47324C7DE9C006DC7AE /* BrowserViewController.swift */; };
|
||||||
1ADFF47924C7DFF8006DC7AE /* BrowserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF47824C7DFF8006DC7AE /* BrowserView.swift */; };
|
1ADFF47924C7DFF8006DC7AE /* BrowserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF47824C7DFF8006DC7AE /* BrowserView.swift */; };
|
||||||
1ADFF48424C8C12F006DC7AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ADFF48324C8C12F006DC7AE /* Foundation.framework */; };
|
|
||||||
1ADFF48D24C8C176006DC7AE /* SBRProcessBundleBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF48C24C8C176006DC7AE /* SBRProcessBundleBridge.m */; };
|
1ADFF48D24C8C176006DC7AE /* SBRProcessBundleBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF48C24C8C176006DC7AE /* SBRProcessBundleBridge.m */; };
|
||||||
1ADFF4A724C8C271006DC7AE /* SBrowserProcessBundle.bundle in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1ADFF48124C8C12F006DC7AE /* SBrowserProcessBundle.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
|
||||||
1ADFF4AA24C8D477006DC7AE /* SBRProcessPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF4A924C8D477006DC7AE /* SBRProcessPlugin.m */; };
|
|
||||||
1ADFF4AE24C8ED32006DC7AE /* ResourcePolicyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF4AD24C8ED32006DC7AE /* ResourcePolicyManager.swift */; };
|
1ADFF4AE24C8ED32006DC7AE /* ResourcePolicyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF4AD24C8ED32006DC7AE /* ResourcePolicyManager.swift */; };
|
||||||
1ADFF4C024CA6964006DC7AE /* URLBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF4BF24CA6964006DC7AE /* URLBar.swift */; };
|
1ADFF4C024CA6964006DC7AE /* URLBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF4BF24CA6964006DC7AE /* URLBar.swift */; };
|
||||||
1ADFF4C324CA6AF6006DC7AE /* Geometry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF4C224CA6AF6006DC7AE /* Geometry.swift */; };
|
1ADFF4C324CA6AF6006DC7AE /* Geometry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADFF4C224CA6AF6006DC7AE /* Geometry.swift */; };
|
||||||
@@ -47,6 +44,8 @@
|
|||||||
CD361CF6271A3718006E9CA5 /* SBRScriptPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = CD361CF5271A3718006E9CA5 /* SBRScriptPolicy.m */; };
|
CD361CF6271A3718006E9CA5 /* SBRScriptPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = CD361CF5271A3718006E9CA5 /* SBRScriptPolicy.m */; };
|
||||||
CD470C4225DE056600AFBE0E /* BrowserViewController+WebKitDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD470C4125DE056600AFBE0E /* BrowserViewController+WebKitDelegate.swift */; };
|
CD470C4225DE056600AFBE0E /* BrowserViewController+WebKitDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD470C4125DE056600AFBE0E /* BrowserViewController+WebKitDelegate.swift */; };
|
||||||
CD470C4425DE070400AFBE0E /* BrowserViewController+Keyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD470C4325DE070400AFBE0E /* BrowserViewController+Keyboard.swift */; };
|
CD470C4425DE070400AFBE0E /* BrowserViewController+Keyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD470C4325DE070400AFBE0E /* BrowserViewController+Keyboard.swift */; };
|
||||||
|
CD4930D92E8B390200ADDE99 /* AddSearchEngineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4930D82E8B38FC00ADDE99 /* AddSearchEngineViewController.swift */; };
|
||||||
|
CD4930DB2E8B3F6500ADDE99 /* ManageSearchEnginesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4930DA2E8B3F5B00ADDE99 /* ManageSearchEnginesViewController.swift */; };
|
||||||
CD7313E22705349700053347 /* ScriptPolicyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD7313E12705349700053347 /* ScriptPolicyViewController.swift */; };
|
CD7313E22705349700053347 /* ScriptPolicyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD7313E12705349700053347 /* ScriptPolicyViewController.swift */; };
|
||||||
CD7313E4270534B800053347 /* ScriptPolicyViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD7313E3270534B800053347 /* ScriptPolicyViewControllerDelegate.swift */; };
|
CD7313E4270534B800053347 /* ScriptPolicyViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD7313E3270534B800053347 /* ScriptPolicyViewControllerDelegate.swift */; };
|
||||||
CD7A7E9D2686A9A500E20BA3 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD7A7E9C2686A9A500E20BA3 /* SettingsViewController.swift */; };
|
CD7A7E9D2686A9A500E20BA3 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD7A7E9C2686A9A500E20BA3 /* SettingsViewController.swift */; };
|
||||||
@@ -59,11 +58,11 @@
|
|||||||
CD853BCE24E7763900D2BDCC /* BrowserHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD853BCD24E7763900D2BDCC /* BrowserHistory.swift */; };
|
CD853BCE24E7763900D2BDCC /* BrowserHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD853BCD24E7763900D2BDCC /* BrowserHistory.swift */; };
|
||||||
CD853BD124E778B800D2BDCC /* History.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CD853BCF24E778B800D2BDCC /* History.xcdatamodeld */; };
|
CD853BD124E778B800D2BDCC /* History.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CD853BCF24E778B800D2BDCC /* History.xcdatamodeld */; };
|
||||||
CD853BD424E77BF900D2BDCC /* HistoryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD853BD324E77BF900D2BDCC /* HistoryItem.swift */; };
|
CD853BD424E77BF900D2BDCC /* HistoryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD853BD324E77BF900D2BDCC /* HistoryItem.swift */; };
|
||||||
|
CD8ACBC22DC9A2F7008BF856 /* Hacks.m in Sources */ = {isa = PBXBuildFile; fileRef = CD8ACBC12DC9A2F7008BF856 /* Hacks.m */; };
|
||||||
CD8DBE7B2A85D892006A0FE0 /* LayoutLatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD8DBE7A2A85D892006A0FE0 /* LayoutLatch.swift */; };
|
CD8DBE7B2A85D892006A0FE0 /* LayoutLatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD8DBE7A2A85D892006A0FE0 /* LayoutLatch.swift */; };
|
||||||
CD936A3B289DB3380093A1AC /* TabInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD936A3A289DB3380093A1AC /* TabInfo.swift */; };
|
CD936A3B289DB3380093A1AC /* TabInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD936A3A289DB3380093A1AC /* TabInfo.swift */; };
|
||||||
CD936A3D289DB88B0093A1AC /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD936A3C289DB88B0093A1AC /* UIView+Utils.swift */; };
|
CD936A3D289DB88B0093A1AC /* UIView+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD936A3C289DB88B0093A1AC /* UIView+Utils.swift */; };
|
||||||
CD97CF9225D5BE6F00288FEE /* NavigationControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD97CF9125D5BE6F00288FEE /* NavigationControlsView.swift */; };
|
CD97CF9225D5BE6F00288FEE /* NavigationControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD97CF9125D5BE6F00288FEE /* NavigationControlsView.swift */; };
|
||||||
CD9B88C2272201E900DAAB7E /* SBRScriptPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = CD361CF5271A3718006E9CA5 /* SBRScriptPolicy.m */; };
|
|
||||||
CDACE18C2C5B09F00053AB29 /* StringUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDACE18B2C5B09F00053AB29 /* StringUtilities.swift */; };
|
CDACE18C2C5B09F00053AB29 /* StringUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDACE18B2C5B09F00053AB29 /* StringUtilities.swift */; };
|
||||||
CDAD9CE8263A2DF200FF7199 /* DocumentControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDAD9CE7263A2DF200FF7199 /* DocumentControlsView.swift */; };
|
CDAD9CE8263A2DF200FF7199 /* DocumentControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDAD9CE7263A2DF200FF7199 /* DocumentControlsView.swift */; };
|
||||||
CDAD9CEA263A318F00FF7199 /* ShareableURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDAD9CE9263A318F00FF7199 /* ShareableURL.swift */; };
|
CDAD9CEA263A318F00FF7199 /* ShareableURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDAD9CE9263A318F00FF7199 /* ShareableURL.swift */; };
|
||||||
@@ -87,16 +86,6 @@
|
|||||||
CDF34690276C14BD00FB3141 /* CodeEditorSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDF3468F276C14BD00FB3141 /* CodeEditorSettingsViewController.swift */; };
|
CDF34690276C14BD00FB3141 /* CodeEditorSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDF3468F276C14BD00FB3141 /* CodeEditorSettingsViewController.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
|
||||||
1ADFF48E24C8C230006DC7AE /* PBXContainerItemProxy */ = {
|
|
||||||
isa = PBXContainerItemProxy;
|
|
||||||
containerPortal = 1ADFF45424C7DE53006DC7AE /* Project object */;
|
|
||||||
proxyType = 1;
|
|
||||||
remoteGlobalIDString = 1ADFF48024C8C12F006DC7AE;
|
|
||||||
remoteInfo = SBrowserProcessBundle;
|
|
||||||
};
|
|
||||||
/* End PBXContainerItemProxy section */
|
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
1ADFF4A124C8C25B006DC7AE /* Embed App Extensions */ = {
|
1ADFF4A124C8C25B006DC7AE /* Embed App Extensions */ = {
|
||||||
isa = PBXCopyFilesBuildPhase;
|
isa = PBXCopyFilesBuildPhase;
|
||||||
@@ -104,7 +93,6 @@
|
|||||||
dstPath = "";
|
dstPath = "";
|
||||||
dstSubfolderSpec = 13;
|
dstSubfolderSpec = 13;
|
||||||
files = (
|
files = (
|
||||||
1ADFF4A724C8C271006DC7AE /* SBrowserProcessBundle.bundle in Embed App Extensions */,
|
|
||||||
);
|
);
|
||||||
name = "Embed App Extensions";
|
name = "Embed App Extensions";
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@@ -135,16 +123,10 @@
|
|||||||
1ADFF47324C7DE9C006DC7AE /* BrowserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserViewController.swift; sourceTree = "<group>"; };
|
1ADFF47324C7DE9C006DC7AE /* BrowserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserViewController.swift; sourceTree = "<group>"; };
|
||||||
1ADFF47524C7DF20006DC7AE /* SBrowser.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SBrowser.entitlements; sourceTree = "<group>"; };
|
1ADFF47524C7DF20006DC7AE /* SBrowser.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SBrowser.entitlements; sourceTree = "<group>"; };
|
||||||
1ADFF47824C7DFF8006DC7AE /* BrowserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserView.swift; sourceTree = "<group>"; };
|
1ADFF47824C7DFF8006DC7AE /* BrowserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserView.swift; sourceTree = "<group>"; };
|
||||||
1ADFF48124C8C12F006DC7AE /* SBrowserProcessBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SBrowserProcessBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
1ADFF48324C8C12F006DC7AE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
1ADFF48324C8C12F006DC7AE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||||
1ADFF48624C8C12F006DC7AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
||||||
1ADFF48A24C8C176006DC7AE /* SBrowser-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SBrowser-Bridging-Header.h"; sourceTree = "<group>"; };
|
1ADFF48A24C8C176006DC7AE /* SBrowser-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SBrowser-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
1ADFF48B24C8C176006DC7AE /* SBRProcessBundleBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBRProcessBundleBridge.h; sourceTree = "<group>"; };
|
1ADFF48B24C8C176006DC7AE /* SBRProcessBundleBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBRProcessBundleBridge.h; sourceTree = "<group>"; };
|
||||||
1ADFF48C24C8C176006DC7AE /* SBRProcessBundleBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SBRProcessBundleBridge.m; sourceTree = "<group>"; };
|
1ADFF48C24C8C176006DC7AE /* SBRProcessBundleBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SBRProcessBundleBridge.m; sourceTree = "<group>"; };
|
||||||
1ADFF4A824C8D476006DC7AE /* SBRProcessPlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBRProcessPlugin.h; sourceTree = "<group>"; };
|
|
||||||
1ADFF4A924C8D477006DC7AE /* SBRProcessPlugin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SBRProcessPlugin.m; sourceTree = "<group>"; };
|
|
||||||
1ADFF4AB24C8DF62006DC7AE /* SBRWebProcessDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBRWebProcessDelegate.h; sourceTree = "<group>"; };
|
|
||||||
1ADFF4AC24C8DFEE006DC7AE /* SBRWebProcessProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBRWebProcessProxy.h; sourceTree = "<group>"; };
|
|
||||||
1ADFF4AD24C8ED32006DC7AE /* ResourcePolicyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResourcePolicyManager.swift; sourceTree = "<group>"; };
|
1ADFF4AD24C8ED32006DC7AE /* ResourcePolicyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResourcePolicyManager.swift; sourceTree = "<group>"; };
|
||||||
1ADFF4BF24CA6964006DC7AE /* URLBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLBar.swift; sourceTree = "<group>"; };
|
1ADFF4BF24CA6964006DC7AE /* URLBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLBar.swift; sourceTree = "<group>"; };
|
||||||
1ADFF4C224CA6AF6006DC7AE /* Geometry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Geometry.swift; sourceTree = "<group>"; };
|
1ADFF4C224CA6AF6006DC7AE /* Geometry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Geometry.swift; sourceTree = "<group>"; };
|
||||||
@@ -160,8 +142,11 @@
|
|||||||
CD19576C268BE95900E8089B /* GenericContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericContentView.swift; sourceTree = "<group>"; };
|
CD19576C268BE95900E8089B /* GenericContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericContentView.swift; sourceTree = "<group>"; };
|
||||||
CD361CF4271A3718006E9CA5 /* SBRScriptPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBRScriptPolicy.h; sourceTree = "<group>"; };
|
CD361CF4271A3718006E9CA5 /* SBRScriptPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBRScriptPolicy.h; sourceTree = "<group>"; };
|
||||||
CD361CF5271A3718006E9CA5 /* SBRScriptPolicy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SBRScriptPolicy.m; sourceTree = "<group>"; };
|
CD361CF5271A3718006E9CA5 /* SBRScriptPolicy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SBRScriptPolicy.m; sourceTree = "<group>"; };
|
||||||
|
CD3D6CED2DA9F8910099667F /* WebKitDefines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebKitDefines.h; sourceTree = "<group>"; };
|
||||||
CD470C4125DE056600AFBE0E /* BrowserViewController+WebKitDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BrowserViewController+WebKitDelegate.swift"; sourceTree = "<group>"; };
|
CD470C4125DE056600AFBE0E /* BrowserViewController+WebKitDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BrowserViewController+WebKitDelegate.swift"; sourceTree = "<group>"; };
|
||||||
CD470C4325DE070400AFBE0E /* BrowserViewController+Keyboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BrowserViewController+Keyboard.swift"; sourceTree = "<group>"; };
|
CD470C4325DE070400AFBE0E /* BrowserViewController+Keyboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BrowserViewController+Keyboard.swift"; sourceTree = "<group>"; };
|
||||||
|
CD4930D82E8B38FC00ADDE99 /* AddSearchEngineViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddSearchEngineViewController.swift; sourceTree = "<group>"; };
|
||||||
|
CD4930DA2E8B3F5B00ADDE99 /* ManageSearchEnginesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageSearchEnginesViewController.swift; sourceTree = "<group>"; };
|
||||||
CD7313E12705349700053347 /* ScriptPolicyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScriptPolicyViewController.swift; sourceTree = "<group>"; };
|
CD7313E12705349700053347 /* ScriptPolicyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScriptPolicyViewController.swift; sourceTree = "<group>"; };
|
||||||
CD7313E3270534B800053347 /* ScriptPolicyViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScriptPolicyViewControllerDelegate.swift; sourceTree = "<group>"; };
|
CD7313E3270534B800053347 /* ScriptPolicyViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScriptPolicyViewControllerDelegate.swift; sourceTree = "<group>"; };
|
||||||
CD7A7E9C2686A9A500E20BA3 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
|
CD7A7E9C2686A9A500E20BA3 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
|
||||||
@@ -174,6 +159,8 @@
|
|||||||
CD853BCD24E7763900D2BDCC /* BrowserHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserHistory.swift; sourceTree = "<group>"; };
|
CD853BCD24E7763900D2BDCC /* BrowserHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserHistory.swift; sourceTree = "<group>"; };
|
||||||
CD853BD024E778B800D2BDCC /* History.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = History.xcdatamodel; sourceTree = "<group>"; };
|
CD853BD024E778B800D2BDCC /* History.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = History.xcdatamodel; sourceTree = "<group>"; };
|
||||||
CD853BD324E77BF900D2BDCC /* HistoryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryItem.swift; sourceTree = "<group>"; };
|
CD853BD324E77BF900D2BDCC /* HistoryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryItem.swift; sourceTree = "<group>"; };
|
||||||
|
CD8ACBC02DC9A2F7008BF856 /* Hacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Hacks.h; sourceTree = "<group>"; };
|
||||||
|
CD8ACBC12DC9A2F7008BF856 /* Hacks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Hacks.m; sourceTree = "<group>"; };
|
||||||
CD8DBE7A2A85D892006A0FE0 /* LayoutLatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutLatch.swift; sourceTree = "<group>"; };
|
CD8DBE7A2A85D892006A0FE0 /* LayoutLatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutLatch.swift; sourceTree = "<group>"; };
|
||||||
CD936A3A289DB3380093A1AC /* TabInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabInfo.swift; sourceTree = "<group>"; };
|
CD936A3A289DB3380093A1AC /* TabInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabInfo.swift; sourceTree = "<group>"; };
|
||||||
CD936A3C289DB88B0093A1AC /* UIView+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Utils.swift"; sourceTree = "<group>"; };
|
CD936A3C289DB88B0093A1AC /* UIView+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Utils.swift"; sourceTree = "<group>"; };
|
||||||
@@ -201,6 +188,10 @@
|
|||||||
CDF3468F276C14BD00FB3141 /* CodeEditorSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeEditorSettingsViewController.swift; sourceTree = "<group>"; };
|
CDF3468F276C14BD00FB3141 /* CodeEditorSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeEditorSettingsViewController.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||||
|
CDB73F3F2DA9F2F100DF4FAB /* WebKit Headers */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = "WebKit Headers"; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileSystemSynchronizedRootGroup section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
1ADFF45924C7DE53006DC7AE /* Frameworks */ = {
|
1ADFF45924C7DE53006DC7AE /* Frameworks */ = {
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
@@ -209,14 +200,6 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
1ADFF47E24C8C12F006DC7AE /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
1ADFF48424C8C12F006DC7AE /* Foundation.framework in Frameworks */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXFrameworksBuildPhase section */
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
/* Begin PBXGroup section */
|
||||||
@@ -283,7 +266,7 @@
|
|||||||
children = (
|
children = (
|
||||||
CDB6808828B4569F007D787E /* LICENSE.txt */,
|
CDB6808828B4569F007D787E /* LICENSE.txt */,
|
||||||
1ADFF45E24C7DE53006DC7AE /* App */,
|
1ADFF45E24C7DE53006DC7AE /* App */,
|
||||||
1ADFF48524C8C12F006DC7AE /* SBrowserProcessBundle */,
|
CDB73F3F2DA9F2F100DF4FAB /* WebKit Headers */,
|
||||||
1ADFF48224C8C12F006DC7AE /* Frameworks */,
|
1ADFF48224C8C12F006DC7AE /* Frameworks */,
|
||||||
1ADFF45D24C7DE53006DC7AE /* Products */,
|
1ADFF45D24C7DE53006DC7AE /* Products */,
|
||||||
);
|
);
|
||||||
@@ -293,7 +276,6 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
1ADFF45C24C7DE53006DC7AE /* Attractor.app */,
|
1ADFF45C24C7DE53006DC7AE /* Attractor.app */,
|
||||||
1ADFF48124C8C12F006DC7AE /* SBrowserProcessBundle.bundle */,
|
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -335,6 +317,7 @@
|
|||||||
1ADFF46824C7DE54006DC7AE /* Assets.xcassets */,
|
1ADFF46824C7DE54006DC7AE /* Assets.xcassets */,
|
||||||
1ADFF46A24C7DE54006DC7AE /* LaunchScreen.storyboard */,
|
1ADFF46A24C7DE54006DC7AE /* LaunchScreen.storyboard */,
|
||||||
1ADFF46D24C7DE54006DC7AE /* Info.plist */,
|
1ADFF46D24C7DE54006DC7AE /* Info.plist */,
|
||||||
|
CD3D6CED2DA9F8910099667F /* WebKitDefines.h */,
|
||||||
);
|
);
|
||||||
path = "Supporting Files";
|
path = "Supporting Files";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -367,18 +350,6 @@
|
|||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
1ADFF48524C8C12F006DC7AE /* SBrowserProcessBundle */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
1ADFF48624C8C12F006DC7AE /* Info.plist */,
|
|
||||||
1ADFF4AB24C8DF62006DC7AE /* SBRWebProcessDelegate.h */,
|
|
||||||
1ADFF4AC24C8DFEE006DC7AE /* SBRWebProcessProxy.h */,
|
|
||||||
1ADFF4A824C8D476006DC7AE /* SBRProcessPlugin.h */,
|
|
||||||
1ADFF4A924C8D477006DC7AE /* SBRProcessPlugin.m */,
|
|
||||||
);
|
|
||||||
path = SBrowserProcessBundle;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
1ADFF4AF24C92E2F006DC7AE /* Web Process Bundle Bridge */ = {
|
1ADFF4AF24C92E2F006DC7AE /* Web Process Bundle Bridge */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -446,6 +417,8 @@
|
|||||||
CD7F2133265DACEE0001D042 /* Hacks */ = {
|
CD7F2133265DACEE0001D042 /* Hacks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
CD8ACBC02DC9A2F7008BF856 /* Hacks.h */,
|
||||||
|
CD8ACBC12DC9A2F7008BF856 /* Hacks.m */,
|
||||||
CD7F2134265DAD010001D042 /* MFMailComposeViewControllerFix.m */,
|
CD7F2134265DAD010001D042 /* MFMailComposeViewControllerFix.m */,
|
||||||
);
|
);
|
||||||
path = Hacks;
|
path = Hacks;
|
||||||
@@ -508,6 +481,8 @@
|
|||||||
CD7A7E9C2686A9A500E20BA3 /* SettingsViewController.swift */,
|
CD7A7E9C2686A9A500E20BA3 /* SettingsViewController.swift */,
|
||||||
CD7A7E9E2686B29100E20BA3 /* GeneralSettingsViewController.swift */,
|
CD7A7E9E2686B29100E20BA3 /* GeneralSettingsViewController.swift */,
|
||||||
CD7A7EA02686B2E600E20BA3 /* RedirectRulesSettingsViewController.swift */,
|
CD7A7EA02686B2E600E20BA3 /* RedirectRulesSettingsViewController.swift */,
|
||||||
|
CD4930D82E8B38FC00ADDE99 /* AddSearchEngineViewController.swift */,
|
||||||
|
CD4930DA2E8B3F5B00ADDE99 /* ManageSearchEnginesViewController.swift */,
|
||||||
CDF3468F276C14BD00FB3141 /* CodeEditorSettingsViewController.swift */,
|
CDF3468F276C14BD00FB3141 /* CodeEditorSettingsViewController.swift */,
|
||||||
);
|
);
|
||||||
path = Settings;
|
path = Settings;
|
||||||
@@ -536,30 +511,12 @@
|
|||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
dependencies = (
|
dependencies = (
|
||||||
1ADFF48F24C8C230006DC7AE /* PBXTargetDependency */,
|
|
||||||
);
|
);
|
||||||
name = App;
|
name = App;
|
||||||
productName = SBrowser;
|
productName = SBrowser;
|
||||||
productReference = 1ADFF45C24C7DE53006DC7AE /* Attractor.app */;
|
productReference = 1ADFF45C24C7DE53006DC7AE /* Attractor.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
1ADFF48024C8C12F006DC7AE /* SBrowserProcessBundle */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 1ADFF48724C8C12F006DC7AE /* Build configuration list for PBXNativeTarget "SBrowserProcessBundle" */;
|
|
||||||
buildPhases = (
|
|
||||||
1ADFF47D24C8C12F006DC7AE /* Sources */,
|
|
||||||
1ADFF47E24C8C12F006DC7AE /* Frameworks */,
|
|
||||||
1ADFF47F24C8C12F006DC7AE /* Resources */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
);
|
|
||||||
name = SBrowserProcessBundle;
|
|
||||||
productName = SBrowserProcessBundle;
|
|
||||||
productReference = 1ADFF48124C8C12F006DC7AE /* SBrowserProcessBundle.bundle */;
|
|
||||||
productType = "com.apple.product-type.bundle";
|
|
||||||
};
|
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
/* Begin PBXProject section */
|
||||||
@@ -573,9 +530,6 @@
|
|||||||
CreatedOnToolsVersion = 12.0;
|
CreatedOnToolsVersion = 12.0;
|
||||||
LastSwiftMigration = 1200;
|
LastSwiftMigration = 1200;
|
||||||
};
|
};
|
||||||
1ADFF48024C8C12F006DC7AE = {
|
|
||||||
CreatedOnToolsVersion = 12.0;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = 1ADFF45724C7DE53006DC7AE /* Build configuration list for PBXProject "SBrowser" */;
|
buildConfigurationList = 1ADFF45724C7DE53006DC7AE /* Build configuration list for PBXProject "SBrowser" */;
|
||||||
@@ -592,7 +546,6 @@
|
|||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
1ADFF45B24C7DE53006DC7AE /* App */,
|
1ADFF45B24C7DE53006DC7AE /* App */,
|
||||||
1ADFF48024C8C12F006DC7AE /* SBrowserProcessBundle */,
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
@@ -613,13 +566,6 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
1ADFF47F24C8C12F006DC7AE /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@@ -629,8 +575,10 @@
|
|||||||
files = (
|
files = (
|
||||||
1ADFF46024C7DE53006DC7AE /* AppDelegate.swift in Sources */,
|
1ADFF46024C7DE53006DC7AE /* AppDelegate.swift in Sources */,
|
||||||
1AD3104325254FB900A4A952 /* FindOnPageViewController.swift in Sources */,
|
1AD3104325254FB900A4A952 /* FindOnPageViewController.swift in Sources */,
|
||||||
|
CD4930D92E8B390200ADDE99 /* AddSearchEngineViewController.swift in Sources */,
|
||||||
1A03811424E73EB300826501 /* SegmentedReliefButton.swift in Sources */,
|
1A03811424E73EB300826501 /* SegmentedReliefButton.swift in Sources */,
|
||||||
1A03811024E71CF000826501 /* ReliefButton.swift in Sources */,
|
1A03811024E71CF000826501 /* ReliefButton.swift in Sources */,
|
||||||
|
CD8ACBC22DC9A2F7008BF856 /* Hacks.m in Sources */,
|
||||||
1A03811224E71EAA00826501 /* GradientView.swift in Sources */,
|
1A03811224E71EAA00826501 /* GradientView.swift in Sources */,
|
||||||
1ADFF4C024CA6964006DC7AE /* URLBar.swift in Sources */,
|
1ADFF4C024CA6964006DC7AE /* URLBar.swift in Sources */,
|
||||||
CDAD9CEA263A318F00FF7199 /* ShareableURL.swift in Sources */,
|
CDAD9CEA263A318F00FF7199 /* ShareableURL.swift in Sources */,
|
||||||
@@ -663,6 +611,7 @@
|
|||||||
CD853BCE24E7763900D2BDCC /* BrowserHistory.swift in Sources */,
|
CD853BCE24E7763900D2BDCC /* BrowserHistory.swift in Sources */,
|
||||||
1A03810B24E71C5600826501 /* ToolbarButtonContainerView.swift in Sources */,
|
1A03810B24E71C5600826501 /* ToolbarButtonContainerView.swift in Sources */,
|
||||||
CD8DBE7B2A85D892006A0FE0 /* LayoutLatch.swift in Sources */,
|
CD8DBE7B2A85D892006A0FE0 /* LayoutLatch.swift in Sources */,
|
||||||
|
CD4930DB2E8B3F6500ADDE99 /* ManageSearchEnginesViewController.swift in Sources */,
|
||||||
CD7A7EA12686B2E600E20BA3 /* RedirectRulesSettingsViewController.swift in Sources */,
|
CD7A7EA12686B2E600E20BA3 /* RedirectRulesSettingsViewController.swift in Sources */,
|
||||||
1ADFF4CB24CB8278006DC7AE /* ScriptControllerIconView.swift in Sources */,
|
1ADFF4CB24CB8278006DC7AE /* ScriptControllerIconView.swift in Sources */,
|
||||||
CD7A8915251975B70075991E /* AutocompleteViewController.swift in Sources */,
|
CD7A8915251975B70075991E /* AutocompleteViewController.swift in Sources */,
|
||||||
@@ -696,25 +645,8 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
1ADFF47D24C8C12F006DC7AE /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
CD9B88C2272201E900DAAB7E /* SBRScriptPolicy.m in Sources */,
|
|
||||||
1ADFF4AA24C8D477006DC7AE /* SBRProcessPlugin.m in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXSourcesBuildPhase section */
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXTargetDependency section */
|
|
||||||
1ADFF48F24C8C230006DC7AE /* PBXTargetDependency */ = {
|
|
||||||
isa = PBXTargetDependency;
|
|
||||||
target = 1ADFF48024C8C12F006DC7AE /* SBrowserProcessBundle */;
|
|
||||||
targetProxy = 1ADFF48E24C8C230006DC7AE /* PBXContainerItemProxy */;
|
|
||||||
};
|
|
||||||
/* End PBXTargetDependency section */
|
|
||||||
|
|
||||||
/* Begin PBXVariantGroup section */
|
/* Begin PBXVariantGroup section */
|
||||||
1ADFF46A24C7DE54006DC7AE /* LaunchScreen.storyboard */ = {
|
1ADFF46A24C7DE54006DC7AE /* LaunchScreen.storyboard */ = {
|
||||||
isa = PBXVariantGroup;
|
isa = PBXVariantGroup;
|
||||||
@@ -780,11 +712,12 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
HEADER_SEARCH_PATHS = "\"WebKit Headers\"";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos.internal;
|
SDKROOT = iphoneos;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
};
|
};
|
||||||
@@ -837,10 +770,11 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
HEADER_SEARCH_PATHS = "\"WebKit Headers\"";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
SDKROOT = iphoneos.internal;
|
SDKROOT = iphoneos;
|
||||||
SWIFT_COMPILATION_MODE = wholemodule;
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
@@ -854,10 +788,15 @@
|
|||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CURRENT_PROJECT_VERSION = 4;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 5;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
|
DEVELOPMENT_TEAM = 3SJALV9BQ7;
|
||||||
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
|
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = Attractor;
|
||||||
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@@ -865,8 +804,11 @@
|
|||||||
MARKETING_VERSION = 4.0;
|
MARKETING_VERSION = 4.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
|
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
|
||||||
PRODUCT_NAME = Attractor;
|
PRODUCT_NAME = Attractor;
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = YES;
|
SUPPORTS_MACCATALYST = YES;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
|
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/SBrowser-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/SBrowser-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -881,10 +823,15 @@
|
|||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
|
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/SBrowser.entitlements";
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CURRENT_PROJECT_VERSION = 4;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 5;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
|
DEVELOPMENT_TEAM = 3SJALV9BQ7;
|
||||||
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
|
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = Attractor;
|
||||||
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@@ -892,47 +839,17 @@
|
|||||||
MARKETING_VERSION = 4.0;
|
MARKETING_VERSION = 4.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
|
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.attractor;
|
||||||
PRODUCT_NAME = Attractor;
|
PRODUCT_NAME = Attractor;
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
SUPPORTS_MACCATALYST = YES;
|
SUPPORTS_MACCATALYST = YES;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
|
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/SBrowser-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/SBrowser-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2,6";
|
TARGETED_DEVICE_FAMILY = "1,2,6";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
1ADFF48824C8C12F006DC7AE /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
DEAD_CODE_STRIPPING = YES;
|
|
||||||
INFOPLIST_FILE = SBrowserProcessBundle/Info.plist;
|
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.SBrowserProcessBundle;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SDKROOT = iphoneos.internal;
|
|
||||||
STRIP_INSTALLED_PRODUCT = NO;
|
|
||||||
SUPPORTS_MACCATALYST = YES;
|
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2,6";
|
|
||||||
WRAPPER_EXTENSION = bundle;
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
1ADFF48924C8C12F006DC7AE /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
DEAD_CODE_STRIPPING = YES;
|
|
||||||
INFOPLIST_FILE = SBrowserProcessBundle/Info.plist;
|
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = net.buzzert.SBrowserProcessBundle;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SDKROOT = iphoneos.internal;
|
|
||||||
SUPPORTS_MACCATALYST = YES;
|
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2,6";
|
|
||||||
WRAPPER_EXTENSION = bundle;
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
/* End XCBuildConfiguration section */
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
/* Begin XCConfigurationList section */
|
||||||
@@ -954,15 +871,6 @@
|
|||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
1ADFF48724C8C12F006DC7AE /* Build configuration list for PBXNativeTarget "SBrowserProcessBundle" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
1ADFF48824C8C12F006DC7AE /* Debug */,
|
|
||||||
1ADFF48924C8C12F006DC7AE /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
/* Begin XCVersionGroup section */
|
/* Begin XCVersionGroup section */
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "1400"
|
LastUpgradeVersion = "1600"
|
||||||
version = "1.7">
|
version = "1.7">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
buildImplicitDependencies = "YES">
|
buildImplicitDependencies = "YES"
|
||||||
|
buildArchitectures = "Automatic">
|
||||||
<BuildActionEntries>
|
<BuildActionEntries>
|
||||||
<BuildActionEntry
|
<BuildActionEntry
|
||||||
buildForTesting = "YES"
|
buildForTesting = "YES"
|
||||||
@@ -26,9 +27,8 @@
|
|||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
<Testables>
|
shouldAutocreateTestPlan = "YES">
|
||||||
</Testables>
|
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
@@ -39,8 +39,7 @@
|
|||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES"
|
||||||
debugServiceExtension = "internal"
|
debugServiceExtension = "internal"
|
||||||
allowLocationSimulation = "YES"
|
allowLocationSimulation = "YES">
|
||||||
internalIOSLaunchStyle = "2">
|
|
||||||
<BuildableProductRunnable
|
<BuildableProductRunnable
|
||||||
runnableDebuggingMode = "0">
|
runnableDebuggingMode = "0">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
@@ -51,13 +50,6 @@
|
|||||||
ReferencedContainer = "container:SBrowser.xcodeproj">
|
ReferencedContainer = "container:SBrowser.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
<AdditionalOptions>
|
|
||||||
<AdditionalOption
|
|
||||||
key = "MallocScribble"
|
|
||||||
value = ""
|
|
||||||
isEnabled = "YES">
|
|
||||||
</AdditionalOption>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Release"
|
||||||
@@ -83,7 +75,4 @@
|
|||||||
buildConfiguration = "Release"
|
buildConfiguration = "Release"
|
||||||
revealArchiveInOrganizer = "YES">
|
revealArchiveInOrganizer = "YES">
|
||||||
</ArchiveAction>
|
</ArchiveAction>
|
||||||
<InstallAction
|
|
||||||
buildConfiguration = "Release">
|
|
||||||
</InstallAction>
|
|
||||||
</Scheme>
|
</Scheme>
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
<key>NSPrincipalClass</key>
|
|
||||||
<string>SBRProcessPlugin</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
//
|
|
||||||
// SBRProcessPlugin.h
|
|
||||||
// SBrowserProcessBundle
|
|
||||||
//
|
|
||||||
// Created by James Magahern on 7/22/20.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <WebKit/WKWebProcessPlugIn.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface SBRProcessPlugin : NSObject <WKWebProcessPlugIn>
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
//
|
|
||||||
// SBRProcessPlugin.m
|
|
||||||
// SBrowserProcessBundle
|
|
||||||
//
|
|
||||||
// Created by James Magahern on 7/22/20.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "SBRProcessPlugin.h"
|
|
||||||
|
|
||||||
#import "SBRWebProcessDelegate.h"
|
|
||||||
#import "SBRWebProcessProxy.h"
|
|
||||||
#import "SBRScriptPolicy.h"
|
|
||||||
|
|
||||||
#import <WebKit/_WKRemoteObjectInterface.h>
|
|
||||||
#import <WebKit/_WKRemoteObjectRegistry.h>
|
|
||||||
#import <WebKit/WKWebProcessPlugInBrowserContextController.h>
|
|
||||||
#import <WebKit/WKWebProcessPlugInBrowserContextControllerPrivate.h>
|
|
||||||
#import <WebKit/WKWebProcessPlugInFrame.h>
|
|
||||||
#import <WebKit/WKWebProcessPlugInLoadDelegate.h>
|
|
||||||
|
|
||||||
@interface SBRProcessPlugin () <WKWebProcessPlugInLoadDelegate, SBRWebProcessProxy>
|
|
||||||
|
|
||||||
@property (nonatomic, strong) id<SBRWebProcessDelegate> processDelegate;
|
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL allScriptsAllowed;
|
|
||||||
@property (nonatomic, strong) NSMutableSet<NSString *> *allowedResourceOrigins;
|
|
||||||
@property (nonatomic, strong) NSDictionary<NSString *, NSNumber *> *policyTypeByOrigin;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation SBRProcessPlugin
|
|
||||||
|
|
||||||
+ (void)initialize
|
|
||||||
{
|
|
||||||
[super initialize];
|
|
||||||
NSLog(@"SBRProcessPlugin Initialized");
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark <SBRWebProcessProxy>
|
|
||||||
|
|
||||||
- (void)hello
|
|
||||||
{
|
|
||||||
NSLog(@"SBRProcessPlugin: Helloooooo");
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)syncAllowedResourceOrigins:(NSArray<NSString *> *)allowedOrigins
|
|
||||||
{
|
|
||||||
_allowedResourceOrigins = [NSMutableSet setWithArray:allowedOrigins];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)syncPolicyTypes:(NSDictionary<NSString *,NSNumber *> *)policyTypes
|
|
||||||
{
|
|
||||||
_policyTypeByOrigin = policyTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setAllScriptsAllowed:(BOOL)allScriptsAllowed
|
|
||||||
{
|
|
||||||
_allScriptsAllowed = allScriptsAllowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark <WKWebProcessPlugIn>
|
|
||||||
|
|
||||||
- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController initializeWithObject:(id)initializationObject
|
|
||||||
{
|
|
||||||
_allowedResourceOrigins = [[plugInController parameters] valueForKey:SBRGetAllowedOriginsKey()];
|
|
||||||
_allScriptsAllowed = [[[plugInController parameters] valueForKey:SBRGetAllScriptsAllowedKey()] boolValue];
|
|
||||||
_policyTypeByOrigin = [[plugInController parameters] valueForKey:SBRGetPolicyTypeByOriginKey()];
|
|
||||||
NSLog(@"SBRProcessPlugin: %lu origins allowed, all scripts allowed: %@ ", (unsigned long)_allowedResourceOrigins.count, _allScriptsAllowed ? @"YES" : @"NO");
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController didCreateBrowserContextController:(WKWebProcessPlugInBrowserContextController *)browserContextController
|
|
||||||
{
|
|
||||||
_WKRemoteObjectInterface *proxyInterface = [_WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:@protocol(SBRWebProcessProxy)];
|
|
||||||
[browserContextController._remoteObjectRegistry registerExportedObject:self interface:proxyInterface];
|
|
||||||
|
|
||||||
_WKRemoteObjectInterface *eventListenerInterface = [_WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:@protocol(SBRWebProcessDelegate)];
|
|
||||||
self.processDelegate = [browserContextController._remoteObjectRegistry remoteObjectProxyWithInterface:eventListenerInterface];
|
|
||||||
|
|
||||||
browserContextController.loadDelegate = self;
|
|
||||||
|
|
||||||
[[self processDelegate] webProcessDidConnect];
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark <WKWebProcessPlugInLoadDelegate>
|
|
||||||
|
|
||||||
- (NSURLRequest *)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
|
|
||||||
{
|
|
||||||
NSLog(@"SBRProcessPlugin: Sending request: %@", request);
|
|
||||||
if (_allowedResourceOrigins == nil) {
|
|
||||||
NSLog(@"Allowed resource origins should not be nil!!!!");
|
|
||||||
}
|
|
||||||
|
|
||||||
NSURL *requestURL = [request URL];
|
|
||||||
NSString *resourceOrigin = [requestURL host];
|
|
||||||
NSString *requestExtension = [requestURL pathExtension];
|
|
||||||
NSString *hostOrigin = [[[controller mainFrame] URL] host];
|
|
||||||
if (requestExtension.length > 0 && [requestExtension isEqualToString:@"js"]) {
|
|
||||||
NSNumber *policyType = [_policyTypeByOrigin objectForKey:hostOrigin];
|
|
||||||
NSLog(@"SBRProcessPlugin: Policy type for %@: %@", hostOrigin, policyType);
|
|
||||||
|
|
||||||
SBRScriptPolicy *policy = [[SBRScriptPolicy alloc] initWithSecurityOrigin:hostOrigin policyType:[policyType integerValue]];
|
|
||||||
if ([self allScriptsAllowed] || [policy allowsExternalJavaScriptResourceOrigin:resourceOrigin]) {
|
|
||||||
NSLog(@"SBRProcessPlugin: Policy allows script requestURL: %@", requestURL);
|
|
||||||
[[self processDelegate] webProcessDidAllowScriptWithOrigin:resourceOrigin];
|
|
||||||
} else {
|
|
||||||
NSLog(@"SBRProcessPlugin: Policy disallows script requestURL: %@", requestURL);
|
|
||||||
[[self processDelegate] webProcessDidBlockScriptWithOrigin:resourceOrigin];
|
|
||||||
|
|
||||||
request = nil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return request;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
//
|
|
||||||
// SBRWebProcessDelegate.h
|
|
||||||
// SBrowser
|
|
||||||
//
|
|
||||||
// Created by James Magahern on 7/22/20.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@protocol SBRWebProcessDelegate <NSObject>
|
|
||||||
|
|
||||||
- (void)webProcessDidConnect;
|
|
||||||
- (void)webProcessDidBlockScriptWithOrigin:(NSString *)origin;
|
|
||||||
- (void)webProcessDidAllowScriptWithOrigin:(NSString *)origin;
|
|
||||||
|
|
||||||
@end
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
//
|
|
||||||
// SBRWebProcessProxy.h
|
|
||||||
// SBrowser
|
|
||||||
//
|
|
||||||
// Created by James Magahern on 7/22/20.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
static inline NSString* SBRGetAllowedOriginsKey(void) {
|
|
||||||
return @"allowedOrigins";
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline NSString* SBRGetAllScriptsAllowedKey(void) {
|
|
||||||
return @"allScriptsAllowed";
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline NSString* SBRGetPolicyTypeByOriginKey(void) {
|
|
||||||
return @"policyTypeByOrigin";
|
|
||||||
}
|
|
||||||
|
|
||||||
@protocol SBRWebProcessProxy <NSObject>
|
|
||||||
|
|
||||||
- (void)hello;
|
|
||||||
- (void)setAllScriptsAllowed:(BOOL)allowed;
|
|
||||||
- (void)syncAllowedResourceOrigins:(NSArray<NSString *> *)allowedOrigins;
|
|
||||||
- (void)syncPolicyTypes:(NSDictionary<NSString *, NSNumber *> *)policyTypes;
|
|
||||||
|
|
||||||
@end
|
|
||||||
162
WebKit Headers/WebKit/WKBase.h
Normal file
162
WebKit Headers/WebKit/WKBase.h
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2017 Apple Inc. All rights reserved.
|
||||||
|
* Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef WKBase_h
|
||||||
|
#define WKBase_h
|
||||||
|
|
||||||
|
#include <WebKit/WKDeclarationSpecifiers.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <WebKit/WKBaseMac.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* WebKit2 shared types */
|
||||||
|
|
||||||
|
typedef uint32_t WKTypeID;
|
||||||
|
typedef const void* WKTypeRef;
|
||||||
|
|
||||||
|
typedef const struct OpaqueWKArray* WKArrayRef;
|
||||||
|
typedef struct OpaqueWKArray* WKMutableArrayRef;
|
||||||
|
|
||||||
|
typedef const struct OpaqueWKDictionary* WKDictionaryRef;
|
||||||
|
typedef struct OpaqueWKDictionary* WKMutableDictionaryRef;
|
||||||
|
|
||||||
|
typedef const struct OpaqueWKBoolean* WKBooleanRef;
|
||||||
|
typedef const struct OpaqueWKCertificateInfo* WKCertificateInfoRef;
|
||||||
|
typedef const struct OpaqueWKConnection* WKConnectionRef;
|
||||||
|
typedef const struct OpaqueWKContextMenuItem* WKContextMenuItemRef;
|
||||||
|
typedef const struct OpaqueWKData* WKDataRef;
|
||||||
|
typedef const struct OpaqueWKDouble* WKDoubleRef;
|
||||||
|
typedef const struct OpaqueWKError* WKErrorRef;
|
||||||
|
typedef const struct OpaqueWKGraphicsContext* WKGraphicsContextRef;
|
||||||
|
typedef const struct OpaqueWKImage* WKImageRef;
|
||||||
|
typedef const struct OpaqueWKPointRef* WKPointRef;
|
||||||
|
typedef const struct OpaqueWKRectRef* WKRectRef;
|
||||||
|
typedef const struct OpaqueWKSecurityOrigin* WKSecurityOriginRef;
|
||||||
|
typedef const struct OpaqueWKSerializedScriptValue* WKSerializedScriptValueRef;
|
||||||
|
typedef const struct OpaqueWKSizeRef* WKSizeRef;
|
||||||
|
typedef const struct OpaqueWKString* WKStringRef;
|
||||||
|
typedef const struct OpaqueWKUInt64* WKUInt64Ref;
|
||||||
|
typedef const struct OpaqueWKURL* WKURLRef;
|
||||||
|
typedef const struct OpaqueWKURLRequest* WKURLRequestRef;
|
||||||
|
typedef const struct OpaqueWKURLResponse* WKURLResponseRef;
|
||||||
|
typedef const struct OpaqueWKUserContentURLPattern* WKUserContentURLPatternRef;
|
||||||
|
typedef const struct OpaqueWKWebArchive* WKWebArchiveRef;
|
||||||
|
typedef const struct OpaqueWKWebArchiveResource* WKWebArchiveResourceRef;
|
||||||
|
|
||||||
|
/* WebKit2 main API types */
|
||||||
|
|
||||||
|
typedef const struct OpaqueWKApplicationCacheManager* WKApplicationCacheManagerRef;
|
||||||
|
typedef const struct OpaqueWKAuthenticationChallenge* WKAuthenticationChallengeRef;
|
||||||
|
typedef const struct OpaqueWKAuthenticationDecisionListener* WKAuthenticationDecisionListenerRef;
|
||||||
|
typedef const struct OpaqueWKBackForwardList* WKBackForwardListRef;
|
||||||
|
typedef const struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
|
||||||
|
typedef const struct OpaqueWKResourceCacheManager* WKResourceCacheManagerRef;
|
||||||
|
typedef const struct OpaqueWKColorPickerResultListener* WKColorPickerResultListenerRef;
|
||||||
|
typedef const struct OpaqueWKContext* WKContextRef;
|
||||||
|
typedef const struct OpaqueWKContextConfiguration* WKContextConfigurationRef;
|
||||||
|
typedef const struct OpaqueWKContextMenuListener* WKContextMenuListenerRef;
|
||||||
|
typedef const struct OpaqueWKCookieManager* WKCookieManagerRef;
|
||||||
|
typedef const struct OpaqueWKCredential* WKCredentialRef;
|
||||||
|
typedef const struct OpaqueWKDownload* WKDownloadRef;
|
||||||
|
typedef const struct OpaqueWKExperimentalFeature* WKFeatureRef;
|
||||||
|
typedef const struct OpaqueWKFormSubmissionListener* WKFormSubmissionListenerRef;
|
||||||
|
typedef const struct OpaqueWKFrameHandle* WKFrameHandleRef;
|
||||||
|
typedef const struct OpaqueWKFrameInfo* WKFrameInfoRef;
|
||||||
|
typedef const struct OpaqueWKFrame* WKFrameRef;
|
||||||
|
typedef const struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef;
|
||||||
|
typedef const struct OpaqueWKGeolocationManager* WKGeolocationManagerRef;
|
||||||
|
typedef const struct OpaqueWKGeolocationPermissionRequest* WKGeolocationPermissionRequestRef;
|
||||||
|
typedef const struct OpaqueWKGeolocationPosition* WKGeolocationPositionRef;
|
||||||
|
typedef const struct OpaqueWKGrammarDetail* WKGrammarDetailRef;
|
||||||
|
typedef const struct OpaqueWKHTTPCookieStore* WKHTTPCookieStoreRef;
|
||||||
|
typedef const struct OpaqueWKHitTestResult* WKHitTestResultRef;
|
||||||
|
typedef const struct OpaqueWKIconDatabase* WKIconDatabaseRef;
|
||||||
|
typedef const struct OpaqueWKInspector* WKInspectorRef;
|
||||||
|
typedef const struct OpaqueWKInternalDebugFeature* WKInternalDebugFeatureRef;
|
||||||
|
typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef;
|
||||||
|
typedef const struct OpaqueWKMessageListener* WKMessageListenerRef;
|
||||||
|
typedef const struct OpaqueWKNavigationAction* WKNavigationActionRef;
|
||||||
|
typedef const struct OpaqueWKNavigationData* WKNavigationDataRef;
|
||||||
|
typedef const struct OpaqueWKNavigation* WKNavigationRef;
|
||||||
|
typedef const struct OpaqueWKNavigationResponse* WKNavigationResponseRef;
|
||||||
|
typedef const struct OpaqueWKNotification* WKNotificationRef;
|
||||||
|
typedef const struct OpaqueWKNotificationManager* WKNotificationManagerRef;
|
||||||
|
typedef const struct OpaqueWKNotificationPermissionRequest* WKNotificationPermissionRequestRef;
|
||||||
|
typedef const struct OpaqueWKNotificationProvider* WKNotificationProviderRef;
|
||||||
|
typedef const struct OpaqueWKOpenPanelParameters* WKOpenPanelParametersRef;
|
||||||
|
typedef const struct OpaqueWKOpenPanelResultListener* WKOpenPanelResultListenerRef;
|
||||||
|
typedef const struct OpaqueWKPage* WKPageRef;
|
||||||
|
typedef const struct OpaqueWKPageConfiguration* WKPageConfigurationRef;
|
||||||
|
typedef const struct OpaqueWKPageGroup* WKPageGroupRef;
|
||||||
|
typedef const struct OpaqueWKPreferences* WKPreferencesRef;
|
||||||
|
typedef const struct OpaqueWKProtectionSpace* WKProtectionSpaceRef;
|
||||||
|
typedef const struct OpaqueWKPageRunBeforeUnloadConfirmPanelResultListener* WKPageRunBeforeUnloadConfirmPanelResultListenerRef;
|
||||||
|
typedef const struct OpaqueWKPageRunJavaScriptAlertResultListener* WKPageRunJavaScriptAlertResultListenerRef;
|
||||||
|
typedef const struct OpaqueWKPageRunJavaScriptConfirmResultListener* WKPageRunJavaScriptConfirmResultListenerRef;
|
||||||
|
typedef const struct OpaqueWKPageRunJavaScriptPromptResultListener* WKPageRunJavaScriptPromptResultListenerRef;
|
||||||
|
typedef const struct OpaqueWKPageRequestStorageAccessConfirmResultListener* WKPageRequestStorageAccessConfirmResultListenerRef;
|
||||||
|
typedef const struct OpaqueWKResourceLoadStatisticsManager* WKResourceLoadStatisticsManagerRef;
|
||||||
|
typedef const struct OpaqueWKTextChecker* WKTextCheckerRef;
|
||||||
|
typedef const struct OpaqueWKSession* WKSessionRef;
|
||||||
|
typedef const struct OpaqueWKSessionState* WKSessionStateRef;
|
||||||
|
typedef const struct OpaqueWKUserContentController* WKUserContentControllerRef;
|
||||||
|
typedef const struct OpaqueWKUserContentExtensionStore* WKUserContentExtensionStoreRef;
|
||||||
|
typedef const struct OpaqueWKUserContentFilter* WKUserContentFilterRef;
|
||||||
|
typedef const struct OpaqueWKUserMediaPermissionCheck* WKUserMediaPermissionCheckRef;
|
||||||
|
typedef const struct OpaqueWKUserMediaPermissionRequest* WKUserMediaPermissionRequestRef;
|
||||||
|
typedef const struct OpaqueWKUserScript* WKUserScriptRef;
|
||||||
|
typedef const struct OpaqueWKViewportAttributes* WKViewportAttributesRef;
|
||||||
|
typedef const struct OpaqueWKWebsiteDataConfigurationStore* WKWebsiteDataStoreConfigurationRef;
|
||||||
|
typedef const struct OpaqueWKWebsiteDataStore* WKWebsiteDataStoreRef;
|
||||||
|
typedef const struct OpaqueWKWebsitePolicies* WKWebsitePoliciesRef;
|
||||||
|
typedef const struct OpaqueWKWindowFeatures* WKWindowFeaturesRef;
|
||||||
|
typedef const struct OpaqueWKSpeechRecognitionPermissionCallback* WKSpeechRecognitionPermissionCallbackRef;
|
||||||
|
typedef const struct OpaqueWKMediaKeySystemPermissionRequest* WKMediaKeySystemPermissionRequestRef;
|
||||||
|
typedef const struct OpaqueWKMediaKeySystemPermissionCallback* WKMediaKeySystemPermissionCallbackRef;
|
||||||
|
typedef const struct OpaqueWKQueryPermissionResultCallback* WKQueryPermissionResultCallbackRef;
|
||||||
|
|
||||||
|
/* WebKit2 Bundle types */
|
||||||
|
|
||||||
|
typedef const struct OpaqueWKBundle* WKBundleRef;
|
||||||
|
typedef const struct OpaqueWKBundleBackForwardList* WKBundleBackForwardListRef;
|
||||||
|
typedef const struct OpaqueWKBundleBackForwardListItem* WKBundleBackForwardListItemRef;
|
||||||
|
typedef const struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef;
|
||||||
|
typedef const struct OpaqueWKBundleDOMWindowExtension* WKBundleDOMWindowExtensionRef;
|
||||||
|
typedef const struct OpaqueWKBundleFileHandle* WKBundleFileHandleRef;
|
||||||
|
typedef const struct OpaqueWKBundleFrame* WKBundleFrameRef;
|
||||||
|
typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef;
|
||||||
|
typedef const struct OpaqueWKBundleInspector* WKBundleInspectorRef;
|
||||||
|
typedef const struct OpaqueWKBundleNavigationAction* WKBundleNavigationActionRef;
|
||||||
|
typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
|
||||||
|
typedef const struct OpaqueWKBundlePage* WKBundlePageRef;
|
||||||
|
typedef const struct OpaqueWKBundlePageBanner* WKBundlePageBannerRef;
|
||||||
|
typedef const struct OpaqueWKBundlePageGroup* WKBundlePageGroupRef;
|
||||||
|
typedef const struct OpaqueWKBundlePageOverlay* WKBundlePageOverlayRef;
|
||||||
|
typedef const struct OpaqueWKBundleRangeHandle* WKBundleRangeHandleRef;
|
||||||
|
typedef const struct OpaqueWKBundleScriptWorld* WKBundleScriptWorldRef;
|
||||||
|
|
||||||
|
#endif /* WKBase_h */
|
||||||
35
WebKit Headers/WebKit/WKBaseMac.h
Normal file
35
WebKit Headers/WebKit/WKBaseMac.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef WKBaseMac_h
|
||||||
|
#define WKBaseMac_h
|
||||||
|
|
||||||
|
#ifndef WKBase_h
|
||||||
|
#error "Please #include \"WKBase.h\" instead of this file directly."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef const struct OpaqueWKObjCTypeWrapper* WKObjCTypeWrapperRef;
|
||||||
|
|
||||||
|
#endif /* WKBaseMac_h */
|
||||||
79
WebKit Headers/WebKit/WKDeclarationSpecifiers.h
Normal file
79
WebKit Headers/WebKit/WKDeclarationSpecifiers.h
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
|
||||||
|
* Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef WKDeclarationSpecifiers_h
|
||||||
|
#define WKDeclarationSpecifiers_h
|
||||||
|
|
||||||
|
#ifndef __has_declspec_attribute
|
||||||
|
#define __has_declspec_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef WK_EXPORT
|
||||||
|
#if defined(WK_NO_EXPORT)
|
||||||
|
#define WK_EXPORT
|
||||||
|
#elif defined(WIN32) || defined(_WIN32) || defined(__CC_ARM) || defined(__ARMCC__) || (__has_declspec_attribute(dllimport) && __has_declspec_attribute(dllexport))
|
||||||
|
#if defined(BUILDING_WebKit)
|
||||||
|
#define WK_EXPORT __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define WK_EXPORT __declspec(dllimport)
|
||||||
|
#endif /* defined(BUILDING_WebKit) */
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define WK_EXPORT __attribute__((visibility("default")))
|
||||||
|
#else /* !defined(WK_NO_EXPORT) */
|
||||||
|
#define WK_EXPORT
|
||||||
|
#endif /* defined(WK_NO_EXPORT) */
|
||||||
|
|
||||||
|
#if !defined(WK_INLINE)
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
#define WK_INLINE static inline
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define WK_INLINE static __inline__
|
||||||
|
#else
|
||||||
|
#define WK_INLINE static
|
||||||
|
#endif
|
||||||
|
#endif /* !defined(WK_INLINE) */
|
||||||
|
|
||||||
|
#ifndef __has_extension
|
||||||
|
#define __has_extension(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_extension(enumerator_attributes) && __has_extension(attribute_unavailable_with_message)
|
||||||
|
#define WK_C_DEPRECATED(message) __attribute__((deprecated(message)))
|
||||||
|
#else
|
||||||
|
#define WK_C_DEPRECATED(message)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __has_attribute
|
||||||
|
#define __has_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_attribute(unavailable)
|
||||||
|
#define WK_UNAVAILABLE __attribute__((unavailable))
|
||||||
|
#else
|
||||||
|
#define WK_UNAVAILABLE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* WKDeclarationSpecifiers_h */
|
||||||
47
WebKit Headers/WebKit/WKLayoutMode.h
Normal file
47
WebKit Headers/WebKit/WKLayoutMode.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef WKLayoutMode_h
|
||||||
|
#define WKLayoutMode_h
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
enum {
|
||||||
|
kWKLayoutModeViewSize = 0,
|
||||||
|
kWKLayoutModeFixedSize = 1,
|
||||||
|
kWKLayoutModeDynamicSizeComputedFromViewScale = 2,
|
||||||
|
kWKLayoutModeDynamicSizeComputedFromMinimumDocumentSize = 4
|
||||||
|
};
|
||||||
|
typedef uint32_t WKLayoutMode;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* WKLayoutMode_h */
|
||||||
149
WebKit Headers/WebKit/WKProcessPoolPrivate.h
Normal file
149
WebKit Headers/WebKit/WKProcessPoolPrivate.h
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014-2022 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKBase.h>
|
||||||
|
#import <WebKit/WKProcessPool.h>
|
||||||
|
#import <WebKit/WKSecurityOrigin.h>
|
||||||
|
|
||||||
|
@class WKWebView;
|
||||||
|
@class WKWebsiteDataStore;
|
||||||
|
@class _WKAutomationSession;
|
||||||
|
@class _WKDownload;
|
||||||
|
@class _WKProcessPoolConfiguration;
|
||||||
|
|
||||||
|
@protocol _WKAutomationDelegate;
|
||||||
|
@protocol _WKDownloadDelegate;
|
||||||
|
@protocol _WKGeolocationCoreLocationProvider;
|
||||||
|
|
||||||
|
@interface WKProcessPool ()
|
||||||
|
- (instancetype)_initWithConfiguration:(_WKProcessPoolConfiguration *)configuration __attribute__((objc_method_family(init))) NS_DESIGNATED_INITIALIZER;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface WKProcessPool (WKPrivate)
|
||||||
|
|
||||||
|
+ (WKProcessPool *)_sharedProcessPool;
|
||||||
|
|
||||||
|
+ (NSArray<WKProcessPool *> *)_allProcessPoolsForTesting WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKProcessPoolConfiguration *_configuration;
|
||||||
|
|
||||||
|
- (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebsiteDataStore._allowTLSCertificateChain:forHost:", macos(10.10, 12.0), ios(8.0, 15.0));
|
||||||
|
- (void)_setCanHandleHTTPSServerTrustEvaluation:(BOOL)value WK_API_DEPRECATED_WITH_REPLACEMENT("_WKWebsiteDataStoreConfiguration.fastServerTrustEvaluationEnabled", macos(10.11, 10.15.4), ios(9.0, 13.4));
|
||||||
|
|
||||||
|
- (id)_objectForBundleParameter:(NSString *)parameter;
|
||||||
|
- (void)_setObject:(id <NSCopying, NSSecureCoding>)object forBundleParameter:(NSString *)parameter;
|
||||||
|
// FIXME: This should be NSDictionary<NSString *, id <NSCopying, NSSecureCoding>>
|
||||||
|
- (void)_setObjectsForBundleParametersWithDictionary:(NSDictionary *)dictionary WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
|
||||||
|
#if !TARGET_OS_IPHONE
|
||||||
|
- (void)_resetPluginLoadClientPolicies:(NSDictionary *)policies WK_API_AVAILABLE(macos(10.13));
|
||||||
|
@property (nonatomic, readonly, copy) NSDictionary *_pluginLoadClientPolicies WK_API_AVAILABLE(macos(10.13));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setDownloadDelegate:) id <_WKDownloadDelegate> _downloadDelegate WK_API_DEPRECATED_WITH_REPLACEMENT("WKDownload.downloadDelegate", macos(10.10, 12.0), ios(8.0, 15.0));
|
||||||
|
@property (nonatomic, weak, setter=_setAutomationDelegate:) id <_WKAutomationDelegate> _automationDelegate WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@property (nonatomic, setter=_setCoreLocationProvider:) id <_WKGeolocationCoreLocationProvider> _coreLocationProvider WK_API_AVAILABLE(ios(11.0));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+ (NSURL *)_websiteDataURLForContainerWithURL:(NSURL *)containerURL;
|
||||||
|
+ (NSURL *)_websiteDataURLForContainerWithURL:(NSURL *)containerURL bundleIdentifierIfNotInContainer:(NSString *)bundleIdentifier;
|
||||||
|
|
||||||
|
+ (void)_setWebProcessCountLimit:(unsigned)limit WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
- (void)_warmInitialProcess WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_automationCapabilitiesDidChange WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_setAutomationSession:(_WKAutomationSession *)automationSession WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
|
||||||
|
@property (nonatomic, copy, setter=_setJavaScriptConfigurationDirectory:) NSURL *_javaScriptConfigurationDirectory WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
|
||||||
|
- (void)_addSupportedPlugin:(NSString *) domain named:(NSString *) name withMimeTypes: (NSSet<NSString *> *) mimeTypes withExtensions: (NSSet<NSString *> *) extensions WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
- (void)_clearSupportedPlugins WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
|
||||||
|
- (void)_registerURLSchemeAsCanDisplayOnlyIfCanRequest:(NSString *)scheme WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
- (void)_registerURLSchemeAsSecure:(NSString *)scheme WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_registerURLSchemeAsBypassingContentSecurityPolicy:(NSString *)scheme WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_setDomainRelaxationForbiddenForURLScheme:(NSString *)scheme WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
- (_WKDownload *)_downloadURLRequest:(NSURLRequest *)request websiteDataStore:(WKWebsiteDataStore *)dataStore originatingWebView:(WKWebView *)webView WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView _downloadRequest", macos(10.10, 12.0), ios(8.0, 15.0));
|
||||||
|
- (_WKDownload *)_resumeDownloadFromData:(NSData *)resumeData websiteDataStore:(WKWebsiteDataStore *)dataStore path:(NSString *)path originatingWebView:(WKWebView *)webView WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.resumeDownloadFromResumeData:completionHandler:", macos(10.10, 12.0), ios(8.0, 15.0));
|
||||||
|
|
||||||
|
+ (void)_setLinkedOnOrAfterEverything WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
// Test only. Should be called only while no web content processes are running.
|
||||||
|
- (void)_terminateServiceWorkers WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
|
||||||
|
// Test only.
|
||||||
|
- (pid_t)_prewarmedProcessIdentifier WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
|
||||||
|
- (void)_terminateAllWebContentProcesses;
|
||||||
|
|
||||||
|
// Test only.
|
||||||
|
- (size_t)_webProcessCount WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
- (BOOL)_hasPrewarmedWebProcess WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (size_t)_webProcessCountIgnoringPrewarmed WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
- (size_t)_webProcessCountIgnoringPrewarmedAndCached WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (size_t)_pluginProcessCount WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
|
||||||
|
- (size_t)_serviceWorkerProcessCount WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
- (void)_makeNextWebProcessLaunchFailForTesting WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
- (NSUInteger)_maximumSuspendedPageCount WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (NSUInteger)_processCacheCapacity WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (NSUInteger)_processCacheSize WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
- (void)_clearWebProcessCache WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (void)_setUseSeparateServiceWorkerProcess:(BOOL)forceServiceWorkerProcess WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (pid_t)_gpuProcessIdentifier WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (BOOL)_hasAudibleMediaActivity WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
- (BOOL)_requestWebProcessTermination:(pid_t)pid WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
// Test only. Returns web processes running web pages (does not include web processes running service workers)
|
||||||
|
- (size_t)_webPageContentProcessCount WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
|
||||||
|
|
||||||
|
// Test only. Should be called before any web content processes are launched.
|
||||||
|
+ (void)_forceGameControllerFramework WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
+ (void)_setLinkedOnOrAfterEverythingForTesting WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
+ (void)_setLinkedOnOrBeforeEverythingForTesting WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
+ (void)_setCaptivePortalModeEnabledGloballyForTesting:(BOOL)isEnabled WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
+ (void)_clearCaptivePortalModeEnabledGloballyForTesting WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
+ (BOOL)_lockdownModeEnabledGloballyForTesting WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
- (void)_preconnectToServer:(NSURL *)serverURL WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView._preconnectToServer", macos(10.13.4, 10.15.4), ios(11.3, 13.4));
|
||||||
|
|
||||||
|
// Test only.
|
||||||
|
- (void)_getActivePagesOriginsInWebProcessForTesting:(pid_t)pid completionHandler:(void(^)(NSArray<NSString *> *))completionHandler WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (void)_clearPermanentCredentialsForProtectionSpace:(NSURLProtectionSpace *)protectionSpace WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
|
||||||
|
@property (nonatomic, getter=_isCookieStoragePartitioningEnabled, setter=_setCookieStoragePartitioningEnabled:) BOOL _cookieStoragePartitioningEnabled WK_API_DEPRECATED("Partitioned cookies are no longer supported", macos(10.12.3, 10.14.4), ios(10.3, 12.2));
|
||||||
|
|
||||||
|
- (WKNotificationManagerRef)_notificationManagerForTesting;
|
||||||
|
|
||||||
|
// Test only.
|
||||||
|
- (void)_seedResourceLoadStatisticsForTestingWithFirstParty:(NSURL *)firstPartyURL thirdParty:(NSURL *)thirdPartyURL shouldScheduleNotification:(BOOL)shouldScheduleNotification completionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (void)_garbageCollectJavaScriptObjectsForTesting WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
- (size_t)_numberOfConnectedGamepadsForTesting WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
- (size_t)_numberOfConnectedHIDGamepadsForTesting WK_API_AVAILABLE(macos(11.0), ios(15.0));
|
||||||
|
- (size_t)_numberOfConnectedGameControllerFrameworkGamepadsForTesting WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
- (void)_setUsesOnlyHIDGamepadProviderForTesting:(BOOL)usesHIDProvider WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
@end
|
||||||
63
WebKit Headers/WebKit/WKUserContentControllerPrivate.h
Normal file
63
WebKit Headers/WebKit/WKUserContentControllerPrivate.h
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKUserContentController.h>
|
||||||
|
|
||||||
|
@class WKContentWorld;
|
||||||
|
@class WKUserScript;
|
||||||
|
@class _WKUserContentFilter;
|
||||||
|
@class _WKUserContentWorld;
|
||||||
|
@class _WKUserStyleSheet;
|
||||||
|
|
||||||
|
@interface WKUserContentController (WKPrivate)
|
||||||
|
|
||||||
|
- (void)_removeUserScript:(WKUserScript *)userScript WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_removeAllUserScriptsAssociatedWithContentWorld:(WKContentWorld *)contentWorld WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
- (void)_addUserScriptImmediately:(WKUserScript *)userScript WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
|
||||||
|
// FIXME: Remove this once rdar://100785999 is unblocked.
|
||||||
|
- (void)_addUserContentFilter:(_WKUserContentFilter *)userContentFilter WK_API_DEPRECATED_WITH_REPLACEMENT("addContentRuleList", macos(10.11, 13.3), ios(9.0, 16.4));
|
||||||
|
|
||||||
|
- (void)_removeUserContentFilter:(NSString *)userContentFilterName WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
- (void)_removeAllUserContentFilters WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
- (void)_addContentRuleList:(WKContentRuleList *)contentRuleList extensionBaseURL:(NSURL *)extensionBaseURL WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, copy) NSArray<_WKUserStyleSheet *> *_userStyleSheets WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_addUserStyleSheet:(_WKUserStyleSheet *)userStyleSheet WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_removeUserStyleSheet:(_WKUserStyleSheet *)userStyleSheet WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_removeAllUserStyleSheets WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_removeAllUserStyleSheetsAssociatedWithContentWorld:(WKContentWorld *)contentWorld WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
- (void)_addScriptMessageHandler:(id <WKScriptMessageHandler>)scriptMessageHandler name:(NSString *)name userContentWorld:(_WKUserContentWorld *)userContentWorld WK_API_DEPRECATED_WITH_REPLACEMENT("_addScriptMessageHandler:name:contentWorld:", macos(10.11, 11.0), ios(9.0, 14.0));
|
||||||
|
- (void)_addScriptMessageHandler:(id <WKScriptMessageHandler>)scriptMessageHandler name:(NSString *)name contentWorld:(WKContentWorld *)contentWorld;
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
- (void)_removeScriptMessageHandlerForName:(NSString *)name userContentWorld:(_WKUserContentWorld *)userContentWorld;
|
||||||
|
- (void)_removeAllScriptMessageHandlersAssociatedWithUserContentWorld:(_WKUserContentWorld *)userContentWorld;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
|
@end
|
||||||
47
WebKit Headers/WebKit/WKWebProcessPlugIn.h
Normal file
47
WebKit Headers/WebKit/WKWebProcessPlugIn.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012-2020 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <WebKit/WKBase.h>
|
||||||
|
|
||||||
|
@class WKWebProcessPlugInController;
|
||||||
|
@class WKWebProcessPlugInBrowserContextController;
|
||||||
|
|
||||||
|
@protocol WKWebProcessPlugIn <NSObject>
|
||||||
|
@optional
|
||||||
|
- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController initializeWithObject:(id)initializationObject;
|
||||||
|
- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController didCreateBrowserContextController:(WKWebProcessPlugInBrowserContextController *)browserContextController;
|
||||||
|
- (void)webProcessPlugIn:(WKWebProcessPlugInController *)plugInController willDestroyBrowserContextController:(WKWebProcessPlugInBrowserContextController *)browserContextController;
|
||||||
|
- (NSArray *)additionalClassesForParameterCoder;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface WKWebProcessPlugInController : NSObject
|
||||||
|
- (void)extendClassesForParameterCoder:(NSArray *)classes;
|
||||||
|
|
||||||
|
@property (readonly) id parameters;
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@class WKDOMDocument;
|
||||||
|
@class WKDOMRange;
|
||||||
|
@class WKWebProcessPlugInFrame;
|
||||||
|
@protocol WKWebProcessPlugInLoadDelegate;
|
||||||
|
|
||||||
|
@interface WKWebProcessPlugInBrowserContextController : NSObject
|
||||||
|
|
||||||
|
@property (readonly) WKDOMDocument *mainFrameDocument;
|
||||||
|
|
||||||
|
@property (readonly) WKDOMRange *selectedRange;
|
||||||
|
|
||||||
|
@property (readonly) WKWebProcessPlugInFrame *mainFrame;
|
||||||
|
|
||||||
|
@property (weak) id <WKWebProcessPlugInLoadDelegate> loadDelegate;
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKWebProcessPlugInBrowserContextController.h>
|
||||||
|
|
||||||
|
#import <WebKit/WKBase.h>
|
||||||
|
|
||||||
|
@class WKBrowsingContextHandle;
|
||||||
|
@class _WKRemoteObjectRegistry;
|
||||||
|
@protocol WKWebProcessPlugInEditingDelegate;
|
||||||
|
@protocol WKWebProcessPlugInFormDelegatePrivate;
|
||||||
|
|
||||||
|
@interface WKWebProcessPlugInBrowserContextController (WKPrivate)
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) WKBundlePageRef _bundlePageRef;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) WKBrowsingContextHandle *handle;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKRemoteObjectRegistry *_remoteObjectRegistry;
|
||||||
|
|
||||||
|
@property (weak, setter=_setFormDelegate:) id <WKWebProcessPlugInFormDelegatePrivate> _formDelegate;
|
||||||
|
@property (weak, setter=_setEditingDelegate:) id <WKWebProcessPlugInEditingDelegate> _editingDelegate API_AVAILABLE(macos(10.12.3), ios(10.3));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL _usesNonPersistentWebsiteDataStore;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSString *_groupIdentifier API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
+ (instancetype)lookUpBrowsingContextFromHandle:(WKBrowsingContextHandle *)handle;
|
||||||
|
|
||||||
|
@end
|
||||||
65
WebKit Headers/WebKit/WKWebProcessPlugInFrame.h
Normal file
65
WebKit Headers/WebKit/WKWebProcessPlugInFrame.h
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
#import <CoreGraphics/CoreGraphics.h>
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <JavaScriptCore/JavaScriptCore.h>
|
||||||
|
|
||||||
|
@class _WKFrameHandle;
|
||||||
|
@class WKWebProcessPlugInCSSStyleDeclarationHandle;
|
||||||
|
@class WKWebProcessPlugInHitTestResult;
|
||||||
|
@class WKWebProcessPlugInNodeHandle;
|
||||||
|
@class WKWebProcessPlugInRangeHandle;
|
||||||
|
@class WKWebProcessPlugInScriptWorld;
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, WKHitTestOptions) {
|
||||||
|
WKHitTestOptionAllowUserAgentShadowRootContent = 1 << 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
@interface WKWebProcessPlugInFrame : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSURL *URL;
|
||||||
|
@property (nonatomic, readonly) NSArray *childFrames;
|
||||||
|
@property (nonatomic, readonly) BOOL containsAnyFormElements;
|
||||||
|
@property (nonatomic, readonly) BOOL isMainFrame;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKFrameHandle *handle;
|
||||||
|
|
||||||
|
// Returns URLs ordered by resolution in descending order.
|
||||||
|
// FIXME: These should be tagged nonnull.
|
||||||
|
@property (nonatomic, readonly) NSArray<NSURL *> *appleTouchIconURLs API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, readonly) NSArray<NSURL *> *faviconURLs API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
|
||||||
|
- (JSContext *)jsContextForWorld:(WKWebProcessPlugInScriptWorld *)world;
|
||||||
|
- (JSContext *)jsContextForServiceWorkerWorld:(WKWebProcessPlugInScriptWorld *)world;
|
||||||
|
- (WKWebProcessPlugInHitTestResult *)hitTest:(CGPoint)point;
|
||||||
|
- (WKWebProcessPlugInHitTestResult *)hitTest:(CGPoint)point options:(WKHitTestOptions)options API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (JSValue *)jsCSSStyleDeclarationForCSSStyleDeclarationHandle:(WKWebProcessPlugInCSSStyleDeclarationHandle *)cssStyleDeclarationHandle inWorld:(WKWebProcessPlugInScriptWorld *)world API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
- (JSValue *)jsNodeForNodeHandle:(WKWebProcessPlugInNodeHandle *)nodeHandle inWorld:(WKWebProcessPlugInScriptWorld *)world;
|
||||||
|
- (JSValue *)jsRangeForRangeHandle:(WKWebProcessPlugInRangeHandle *)rangeHandle inWorld:(WKWebProcessPlugInScriptWorld *)world API_AVAILABLE(macos(10.12.3), ios(10.3));
|
||||||
|
|
||||||
|
@end
|
||||||
71
WebKit Headers/WebKit/WKWebProcessPlugInLoadDelegate.h
Normal file
71
WebKit Headers/WebKit/WKWebProcessPlugInLoadDelegate.h
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <WebKit/_WKRenderingProgressEvents.h>
|
||||||
|
#import <WebKit/_WKSameDocumentNavigationType.h>
|
||||||
|
|
||||||
|
@class WKWebProcessPlugInBrowserContextController;
|
||||||
|
@class WKWebProcessPlugInFrame;
|
||||||
|
@class WKWebProcessPlugInScriptWorld;
|
||||||
|
|
||||||
|
@protocol WKWebProcessPlugInLoadDelegate <NSObject>
|
||||||
|
@optional
|
||||||
|
|
||||||
|
// Frame loading
|
||||||
|
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didStartProvisionalLoadForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didReceiveServerRedirectForProvisionalLoadForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didCommitLoadForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didFinishDocumentLoadForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didFailProvisionalLoadWithErrorForFrame:(WKWebProcessPlugInFrame *)frame error:(NSError *)error;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didFailLoadWithErrorForFrame:(WKWebProcessPlugInFrame *)frame error:(NSError *)error;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didFinishLoadForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didSameDocumentNavigation:(_WKSameDocumentNavigationType)navigationType forFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didClearWindowObjectForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller globalObjectIsAvailableForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller serviceWorkerGlobalObjectIsAvailableForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller willInjectUserScriptForFrame:(WKWebProcessPlugInFrame *)frame inScriptWorld:(WKWebProcessPlugInScriptWorld *)scriptWorld;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didRemoveFrameFromHierarchy:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller didHandleOnloadEventsForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
|
||||||
|
// Layout
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didLayoutForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller renderingProgressDidChange:(_WKRenderingProgressEvents)events;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController*)controller didFirstVisuallyNonEmptyLayoutForFrame:(WKWebProcessPlugInFrame *)frame;
|
||||||
|
- (_WKRenderingProgressEvents)webProcessPlugInBrowserContextControllerRenderingProgressEvents:(WKWebProcessPlugInBrowserContextController *)controller;
|
||||||
|
|
||||||
|
// Resource loading
|
||||||
|
|
||||||
|
- (NSURLRequest *)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame willSendRequestForResource:(uint64_t)resource request:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;
|
||||||
|
- (NSURLRequest *)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;
|
||||||
|
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame didInitiateLoadForResource:(uint64_t)resource request:(NSURLRequest *)request pageIsProvisionallyLoading:(BOOL)pageIsProvisionallyLoading;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame didInitiateLoadForResource:(uint64_t)resource request:(NSURLRequest *)request;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame didReceiveResponse:(NSURLResponse *)response forResource:(uint64_t)resource;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame didFinishLoadForResource:(uint64_t)resource;
|
||||||
|
- (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame didFailLoadForResource:(uint64_t)resource error:(NSError *)error;
|
||||||
|
|
||||||
|
@end
|
||||||
173
WebKit Headers/WebKit/WKWebViewConfigurationPrivate.h
Normal file
173
WebKit Headers/WebKit/WKWebViewConfigurationPrivate.h
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014-2020 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKBase.h>
|
||||||
|
#import <WebKit/WKWebViewConfiguration.h>
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
typedef NS_ENUM(NSUInteger, _WKDragLiftDelay) {
|
||||||
|
_WKDragLiftDelayShort = 0,
|
||||||
|
_WKDragLiftDelayMedium,
|
||||||
|
_WKDragLiftDelayLong
|
||||||
|
} WK_API_AVAILABLE(ios(11.0));
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, _WKAttributionOverrideTesting) {
|
||||||
|
_WKAttributionOverrideTestingNoOverride = 0,
|
||||||
|
_WKAttributionOverrideTestingAppInitiated,
|
||||||
|
_WKAttributionOverrideTestingUserInitiated
|
||||||
|
} WK_API_AVAILABLE(ios(15.0));
|
||||||
|
|
||||||
|
@protocol _UIClickInteractionDriving;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, _WKContentSecurityPolicyModeForExtension) {
|
||||||
|
_WKContentSecurityPolicyModeForExtensionNone = 0,
|
||||||
|
_WKContentSecurityPolicyModeForExtensionManifestV2,
|
||||||
|
_WKContentSecurityPolicyModeForExtensionManifestV3
|
||||||
|
} WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
@class WKWebView;
|
||||||
|
@class _WKApplicationManifest;
|
||||||
|
@class _WKVisitedLinkStore;
|
||||||
|
@class _WKWebExtensionController;
|
||||||
|
|
||||||
|
@interface WKWebViewConfiguration (WKPrivate)
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setRelatedWebView:) WKWebView *_relatedWebView;
|
||||||
|
@property (nonatomic, weak, setter=_setWebViewToCloneSessionStorageFrom:) WKWebView *_webViewToCloneSessionStorageFrom;
|
||||||
|
@property (nonatomic, copy, setter=_setGroupIdentifier:) NSString *_groupIdentifier;
|
||||||
|
|
||||||
|
@property (nonatomic, strong, setter=_setVisitedLinkStore:) _WKVisitedLinkStore *_visitedLinkStore;
|
||||||
|
|
||||||
|
@property (nonatomic, strong, readonly) _WKWebExtensionController *_strongWebExtensionController;
|
||||||
|
@property (nonatomic, weak, setter=_setWeakWebExtensionController:) _WKWebExtensionController *_weakWebExtensionController;
|
||||||
|
@property (nonatomic, strong, setter=_setWebExtensionController:) _WKWebExtensionController *_webExtensionController;
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setAlternateWebViewForNavigationGestures:) WKWebView *_alternateWebViewForNavigationGestures;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setRespectsImageOrientation:) BOOL _respectsImageOrientation WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setPrintsBackgrounds:) BOOL _printsBackgrounds WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setIncrementalRenderingSuppressionTimeout:) NSTimeInterval _incrementalRenderingSuppressionTimeout WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setAllowsJavaScriptMarkup:) BOOL _allowsJavaScriptMarkup WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setConvertsPositionStyleOnCopy:) BOOL _convertsPositionStyleOnCopy WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setAllowsMetaRefresh:) BOOL _allowsMetaRefresh WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setAllowUniversalAccessFromFileURLs:) BOOL _allowUniversalAccessFromFileURLs WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setAllowTopNavigationToDataURLs:) BOOL _allowTopNavigationToDataURLs WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
@property (nonatomic, setter=_setNeedsStorageAccessFromFileURLsQuirk:) BOOL _needsStorageAccessFromFileURLsQuirk WK_API_AVAILABLE(macos(10.12.3), ios(10.3));
|
||||||
|
@property (nonatomic, setter=_setMainContentUserGestureOverrideEnabled:) BOOL _mainContentUserGestureOverrideEnabled WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setInvisibleAutoplayNotPermitted:) BOOL _invisibleAutoplayNotPermitted WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setMediaDataLoadsAutomatically:) BOOL _mediaDataLoadsAutomatically WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setAttachmentElementEnabled:) BOOL _attachmentElementEnabled WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setAttachmentWideLayoutEnabled:) BOOL _attachmentWideLayoutEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
|
||||||
|
@property (nonatomic, setter=_setAttachmentFileWrapperClass:) Class _attachmentFileWrapperClass WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
@property (nonatomic, setter=_setInitialCapitalizationEnabled:) BOOL _initialCapitalizationEnabled WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setApplePayEnabled:) BOOL _applePayEnabled WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setWaitsForPaintAfterViewDidMoveToWindow:) BOOL _waitsForPaintAfterViewDidMoveToWindow WK_API_AVAILABLE(macos(10.12.3), ios(10.3));
|
||||||
|
@property (nonatomic, setter=_setControlledByAutomation:, getter=_isControlledByAutomation) BOOL _controlledByAutomation WK_API_AVAILABLE(macos(10.12.3), ios(10.3));
|
||||||
|
@property (nonatomic, setter=_setApplicationManifest:) _WKApplicationManifest *_applicationManifest WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
|
||||||
|
@property (nonatomic, setter=_setColorFilterEnabled:) BOOL _colorFilterEnabled WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
@property (nonatomic, setter=_setIncompleteImageBorderEnabled:) BOOL _incompleteImageBorderEnabled WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
@property (nonatomic, setter=_setDrawsBackground:) BOOL _drawsBackground WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
@property (nonatomic, setter=_setShouldDeferAsynchronousScriptsUntilAfterDocumentLoad:) BOOL _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) WKWebsiteDataStore *_websiteDataStoreIfExists WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
@property (nonatomic, copy, setter=_setCORSDisablingPatterns:) NSArray<NSString *> *_corsDisablingPatterns WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
@property (nonatomic, copy, setter=_setMaskedURLSchemes:) NSSet<NSString *> *_maskedURLSchemes WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
@property (nonatomic, setter=_setDeferrableUserScriptsShouldWaitUntilNotification:) BOOL _deferrableUserScriptsShouldWaitUntilNotification WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
@property (nonatomic, setter=_setCrossOriginAccessControlCheckEnabled:) BOOL _crossOriginAccessControlCheckEnabled WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setLoadsFromNetwork:) BOOL _loadsFromNetwork WK_API_DEPRECATED_WITH_REPLACEMENT("_allowedNetworkHosts", macos(11.0, 12.0), ios(14.0, 15.0));
|
||||||
|
@property (nonatomic, copy, setter=_setAllowedNetworkHosts:) NSSet<NSString *> *_allowedNetworkHosts WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
@property (nonatomic, setter=_setLoadsSubresources:) BOOL _loadsSubresources WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
@property (nonatomic, setter=_setIgnoresAppBoundDomains:) BOOL _ignoresAppBoundDomains WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@property (nonatomic, setter=_setClientNavigationsRunAtForegroundPriority:) BOOL _clientNavigationsRunAtForegroundPriority WK_API_AVAILABLE(ios(13.4));
|
||||||
|
@property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_API_DEPRECATED_WITH_REPLACEMENT("_clientNavigationsRunAtForegroundPriority", ios(9.0, 14.0));
|
||||||
|
@property (nonatomic, setter=_setInlineMediaPlaybackRequiresPlaysInlineAttribute:) BOOL _inlineMediaPlaybackRequiresPlaysInlineAttribute WK_API_AVAILABLE(ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setAllowsInlineMediaPlaybackAfterFullscreen:) BOOL _allowsInlineMediaPlaybackAfterFullscreen WK_API_AVAILABLE(ios(10.0));
|
||||||
|
@property (nonatomic, setter=_setDragLiftDelay:) _WKDragLiftDelay _dragLiftDelay WK_API_AVAILABLE(ios(11.0));
|
||||||
|
@property (nonatomic, setter=_setLongPressActionsEnabled:) BOOL _longPressActionsEnabled WK_API_AVAILABLE(ios(12.0));
|
||||||
|
@property (nonatomic, setter=_setSystemPreviewEnabled:) BOOL _systemPreviewEnabled WK_API_AVAILABLE(ios(12.0));
|
||||||
|
@property (nonatomic, setter=_setShouldDecidePolicyBeforeLoadingQuickLookPreview:) BOOL _shouldDecidePolicyBeforeLoadingQuickLookPreview WK_API_AVAILABLE(ios(13.0));
|
||||||
|
@property (nonatomic, setter=_setCanShowWhileLocked:) BOOL _canShowWhileLocked WK_API_AVAILABLE(ios(13.0));
|
||||||
|
@property (nonatomic, setter=_setClickInteractionDriverForTesting:) id <_UIClickInteractionDriving> _clickInteractionDriverForTesting WK_API_AVAILABLE(ios(13.0));
|
||||||
|
@property (nonatomic, setter=_setAppInitiatedOverrideValueForTesting:) _WKAttributionOverrideTesting _appInitiatedOverrideValueForTesting WK_API_AVAILABLE(ios(15.0));
|
||||||
|
#else
|
||||||
|
@property (nonatomic, setter=_setShowsURLsInToolTips:) BOOL _showsURLsInToolTips WK_API_AVAILABLE(macos(10.12));
|
||||||
|
@property (nonatomic, setter=_setServiceControlsEnabled:) BOOL _serviceControlsEnabled WK_API_AVAILABLE(macos(10.12));
|
||||||
|
@property (nonatomic, setter=_setImageControlsEnabled:) BOOL _imageControlsEnabled WK_API_AVAILABLE(macos(13.0));
|
||||||
|
@property (nonatomic, setter=_setContextMenuQRCodeDetectionEnabled:) BOOL _contextMenuQRCodeDetectionEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA));
|
||||||
|
@property (nonatomic, readwrite, setter=_setRequiresUserActionForEditingControlsManager:) BOOL _requiresUserActionForEditingControlsManager WK_API_AVAILABLE(macos(10.12));
|
||||||
|
@property (nonatomic, readwrite, setter=_setCPULimit:) double _cpuLimit WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (nonatomic, readwrite, setter=_setPageGroup:) WKPageGroupRef _pageGroup WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setRequiresUserActionForAudioPlayback:) BOOL _requiresUserActionForAudioPlayback WK_API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", macos(10.12, 10.12), ios(10.0, 10.0));
|
||||||
|
@property (nonatomic, setter=_setRequiresUserActionForVideoPlayback:) BOOL _requiresUserActionForVideoPlayback WK_API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", macos(10.12, 10.12), ios(10.0, 10.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setOverrideContentSecurityPolicy:) NSString *_overrideContentSecurityPolicy WK_API_AVAILABLE(macos(10.12.3), ios(10.3));
|
||||||
|
@property (nonatomic, setter=_setMediaContentTypesRequiringHardwareSupport:) NSString *_mediaContentTypesRequiringHardwareSupport WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
@property (nonatomic, setter=_setLegacyEncryptedMediaAPIEnabled:) BOOL _legacyEncryptedMediaAPIEnabled WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
@property (nonatomic, setter=_setAllowMediaContentTypesRequiringHardwareSupportAsFallback:) BOOL _allowMediaContentTypesRequiringHardwareSupportAsFallback WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setMediaCaptureEnabled:) BOOL _mediaCaptureEnabled WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
// The input of this SPI is an array of image UTI (Uniform Type Identifier).
|
||||||
|
@property (nonatomic, copy, setter=_setAdditionalSupportedImageTypes:) NSArray<NSString *> *_additionalSupportedImageTypes WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setUndoManagerAPIEnabled:) BOOL _undoManagerAPIEnabled WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
@property (nonatomic, setter=_setShouldRelaxThirdPartyCookieBlocking:) BOOL _shouldRelaxThirdPartyCookieBlocking WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
@property (nonatomic, setter=_setProcessDisplayName:) NSString *_processDisplayName WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setAppHighlightsEnabled:) BOOL _appHighlightsEnabled WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setAllowTestOnlyIPC:) BOOL _allowTestOnlyIPC WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
|
||||||
|
|
||||||
|
// The maximum Lab color difference allowed between two consecutive page top snapshots.
|
||||||
|
// Expects 0 (disables page top color sampling entirely) or any positive number.
|
||||||
|
@property (nonatomic, setter=_setSampledPageTopColorMaxDifference:) double _sampledPageTopColorMaxDifference WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
// How far down the page the sampled page top color needs to extend in order to be considered valid.
|
||||||
|
// Expects 0 (the color doesn't need to continue into the page at all) or any positive number.
|
||||||
|
@property (nonatomic, setter=_setSampledPageTopColorMinHeight:) double _sampledPageTopColorMinHeight WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
// Attributes network activity from this WKWebView to the app with this bundle.
|
||||||
|
@property (nonatomic, setter=_setAttributedBundleIdentifier:) NSString *_attributedBundleIdentifier;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setContentSecurityPolicyModeForExtension:) _WKContentSecurityPolicyModeForExtension _contentSecurityPolicyModeForExtension WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setMarkedTextInputEnabled:) BOOL _markedTextInputEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
|
||||||
|
@end
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
|
||||||
|
@interface WKWebViewConfiguration (WKPrivateDeprecated)
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setTextInteractionGesturesEnabled:) BOOL _textInteractionGesturesEnabled WK_API_DEPRECATED_WITH_REPLACEMENT("WKPreferences.textInteractionGesturesEnabled", ios(12.0, 15.0));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif
|
||||||
770
WebKit Headers/WebKit/WKWebViewPrivate.h
Normal file
770
WebKit Headers/WebKit/WKWebViewPrivate.h
Normal file
@@ -0,0 +1,770 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014-2020 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
#if __has_include(<UIKit/_UIFindInteraction.h>)
|
||||||
|
#import <UIKit/_UIFindInteraction.h>
|
||||||
|
#endif
|
||||||
|
#if __has_include(<UIKit/_UITextSearching.h>)
|
||||||
|
#import <UIKit/_UITextSearching.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#import <WebKit/WKDataDetectorTypes.h>
|
||||||
|
#import <WebKit/WKWebView.h>
|
||||||
|
#import <WebKit/_WKActivatedElementInfo.h>
|
||||||
|
#import <WebKit/_WKAttachment.h>
|
||||||
|
#import <WebKit/_WKFindOptions.h>
|
||||||
|
#import <WebKit/_WKLayoutMode.h>
|
||||||
|
#import <WebKit/_WKOverlayScrollbarStyle.h>
|
||||||
|
#import <WebKit/_WKRenderingProgressEvents.h>
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, _WKPaginationMode) {
|
||||||
|
_WKPaginationModeUnpaginated,
|
||||||
|
_WKPaginationModeLeftToRight,
|
||||||
|
_WKPaginationModeRightToLeft,
|
||||||
|
_WKPaginationModeTopToBottom,
|
||||||
|
_WKPaginationModeBottomToTop,
|
||||||
|
} WK_API_AVAILABLE(macos(10.10), ios(8.0));
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKMediaCaptureStateDeprecated) {
|
||||||
|
_WKMediaCaptureStateDeprecatedNone = 0,
|
||||||
|
_WKMediaCaptureStateDeprecatedActiveMicrophone = 1 << 0,
|
||||||
|
_WKMediaCaptureStateDeprecatedActiveCamera = 1 << 1,
|
||||||
|
_WKMediaCaptureStateDeprecatedMutedMicrophone = 1 << 2,
|
||||||
|
_WKMediaCaptureStateDeprecatedMutedCamera = 1 << 3,
|
||||||
|
} WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKMediaMutedState) {
|
||||||
|
_WKMediaNoneMuted = 0,
|
||||||
|
_WKMediaAudioMuted = 1 << 0,
|
||||||
|
_WKMediaCaptureDevicesMuted = 1 << 1,
|
||||||
|
_WKMediaScreenCaptureMuted = 1 << 2,
|
||||||
|
} WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKCaptureDevices) {
|
||||||
|
_WKCaptureDeviceMicrophone = 1 << 0,
|
||||||
|
_WKCaptureDeviceCamera = 1 << 1,
|
||||||
|
_WKCaptureDeviceDisplay = 1 << 2,
|
||||||
|
} WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKSelectionAttributes) {
|
||||||
|
_WKSelectionAttributeNoSelection = 0,
|
||||||
|
_WKSelectionAttributeIsCaret = 1 << 0,
|
||||||
|
_WKSelectionAttributeIsRange = 1 << 1,
|
||||||
|
} WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, _WKShouldOpenExternalURLsPolicy) {
|
||||||
|
_WKShouldOpenExternalURLsPolicyNotAllow,
|
||||||
|
_WKShouldOpenExternalURLsPolicyAllow,
|
||||||
|
_WKShouldOpenExternalURLsPolicyAllowExternalSchemesButNotAppLinks,
|
||||||
|
} WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, _WKDragInteractionPolicy) {
|
||||||
|
_WKDragInteractionPolicyDefault = 0,
|
||||||
|
_WKDragInteractionPolicyAlwaysEnable,
|
||||||
|
_WKDragInteractionPolicyAlwaysDisable
|
||||||
|
} WK_API_AVAILABLE(ios(11.0));
|
||||||
|
|
||||||
|
#else
|
||||||
|
#import <WebKit/WKBase.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !TARGET_OS_IPHONE
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, _WKImmediateActionType) {
|
||||||
|
_WKImmediateActionNone,
|
||||||
|
_WKImmediateActionLinkPreview,
|
||||||
|
_WKImmediateActionDataDetectedItem,
|
||||||
|
_WKImmediateActionLookupText,
|
||||||
|
_WKImmediateActionMailtoLink,
|
||||||
|
_WKImmediateActionTelLink
|
||||||
|
} WK_API_AVAILABLE(macos(10.12));
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKRectEdge) {
|
||||||
|
_WKRectEdgeNone = 0,
|
||||||
|
_WKRectEdgeLeft = 1 << CGRectMinXEdge,
|
||||||
|
_WKRectEdgeTop = 1 << CGRectMinYEdge,
|
||||||
|
_WKRectEdgeRight = 1 << CGRectMaxXEdge,
|
||||||
|
_WKRectEdgeBottom = 1 << CGRectMaxYEdge,
|
||||||
|
_WKRectEdgeAll = _WKRectEdgeLeft | _WKRectEdgeTop | _WKRectEdgeRight | _WKRectEdgeBottom,
|
||||||
|
} WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@class UIEventAttribution;
|
||||||
|
@class UITextInputTraits;
|
||||||
|
@class WKBrowsingContextHandle;
|
||||||
|
@class WKDownload;
|
||||||
|
@class WKFrameInfo;
|
||||||
|
@class WKSecurityOrigin;
|
||||||
|
@class WKWebpagePreferences;
|
||||||
|
@class _UIFindInteraction;
|
||||||
|
@class _WKApplicationManifest;
|
||||||
|
@class _WKDataTask;
|
||||||
|
@class _WKFrameHandle;
|
||||||
|
@class _WKFrameTreeNode;
|
||||||
|
@class _WKHitTestResult;
|
||||||
|
@class _WKInspector;
|
||||||
|
@class _WKRemoteObjectRegistry;
|
||||||
|
@class _WKSafeBrowsingWarning;
|
||||||
|
@class _WKSessionState;
|
||||||
|
@class _WKTextInputContext;
|
||||||
|
@class _WKTextManipulationConfiguration;
|
||||||
|
@class _WKTextManipulationItem;
|
||||||
|
@class _WKThumbnailView;
|
||||||
|
@class _WKWebViewPrintFormatter;
|
||||||
|
|
||||||
|
@protocol WKHistoryDelegatePrivate;
|
||||||
|
@protocol _WKAppHighlightDelegate;
|
||||||
|
@protocol _WKDiagnosticLoggingDelegate;
|
||||||
|
@protocol _WKFindDelegate;
|
||||||
|
@protocol _WKFullscreenDelegate;
|
||||||
|
@protocol _WKIconLoadingDelegate;
|
||||||
|
@protocol _WKInputDelegate;
|
||||||
|
@protocol _WKResourceLoadDelegate;
|
||||||
|
@protocol _WKTextManipulationDelegate;
|
||||||
|
|
||||||
|
@interface WKWebView (WKPrivate)
|
||||||
|
|
||||||
|
// FIXME: This should return a _WKRemoteObjectRegistry *.
|
||||||
|
@property (nonatomic, readonly) id _remoteObjectRegistry;
|
||||||
|
@property (nonatomic, readonly) WKBrowsingContextHandle *_handle;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setObservedRenderingProgressEvents:) _WKRenderingProgressEvents _observedRenderingProgressEvents;
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setHistoryDelegate:) id <WKHistoryDelegatePrivate> _historyDelegate;
|
||||||
|
@property (nonatomic, weak, setter=_setIconLoadingDelegate:) id <_WKIconLoadingDelegate> _iconLoadingDelegate;
|
||||||
|
@property (nonatomic, weak, setter=_setResourceLoadDelegate:) id <_WKResourceLoadDelegate> _resourceLoadDelegate WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSURL *_unreachableURL;
|
||||||
|
@property (nonatomic, readonly) NSURL *_mainFrameURL WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
@property (nonatomic, readonly) NSURL *_resourceDirectoryURL WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
|
||||||
|
- (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL;
|
||||||
|
- (WKNavigation *)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType characterEncodingName:(NSString *)characterEncodingName baseURL:(NSURL *)baseURL userData:(id)userData WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLs:(BOOL)shouldOpenExternalURLs WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
- (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLsPolicy:(_WKShouldOpenExternalURLsPolicy)shouldOpenExternalURLsPolicy WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSArray *_certificateChain WK_API_DEPRECATED_WITH_REPLACEMENT("certificateChain", macos(10.10, 10.11), ios(8.0, 9.0));
|
||||||
|
@property (nonatomic, readonly) NSURL *_committedURL;
|
||||||
|
@property (nonatomic, readonly) NSString *_MIMEType;
|
||||||
|
@property (nonatomic, readonly) NSString *_userAgent WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
@property (copy, setter=_setApplicationNameForUserAgent:) NSString *_applicationNameForUserAgent;
|
||||||
|
@property (copy, setter=_setCustomUserAgent:) NSString *_customUserAgent;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, getter=_isPlayingAudio) BOOL _playingAudio WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
|
||||||
|
@property (nonatomic, setter=_setUserContentExtensionsEnabled:) BOOL _userContentExtensionsEnabled WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) pid_t _webProcessIdentifier;
|
||||||
|
@property (nonatomic, readonly) pid_t _provisionalWebProcessIdentifier WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
@property (nonatomic, readonly) pid_t _gpuProcessIdentifier WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
@property (nonatomic, getter=_isEditable, setter=_setEditable:) BOOL _editable WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
|
||||||
|
/*! @abstract A Boolean value indicating whether any resource on the page
|
||||||
|
has been loaded over a connection using TLS 1.0 or TLS 1.1.
|
||||||
|
@discussion @link WKWebView @/link is key-value observing (KVO) compliant
|
||||||
|
for this property.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly) BOOL _negotiatedLegacyTLS WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL _wasPrivateRelayed WK_API_AVAILABLE(macos(13.1), ios(16.2));
|
||||||
|
|
||||||
|
- (void)_frames:(void (^)(_WKFrameTreeNode *))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
// FIXME: Remove these once nobody is using them.
|
||||||
|
@property (nonatomic, readonly) NSData *_sessionStateData;
|
||||||
|
- (void)_restoreFromSessionStateData:(NSData *)sessionStateData;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKSessionState *_sessionState;
|
||||||
|
- (WKNavigation *)_restoreSessionState:(_WKSessionState *)sessionState andNavigate:(BOOL)navigate;
|
||||||
|
- (_WKSessionState *)_sessionStateWithFilter:(BOOL (^)(WKBackForwardListItem *item))filter;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setAllowsRemoteInspection:) BOOL _allowsRemoteInspection WK_API_DEPRECATED_WITH_REPLACEMENT("inspectable", macos(10.10, 13.3), ios(8.0, 16.4));
|
||||||
|
@property (nonatomic, copy, setter=_setRemoteInspectionNameOverride:) NSString *_remoteInspectionNameOverride WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, readonly) BOOL _isBeingInspected WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
@property (nonatomic, readonly) _WKInspector *_inspector WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKFrameHandle *_mainFrame WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setTextManipulationDelegate:) id <_WKTextManipulationDelegate> _textManipulationDelegate WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (void)_startTextManipulationsWithConfiguration:(_WKTextManipulationConfiguration *)configuration completion:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (void)_completeTextManipulation:(_WKTextManipulationItem *)item completion:(void(^)(BOOL success))completionHandler WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (void)_completeTextManipulationForItems:(NSArray<_WKTextManipulationItem *> *)items completion:(void(^)(NSArray<NSError *> *errors))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setAddsVisitedLinks:) BOOL _addsVisitedLinks;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL _networkRequestsInProgress;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, getter=_isShowingNavigationGestureSnapshot) BOOL _showingNavigationGestureSnapshot;
|
||||||
|
|
||||||
|
- (void)_close;
|
||||||
|
- (BOOL)_tryClose WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (BOOL)_isClosed WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
|
||||||
|
- (void)_updateWebpagePreferences:(WKWebpagePreferences *)webpagePreferences WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (void)_notifyUserScripts WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
@property (nonatomic, readonly) BOOL _deferrableUserScriptsNeedNotification WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
- (void)_evaluateJavaScriptWithoutUserGesture:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *))completionHandler WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
- (void)_evaluateJavaScript:(NSString *)javaScriptString inFrame:(WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^)(id, NSError * error))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
- (void)_evaluateJavaScript:(NSString *)javaScriptString withSourceURL:(NSURL *)sourceURL inFrame:(WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^)(id, NSError * error))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
- (void)_callAsyncJavaScript:(NSString *)functionBody arguments:(NSDictionary<NSString *, id> *)arguments inFrame:(WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^)(id, NSError *error))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
- (BOOL)_allMediaPresentationsClosed WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setLayoutMode:) _WKLayoutMode _layoutMode;
|
||||||
|
// For use with _layoutMode = _WKLayoutModeFixedSize:
|
||||||
|
@property (nonatomic, setter=_setFixedLayoutSize:) CGSize _fixedLayoutSize;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setViewportSizeForCSSViewportUnits:) CGSize _viewportSizeForCSSViewportUnits WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setViewScale:) CGFloat _viewScale WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setMinimumEffectiveDeviceWidth:) CGFloat _minimumEffectiveDeviceWidth WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage WK_API_AVAILABLE(macos(10.13.4), ios(8.0));
|
||||||
|
|
||||||
|
- (_WKAttachment *)_insertAttachmentWithFilename:(NSString *)filename contentType:(NSString *)contentType data:(NSData *)data options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_insertAttachmentWithFileWrapper:contentType:options:completion:", macos(10.13.4, 10.14.4), ios(11.3, 12.2));
|
||||||
|
- (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_insertAttachmentWithFileWrapper:contentType:completion:", macos(10.14.4, 10.14.4), ios(12.2, 12.2));
|
||||||
|
- (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType completion:(void(^)(BOOL success))completionHandler WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (_WKAttachment *)_attachmentForIdentifier:(NSString *)identifier WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
- (void)_simulateDeviceOrientationChangeWithAlpha:(double)alpha beta:(double)beta gamma:(double)gamma WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
+ (BOOL)_willUpgradeToHTTPS:(NSURL *)url WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
+ (BOOL)_handlesSafeBrowsing WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
+ (NSURL *)_confirmMalwareSentinel WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
+ (NSURL *)_visitUnsafeWebsiteSentinel WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (void)_showSafeBrowsingWarningWithTitle:(NSString *)title warning:(NSString *)warning details:(NSAttributedString *)details completionHandler:(void(^)(BOOL))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_showSafeBrowsingWarningWithURL:title:warning:detailsWithLinks:completionHandler:", macos(10.14.4, 10.15.4), ios(12.2, 13.2));
|
||||||
|
- (void)_showSafeBrowsingWarningWithURL:(NSURL *)url title:(NSString *)title warning:(NSString *)warning details:(NSAttributedString *)details completionHandler:(void(^)(BOOL))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_showSafeBrowsingWarningWithURL:title:warning:detailsWithLinks:completionHandler:", macos(10.14.4, 10.15.4), ios(12.2, 13.2));
|
||||||
|
- (void)_showSafeBrowsingWarningWithURL:(NSURL *)url title:(NSString *)title warning:(NSString *)warning detailsWithLinks:(NSAttributedString *)details completionHandler:(void(^)(BOOL, NSURL *))completionHandler WK_API_AVAILABLE(macos(10.15.4), ios(13.2));
|
||||||
|
|
||||||
|
- (void)_doAfterNextPresentationUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_doAfterNextPresentationUpdateWithoutWaitingForPainting:(void (^)(void))updateBlock WK_API_AVAILABLE(macos(10.12.3), ios(10.3));
|
||||||
|
|
||||||
|
- (void)_doAfterNextVisibleContentRectUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
- (void)_executeEditCommand:(NSString *)command argument:(NSString *)argument completion:(void (^)(BOOL))completion WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
|
||||||
|
|
||||||
|
- (void)_isJITEnabled:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (void)_removeDataDetectedLinks:(dispatch_block_t)completion WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
- (IBAction)_alignCenter:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_alignJustified:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_alignLeft:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_alignRight:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_indent:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_outdent:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_toggleStrikeThrough:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_insertOrderedList:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_insertUnorderedList:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_insertNestedOrderedList:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_insertNestedUnorderedList:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_increaseListLevel:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_decreaseListLevel:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_changeListType:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_pasteAsQuotation:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_pasteAndMatchStyle:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
- (IBAction)_takeFindStringFromSelection:(id)sender WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
@property (class, nonatomic, copy, setter=_setStringForFind:) NSString *_stringForFind WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
@property (nonatomic, readonly) _WKSelectionAttributes _selectionAttributes WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
|
||||||
|
- (WKNavigation *)_reloadWithoutContentBlockers WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (WKNavigation *)_reloadExpiredOnly WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL _webProcessIsResponsive WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
- (void)_killWebContentProcess;
|
||||||
|
- (void)_killWebContentProcessAndResetState;
|
||||||
|
|
||||||
|
- (void)_getMainResourceDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
|
||||||
|
- (void)_getWebArchiveDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
|
||||||
|
- (void)_getContentsAsStringWithCompletionHandler:(void (^)(NSString *, NSError *))completionHandler WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
- (void)_getContentsAsStringWithCompletionHandlerKeepIPCConnectionAliveForTesting:(void (^)(NSString *, NSError *))completionHandler;
|
||||||
|
- (void)_getContentsOfAllFramesAsStringWithCompletionHandler:(void (^)(NSString *))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
- (void)_getContentsAsAttributedStringWithCompletionHandler:(void (^)(NSAttributedString *, NSDictionary<NSAttributedStringDocumentAttributeKey, id> *, NSError *))completionHandler WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
|
||||||
|
- (void)_getApplicationManifestWithCompletionHandler:(void (^)(_WKApplicationManifest *))completionHandler WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
|
||||||
|
|
||||||
|
- (void)_getTextFragmentMatchWithCompletionHandler:(void (^)(NSString *))completionHandler WK_API_AVAILABLE(macos(13.3), ios(16.4));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setPaginationMode:) _WKPaginationMode _paginationMode;
|
||||||
|
// Whether the column-break-{before,after} properties are respected instead of the
|
||||||
|
// page-break-{before,after} properties.
|
||||||
|
@property (nonatomic, setter=_setPaginationBehavesLikeColumns:) BOOL _paginationBehavesLikeColumns;
|
||||||
|
// Set to 0 to have the page length equal the view length.
|
||||||
|
@property (nonatomic, setter=_setPageLength:) CGFloat _pageLength;
|
||||||
|
@property (nonatomic, setter=_setGapBetweenPages:) CGFloat _gapBetweenPages;
|
||||||
|
@property (nonatomic, setter=_setPaginationLineGridEnabled:) BOOL _paginationLineGridEnabled;
|
||||||
|
@property (readonly) NSUInteger _pageCount;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL _supportsTextZoom;
|
||||||
|
@property (nonatomic, setter=_setTextZoomFactor:) double _textZoomFactor;
|
||||||
|
@property (nonatomic, setter=_setPageZoomFactor:) double _pageZoomFactor;
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setDiagnosticLoggingDelegate:) id <_WKDiagnosticLoggingDelegate> _diagnosticLoggingDelegate WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
@property (nonatomic, weak, setter=_setFindDelegate:) id <_WKFindDelegate> _findDelegate;
|
||||||
|
- (void)_findString:(NSString *)string options:(_WKFindOptions)options maxCount:(NSUInteger)maxCount;
|
||||||
|
- (void)_countStringMatches:(NSString *)string options:(_WKFindOptions)options maxCount:(NSUInteger)maxCount;
|
||||||
|
- (void)_hideFindUI;
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setInputDelegate:) id <_WKInputDelegate> _inputDelegate WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, getter=_isDisplayingStandaloneImageDocument) BOOL _displayingStandaloneImageDocument;
|
||||||
|
@property (nonatomic, readonly, getter=_isDisplayingStandaloneMediaDocument) BOOL _displayingStandaloneMediaDocument;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setScrollPerformanceDataCollectionEnabled:) BOOL _scrollPerformanceDataCollectionEnabled WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
@property (nonatomic, readonly) NSArray *_scrollPerformanceData WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
|
||||||
|
- (void)_saveBackForwardSnapshotForItem:(WKBackForwardListItem *)item WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
|
||||||
|
@property (nonatomic, getter=_allowsMediaDocumentInlinePlayback, setter=_setAllowsMediaDocumentInlinePlayback:) BOOL _allowsMediaDocumentInlinePlayback;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setFullscreenDelegate:) id<_WKFullscreenDelegate> _fullscreenDelegate WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
@property (nonatomic, readonly) BOOL _isInFullscreen WK_API_AVAILABLE(macos(10.12.3));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKMediaCaptureStateDeprecated _mediaCaptureState WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
@property (nonatomic, readonly) _WKMediaMutedState _mediaMutedState WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
- (void)_setPageMuted:(_WKMediaMutedState)mutedState WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setMediaCaptureEnabled:) BOOL _mediaCaptureEnabled WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
- (void)_stopMediaCapture WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL _canTogglePictureInPicture;
|
||||||
|
@property (nonatomic, readonly) BOOL _isPictureInPictureActive;
|
||||||
|
- (void)_updateMediaPlaybackControlsManager;
|
||||||
|
- (void)_togglePictureInPicture;
|
||||||
|
- (void)_stopAllMediaPlayback;
|
||||||
|
- (void)_suspendAllMediaPlayback;
|
||||||
|
- (void)_resumeAllMediaPlayback;
|
||||||
|
- (void)_closeAllMediaPresentations;
|
||||||
|
|
||||||
|
- (void)_takePDFSnapshotWithConfiguration:(WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSData *pdfSnapshotData, NSError *error))completionHandler WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
- (void)_getPDFFirstPageSizeInFrame:(_WKFrameHandle *)frame completionHandler:(void(^)(CGSize))completionHandler WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
- (void)_getProcessDisplayNameWithCompletionHandler:(void (^)(NSString *))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
- (void)_serviceWorkersEnabled:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
- (void)_clearServiceWorkerEntitlementOverride:(void (^)(void))completionHandler WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
- (void)_preconnectToServer:(NSURL *)serverURL WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setCanUseCredentialStorage:) BOOL _canUseCredentialStorage WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
- (void)_didEnableBrowserExtensions:(NSDictionary<NSString *, NSString *> *)extensionIDToNameMap WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_didDisableBrowserExtensions:(NSSet<NSString *> *)extensionIDs WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
@property (nonatomic, weak, setter=_setAppHighlightDelegate:) id <_WKAppHighlightDelegate> _appHighlightDelegate WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_restoreAppHighlights:(NSArray<NSData *> *)highlights WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_restoreAndScrollToAppHighlight:(NSData *)highlight WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_addAppHighlight WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_addAppHighlightInNewGroup:(BOOL)newGroup originatedInApp:(BOOL)originatedInApp WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
// FIXME: Remove old `-[WKWebView _themeColor]` SPI <rdar://76662644>
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@property (nonatomic, readonly) UIColor *_themeColor WK_API_DEPRECATED_WITH_REPLACEMENT("themeColor", ios(15.0, 15.0));
|
||||||
|
#else
|
||||||
|
@property (nonatomic, readonly) NSColor *_themeColor WK_API_DEPRECATED_WITH_REPLACEMENT("themeColor", macos(12.0, 12.0));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// FIXME: Remove old `-[WKWebView _pageExtendedBackgroundColor]` SPI <rdar://77789732>
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@property (nonatomic, readonly) UIColor *_pageExtendedBackgroundColor WK_API_DEPRECATED_WITH_REPLACEMENT("underPageBackgroundColor", ios(15.0, 15.0));
|
||||||
|
#else
|
||||||
|
@property (nonatomic, readonly) NSColor *_pageExtendedBackgroundColor WK_API_DEPRECATED_WITH_REPLACEMENT("underPageBackgroundColor", macos(10.10, 12.0));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Only set if `-[WKWebViewConfiguration _sampledPageTopColorMaxDifference]` is a positive number.
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@property (nonatomic, readonly) UIColor *_sampledPageTopColor WK_API_AVAILABLE(ios(15.0));
|
||||||
|
#else
|
||||||
|
@property (nonatomic, readonly) NSColor *_sampledPageTopColor WK_API_AVAILABLE(macos(12.0));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- (void)_grantAccessToAssetServices WK_API_AVAILABLE(macos(12.0), ios(14.0));
|
||||||
|
- (void)_revokeAccessToAssetServices WK_API_AVAILABLE(macos(12.0), ios(14.0));
|
||||||
|
|
||||||
|
- (void)_disableURLSchemeCheckInDataDetectors WK_API_AVAILABLE(ios(16.0));
|
||||||
|
|
||||||
|
/*! @abstract If the WKWebView was created with _shouldAllowUserInstalledFonts = NO,
|
||||||
|
the web process will automatically use an in-process font registry, and its sandbox
|
||||||
|
will be restricted to forbid access to fontd. Otherwise, the web process will use
|
||||||
|
fontd to look up fonts instead of using the in-process registry, and the web
|
||||||
|
process's sandbox will automatically be extended to allow access to fontd. This
|
||||||
|
method represents a one-time, web-process-wide switch from using the in-process
|
||||||
|
font registry to using fontd, including granting the relevant sandbox extension.
|
||||||
|
*/
|
||||||
|
- (void)_switchFromStaticFontRegistryToUserFontRegistry WK_API_AVAILABLE(macos(12.0));
|
||||||
|
|
||||||
|
- (void)_didLoadAppInitiatedRequest:(void (^)(BOOL result))completionHandler;
|
||||||
|
- (void)_didLoadNonAppInitiatedRequest:(void (^)(BOOL result))completionHandler;
|
||||||
|
|
||||||
|
- (void)_loadServiceWorker:(NSURL *)url usingModules:(BOOL)usingModules completionHandler:(void (^)(BOOL success))completionHandler WK_API_AVAILABLE(macos(13.3), ios(16.4));
|
||||||
|
- (void)_loadServiceWorker:(NSURL *)url completionHandler:(void (^)(BOOL success))completionHandler WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
- (void)_suspendPage:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
- (void)_resumePage:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
- (void)_startImageAnalysis:(NSString *)identifier target:(NSString *)targetIdentifier WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
- (void)_dataTaskWithRequest:(NSURLRequest *)request completionHandler:(void(^)(_WKDataTask *))completionHandler WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
// Default value is 0. A value of 0 means the window's backing scale factor will be used and automatically update when the window moves screens.
|
||||||
|
@property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_API_AVAILABLE(macos(10.11), ios(16.4));
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, WKDisplayCaptureState) {
|
||||||
|
WKDisplayCaptureStateNone,
|
||||||
|
WKDisplayCaptureStateActive,
|
||||||
|
WKDisplayCaptureStateMuted,
|
||||||
|
} WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, WKSystemAudioCaptureState) {
|
||||||
|
WKSystemAudioCaptureStateNone,
|
||||||
|
WKSystemAudioCaptureStateActive,
|
||||||
|
WKSystemAudioCaptureStateMuted,
|
||||||
|
} WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, WKDisplayCaptureSurfaces) {
|
||||||
|
WKDisplayCaptureSurfaceNone = 0,
|
||||||
|
WKDisplayCaptureSurfaceScreen = 0x1,
|
||||||
|
WKDisplayCaptureSurfaceWindow = 0x2,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! @abstract The type(s) of displays being captured on a web page.
|
||||||
|
@discussion @link WKWebView @/link is key-value observing (KVO) compliant
|
||||||
|
for this property.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly) WKDisplayCaptureSurfaces _displayCaptureSurfaces WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
/*! @abstract The state of display capture on a web page.
|
||||||
|
@discussion @link WKWebView @/link is key-value observing (KVO) compliant
|
||||||
|
for this property.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly) WKDisplayCaptureState _displayCaptureState WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
/*! @abstract The state of system audio capture on a web page.
|
||||||
|
@discussion @link WKWebView @/link is key-value observing (KVO) compliant
|
||||||
|
for this property.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly) WKSystemAudioCaptureState _systemAudioCaptureState WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
/*! @abstract Set display capture state of a WKWebView.
|
||||||
|
@param state State to apply for capture.
|
||||||
|
@param completionHandler A block to invoke after the screen state has been changed.
|
||||||
|
@discussion
|
||||||
|
If value is WKDisplayCaptureStateNone, this will stop all display capture.
|
||||||
|
If value is WKDisplayCaptureStateMuted, all active display captures will become muted.
|
||||||
|
If value is WKDisplayCaptureStateActive, all muted display captures will become active.
|
||||||
|
*/
|
||||||
|
- (void)_setDisplayCaptureState:(WKDisplayCaptureState)state completionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
/*! @abstract Set system audio capture state of a WKWebView.
|
||||||
|
@param state State to apply for system audio capture.
|
||||||
|
@param completionHandler A block to invoke after the system audio state has been changed.
|
||||||
|
@discussion
|
||||||
|
If value is WKSystemAudioCaptureStateNone, this will stop any system audio capture.
|
||||||
|
If value is WKSystemAudioCaptureStateMuted, any active system audio capture will become muted.
|
||||||
|
If value is WKSystemAudioCaptureStateActive, any muted system audio capture will become active.
|
||||||
|
@note When system audio capture is active, if screenCaptureState is active, all system audio will be captured.
|
||||||
|
Otherwise, if windowCaptureState is active, only the application whose window being is captured will have its audio captured.
|
||||||
|
If both screenCaptureState and windowCaptureState are None or Muted, no system audio will be captured.
|
||||||
|
*/
|
||||||
|
- (void)_setSystemAudioCaptureState:(WKSystemAudioCaptureState)state completionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
+ (void)_permissionChanged:(NSString *)permissionName forOrigin:(WKSecurityOrigin *)origin WK_API_AVAILABLE(macos(13.3), ios(16.4));
|
||||||
|
|
||||||
|
/*! @abstract `YES` if any animation on the page is allowed to play.
|
||||||
|
@discussion Animations can be disallowed from starting both individually and globally. If even a single animation is allowed to play, this property will be `YES`. Calling @link _pauseAllAnimationsWithCompletionHandler @/link causes this property to become `NO`, while @link _playAllAnimationsWithCompletionHandler @/link causes it to become `YES`.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly) BOOL _allowsAnyAnimationToPlay WK_API_AVAILABLE(macos(13.3), ios(16.4));
|
||||||
|
|
||||||
|
/*! @abstract Pauses all animations on the page.
|
||||||
|
@discussion Calling this function also results in @link _allowsAnyAnimationToPlay @/link becoming `NO`, meaning animations loaded after a call to this function will be paused until @link _playAllAnimationsWithCompletionHandler @/link is called.
|
||||||
|
*/
|
||||||
|
- (void)_pauseAllAnimationsWithCompletionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(13.3), ios(16.4));
|
||||||
|
|
||||||
|
/*! @abstract Plays all animations on the page.
|
||||||
|
@discussion Calling this function also results in @link _allowsAnyAnimationToPlay @/link becoming `YES`, meaning animations loaded after a call to this function will be allowed to begin playing.
|
||||||
|
*/
|
||||||
|
- (void)_playAllAnimationsWithCompletionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(13.3), ios(16.4));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
|
||||||
|
#if !TARGET_OS_TV && !TARGET_OS_WATCH && __has_include(<UIKit/_UITextSearching.h>)
|
||||||
|
@interface WKWebView (WKPrivateIOS) <_UITextSearching, UITextSearching, UIFindInteractionDelegate>
|
||||||
|
#elif TARGET_OS_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= 160000
|
||||||
|
@interface WKWebView (WKPrivateIOS) <UITextSearching, UIFindInteractionDelegate>
|
||||||
|
#else
|
||||||
|
@interface WKWebView (WKPrivateIOS)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !TARGET_OS_TV && !TARGET_OS_WATCH
|
||||||
|
@property (nonatomic, copy, setter=_setUIEventAttribution:) UIEventAttribution *_uiEventAttribution WK_API_AVAILABLE(ios(15.0));
|
||||||
|
@property (nonatomic, copy, setter=_setEphemeralUIEventAttribution:) UIEventAttribution *_ephemeralUIEventAttribution WK_API_AVAILABLE(ios(16.0));
|
||||||
|
- (void)_setEphemeralUIEventAttribution:(UIEventAttribution *)attribution forApplicationWithBundleID:(NSString *)bundleID WK_API_AVAILABLE(ios(16.0));
|
||||||
|
|
||||||
|
#if TARGET_OS_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= 160000
|
||||||
|
@property (nonatomic, readonly) _UIFindInteraction *_findInteraction WK_API_AVAILABLE(ios(16.0));
|
||||||
|
@property (nonatomic, readwrite, setter=_setFindInteractionEnabled:) BOOL _findInteractionEnabled WK_API_AVAILABLE(ios(16.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) CALayer *_layerForFindOverlay WK_API_AVAILABLE(ios(16.0));
|
||||||
|
|
||||||
|
- (void)_requestRectForFoundTextRange:(UITextRange *)ranges completionHandler:(void (^)(CGRect))completionHandler WK_API_AVAILABLE(ios(16.0));
|
||||||
|
|
||||||
|
- (void)_addLayerForFindOverlay WK_API_AVAILABLE(ios(16.0));
|
||||||
|
- (void)_removeLayerForFindOverlay WK_API_AVAILABLE(ios(16.0));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) CGRect _contentVisibleRect WK_API_AVAILABLE(ios(10.0));
|
||||||
|
|
||||||
|
// DERECATED: The setters of the three following function are deprecated, please use overrideLayoutParameters.
|
||||||
|
// Define the smallest size a page take with a regular viewport.
|
||||||
|
@property (nonatomic, readonly) CGSize _minimumLayoutSizeOverride;
|
||||||
|
// Define the largest size the unobscured area can get for the current view bounds. This value is used to define viewport units.
|
||||||
|
@property (nonatomic, readonly) CGSize _maximumUnobscuredSizeOverride;
|
||||||
|
|
||||||
|
// Define the inset of the scrollview unusable by the web page.
|
||||||
|
@property (nonatomic, setter=_setObscuredInsets:) UIEdgeInsets _obscuredInsets;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setUnobscuredSafeAreaInsets:) UIEdgeInsets _unobscuredSafeAreaInsets WK_API_AVAILABLE(ios(11.0));
|
||||||
|
@property (nonatomic, readonly) BOOL _safeAreaShouldAffectObscuredInsets WK_API_AVAILABLE(ios(11.0));
|
||||||
|
@property (nonatomic, setter=_setObscuredInsetEdgesAffectedBySafeArea:) UIRectEdge _obscuredInsetEdgesAffectedBySafeArea WK_API_AVAILABLE(ios(11.0));
|
||||||
|
|
||||||
|
// An ancestor view whose bounds will be intersected with those of this WKWebView to determine the visible region of content to render.
|
||||||
|
@property (nonatomic, readonly) UIView *_enclosingViewForExposedRectComputation WK_API_AVAILABLE(ios(11.0));
|
||||||
|
|
||||||
|
// Override the interface orientation. Clients using _beginAnimatedResizeWithUpdates: must update the interface orientation
|
||||||
|
// in the update block.
|
||||||
|
@property (nonatomic, setter=_setInterfaceOrientationOverride:) UIInterfaceOrientation _interfaceOrientationOverride;
|
||||||
|
- (void)_clearInterfaceOrientationOverride WK_API_AVAILABLE(ios(11.0));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setAllowsViewportShrinkToFit:) BOOL _allowsViewportShrinkToFit;
|
||||||
|
|
||||||
|
// FIXME: Remove these three properties once we expose WKWebViewContentProvider as API.
|
||||||
|
@property (nonatomic, readonly, getter=_isDisplayingPDF) BOOL _displayingPDF;
|
||||||
|
@property (nonatomic, readonly) NSData *_dataForDisplayedPDF;
|
||||||
|
// FIXME: This can be removed once WKNavigation's response property is implemented.
|
||||||
|
@property (nonatomic, readonly) NSString *_suggestedFilenameForDisplayedPDF;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKWebViewPrintFormatter *_webViewPrintFormatter;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setDragInteractionPolicy:) _WKDragInteractionPolicy _dragInteractionPolicy WK_API_AVAILABLE(ios(11.0));
|
||||||
|
@property (nonatomic, readonly) BOOL _shouldAvoidResizingWhenInputViewBoundsChange WK_API_AVAILABLE(ios(13.0));
|
||||||
|
@property (nonatomic, readonly) BOOL _contentViewIsFirstResponder WK_API_AVAILABLE(ios(12.2));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) CGRect _uiTextCaretRect WK_API_AVAILABLE(ios(10.3));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) UIView *_safeBrowsingWarning WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
- (CGPoint)_convertPointFromContentsToView:(CGPoint)point WK_API_AVAILABLE(ios(10.0));
|
||||||
|
- (CGPoint)_convertPointFromViewToContents:(CGPoint)point WK_API_AVAILABLE(ios(10.0));
|
||||||
|
|
||||||
|
- (void)_doAfterNextStablePresentationUpdate:(dispatch_block_t)updateBlock WK_API_AVAILABLE(ios(10.3));
|
||||||
|
|
||||||
|
- (void)_setFont:(UIFont *)font sender:(id)sender WK_API_AVAILABLE(ios(12.2));
|
||||||
|
- (void)_setFontSize:(CGFloat)fontSize sender:(id)sender WK_API_AVAILABLE(ios(12.2));
|
||||||
|
- (void)_setTextColor:(UIColor *)color sender:(id)sender WK_API_AVAILABLE(ios(12.2));
|
||||||
|
|
||||||
|
- (void)_detectDataWithTypes:(WKDataDetectorTypes)types completionHandler:(dispatch_block_t)completion WK_API_AVAILABLE(ios(12.2));
|
||||||
|
|
||||||
|
- (void)_requestActivatedElementAtPosition:(CGPoint)position completionBlock:(void (^)(_WKActivatedElementInfo *))block WK_API_AVAILABLE(ios(11.0));
|
||||||
|
|
||||||
|
- (void)didStartFormControlInteraction WK_API_AVAILABLE(ios(10.3));
|
||||||
|
- (void)didEndFormControlInteraction WK_API_AVAILABLE(ios(10.3));
|
||||||
|
|
||||||
|
- (void)_beginInteractiveObscuredInsetsChange;
|
||||||
|
- (void)_endInteractiveObscuredInsetsChange;
|
||||||
|
- (void)_hideContentUntilNextUpdate;
|
||||||
|
|
||||||
|
- (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock;
|
||||||
|
- (void)_endAnimatedResize;
|
||||||
|
- (void)_resizeWhileHidingContentWithUpdates:(void (^)(void))updateBlock;
|
||||||
|
|
||||||
|
- (void)_snapshotRectAfterScreenUpdates:(BOOL)afterScreenUpdates rectInViewCoordinates:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler WK_API_AVAILABLE(ios(16.0));
|
||||||
|
- (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler;
|
||||||
|
|
||||||
|
- (void)_overrideLayoutParametersWithMinimumLayoutSize:(CGSize)minimumLayoutSize maximumUnobscuredSizeOverride:(CGSize)maximumUnobscuredSizeOverride WK_API_AVAILABLE(ios(9_0));
|
||||||
|
- (void)_clearOverrideLayoutParameters WK_API_AVAILABLE(ios(11.0));
|
||||||
|
- (void)_overrideViewportWithArguments:(NSDictionary<NSString *, NSString *> *)arguments WK_API_AVAILABLE(ios(13.0));
|
||||||
|
|
||||||
|
- (UIView *)_viewForFindUI;
|
||||||
|
|
||||||
|
- (void)_setOverlaidAccessoryViewsInset:(CGSize)inset;
|
||||||
|
|
||||||
|
// Puts the view into a state where being taken out of the view hierarchy and resigning first responder
|
||||||
|
// will not count as becoming inactive and unfocused. The returned block must be called to exit the state.
|
||||||
|
- (void (^)(void))_retainActiveFocusedState WK_API_AVAILABLE(ios(9_0));
|
||||||
|
|
||||||
|
- (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler WK_API_AVAILABLE(ios(9_0));
|
||||||
|
|
||||||
|
- (id)_snapshotLayerContentsForBackForwardListItem:(WKBackForwardListItem *)item WK_API_AVAILABLE(ios(9_0));
|
||||||
|
|
||||||
|
- (NSArray *)_dataDetectionResults;
|
||||||
|
|
||||||
|
- (void)_accessibilityRetrieveRectsAtSelectionOffset:(NSInteger)offset withText:(NSString *)text completionHandler:(void (^)(NSArray<NSValue *> *rects))completionHandler WK_API_AVAILABLE(ios(11.3));
|
||||||
|
- (void)_accessibilityStoreSelection WK_API_AVAILABLE(ios(11.3));
|
||||||
|
- (void)_accessibilityClearSelection WK_API_AVAILABLE(ios(11.3));
|
||||||
|
|
||||||
|
- (void)_accessibilityRetrieveSpeakSelectionContent WK_API_AVAILABLE(ios(11.0));
|
||||||
|
- (void)_accessibilityDidGetSpeakSelectionContent:(NSString *)content WK_API_AVAILABLE(ios(11.0));
|
||||||
|
|
||||||
|
- (UIView *)_fullScreenPlaceholderView WK_API_AVAILABLE(ios(12.0));
|
||||||
|
|
||||||
|
- (void)_willOpenAppLink WK_API_AVAILABLE(ios(14.0));
|
||||||
|
|
||||||
|
- (void)_isNavigatingToAppBoundDomain:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(ios(14.0));
|
||||||
|
- (void)_isForcedIntoAppBoundMode:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(ios(14.0));
|
||||||
|
|
||||||
|
- (UITextInputTraits *)_textInputTraits WK_API_AVAILABLE(ios(16.4));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface WKWebView () <UIResponderStandardEditActions>
|
||||||
|
@end
|
||||||
|
|
||||||
|
#if !TARGET_OS_WATCH
|
||||||
|
|
||||||
|
@interface WKWebView (FullScreenAPI_Private)
|
||||||
|
|
||||||
|
-(BOOL)hasFullScreenWindowController;
|
||||||
|
-(void)closeFullScreenWindowController;
|
||||||
|
|
||||||
|
@end
|
||||||
|
#endif // !TARGET_OS_WATCH
|
||||||
|
|
||||||
|
#endif // TARGET_OS_IPHONE
|
||||||
|
|
||||||
|
|
||||||
|
#if !TARGET_OS_IPHONE
|
||||||
|
|
||||||
|
@interface WKWebView (WKPrivateMac)
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) WKPageRef _pageRefForTransitionToWKWebView WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (nonatomic, readonly) BOOL _hasActiveVideoForControlsManager WK_API_AVAILABLE(macos(10.12));
|
||||||
|
@property (nonatomic, readwrite, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (nonatomic, readwrite, setter=_setIgnoresMouseMoveEvents:) BOOL _ignoresMouseMoveEvents WK_API_AVAILABLE(macos(13.0));
|
||||||
|
|
||||||
|
/*! @abstract A Boolean value indicating whether drawing clips to the visibleRect.
|
||||||
|
@discussion When YES, the view will use its -visibleRect when determining which areas of the WKWebView to draw. This may improve performance for large WKWebViews which are mostly clipped out by enclosing views. The default value is NO.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readwrite, setter=_setClipsToVisibleRect:) BOOL _clipsToVisibleRect WK_API_AVAILABLE(macos(11.0));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSView *_safeBrowsingWarning WK_API_AVAILABLE(macos(10.14.4));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) _WKRectEdge _pinnedState WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (nonatomic, setter=_setRubberBandingEnabled:) _WKRectEdge _rubberBandingEnabled WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setBackgroundColor:) NSColor *_backgroundColor WK_API_AVAILABLE(macos(10.14));
|
||||||
|
@property (nonatomic, copy, setter=_setUnderlayColor:) NSColor *_underlayColor WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setTotalHeightOfBanners:) CGFloat _totalHeightOfBanners WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (nonatomic, setter=_setDrawsBackground:) BOOL _drawsBackground;
|
||||||
|
@property (nonatomic, setter=_setTopContentInset:) CGFloat _topContentInset;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setAutomaticallyAdjustsContentInsets:) BOOL _automaticallyAdjustsContentInsets;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setWindowOcclusionDetectionEnabled:) BOOL _windowOcclusionDetectionEnabled;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSInteger _spellCheckerDocumentTag WK_API_AVAILABLE(macos(10.14));
|
||||||
|
|
||||||
|
// When using _minimumLayoutWidth, the web content will lay out to the intrinsic height
|
||||||
|
// of the content; use this property to force it to lay out to the height of the view instead.
|
||||||
|
@property (nonatomic, setter=_setShouldExpandContentToViewHeightForAutoLayout:) BOOL _shouldExpandContentToViewHeightForAutoLayout WK_API_AVAILABLE(macos(10.12));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setMinimumLayoutWidth:) CGFloat _minimumLayoutWidth WK_API_AVAILABLE(macos(10.12));
|
||||||
|
@property (nonatomic, setter=_setSizeToContentAutoSizeMaximumSize:) CGSize _sizeToContentAutoSizeMaximumSize;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setAlwaysShowsHorizontalScroller:) BOOL _alwaysShowsHorizontalScroller WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (nonatomic, setter=_setAlwaysShowsVerticalScroller:) BOOL _alwaysShowsVerticalScroller WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
@property (nonatomic, readwrite, setter=_setUseSystemAppearance:) BOOL _useSystemAppearance WK_API_AVAILABLE(macos(10.14));
|
||||||
|
@property (nonatomic, setter=_setOverlayScrollbarStyle:) _WKOverlayScrollbarStyle _overlayScrollbarStyle WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (strong, nonatomic, setter=_setInspectorAttachmentView:) NSView *_inspectorAttachmentView WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setHeaderBannerLayer:) CALayer *_headerBannerLayer;
|
||||||
|
@property (nonatomic, setter=_setFooterBannerLayer:) CALayer *_footerBannerLayer;
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setThumbnailView:) _WKThumbnailView *_thumbnailView WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
@property (nonatomic, setter=_setIgnoresAllEvents:) BOOL _ignoresAllEvents WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
// Defaults to YES; if set to NO, WebKit will draw the grey wash and highlights itself.
|
||||||
|
@property (nonatomic, setter=_setUsePlatformFindUI:) BOOL _usePlatformFindUI WK_API_AVAILABLE(macos(10.15));
|
||||||
|
|
||||||
|
- (void)_setShouldSuppressFirstResponderChanges:(BOOL)shouldSuppress;
|
||||||
|
- (BOOL)_canChangeFrameLayout:(_WKFrameHandle *)frameHandle WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (BOOL)_tryToSwipeWithEvent:(NSEvent *)event ignoringPinnedState:(BOOL)ignoringPinnedState WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
- (void)_dismissContentRelativeChildWindows WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (void)_setFrame:(NSRect)rect andScrollBy:(NSSize)offset WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
- (void)_gestureEventWasNotHandledByWebCore:(NSEvent *)event WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
- (void)_disableFrameSizeUpdates WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (void)_enableFrameSizeUpdates WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
- (void)_beginDeferringViewInWindowChanges WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (void)_endDeferringViewInWindowChanges WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (void)_endDeferringViewInWindowChangesSync WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
- (void)_setCustomSwipeViews:(NSArray *)customSwipeViews WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (void)_setDidMoveSwipeSnapshotCallback:(void(^)(CGRect))callback WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (void)_setCustomSwipeViewsTopContentInset:(float)topContentInset WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
- (NSView *)_fullScreenPlaceholderView WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
- (NSWindow *)_fullScreenWindow WK_API_AVAILABLE(macos(10.13.4));
|
||||||
|
|
||||||
|
// Clients that want to maintain default behavior can return nil. To disable the immediate action entirely, return NSNull. And to
|
||||||
|
// do something custom, return an object that conforms to the NSImmediateActionAnimationController protocol.
|
||||||
|
- (id)_immediateActionAnimationControllerForHitTestResult:(_WKHitTestResult *)hitTestResult withType:(_WKImmediateActionType)type userData:(id<NSSecureCoding>)userData;
|
||||||
|
|
||||||
|
- (NSPrintOperation *)_printOperationWithPrintInfo:(NSPrintInfo *)printInfo;
|
||||||
|
- (NSPrintOperation *)_printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(_WKFrameHandle *)frameHandle WK_API_AVAILABLE(macos(10.12));
|
||||||
|
|
||||||
|
// FIXME: This SPI should become a part of the WKUIDelegate. rdar://problem/26561537
|
||||||
|
@property (nonatomic, readwrite, setter=_setWantsMediaPlaybackControlsView:) BOOL _wantsMediaPlaybackControlsView WK_API_AVAILABLE(macos(10.12.3));
|
||||||
|
@property (nonatomic, readonly) id _mediaPlaybackControlsView WK_API_AVAILABLE(macos(10.13));
|
||||||
|
|
||||||
|
- (void)_addMediaPlaybackControlsView:(id)mediaPlaybackControlsView WK_API_AVAILABLE(macos(10.13));
|
||||||
|
- (void)_removeMediaPlaybackControlsView WK_API_AVAILABLE(macos(10.12.3));
|
||||||
|
|
||||||
|
- (void)_prepareForMoveToWindow:(NSWindow *)targetWindow completionHandler:(void(^)(void))completionHandler WK_API_AVAILABLE(macos(10.13));
|
||||||
|
|
||||||
|
- (void)_simulateMouseMove:(NSEvent *)event WK_API_AVAILABLE(macos(13.0));
|
||||||
|
|
||||||
|
- (void)_setFont:(NSFont *)font sender:(id)sender WK_API_AVAILABLE(macos(13.3));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif // !TARGET_OS_IPHONE
|
||||||
60
WebKit Headers/WebKit/_WKActivatedElementInfo.h
Normal file
60
WebKit Headers/WebKit/_WKActivatedElementInfo.h
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@class UIImage;
|
||||||
|
#else
|
||||||
|
@class NSImage;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, _WKActivatedElementType) {
|
||||||
|
_WKActivatedElementTypeLink,
|
||||||
|
_WKActivatedElementTypeImage,
|
||||||
|
_WKActivatedElementTypeAttachment WK_API_AVAILABLE(macos(10.12), ios(10.0)),
|
||||||
|
_WKActivatedElementTypeUnspecified WK_API_AVAILABLE(macos(10.13), ios(11.0)),
|
||||||
|
} WK_API_AVAILABLE(macos(10.10), ios(8.0));
|
||||||
|
|
||||||
|
WK_CLASS_AVAILABLE(macos(10.10), ios(8.0))
|
||||||
|
@interface _WKActivatedElementInfo : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSURL *URL;
|
||||||
|
@property (nonatomic, readonly) NSURL *imageURL;
|
||||||
|
@property (nonatomic, readonly) NSString *title;
|
||||||
|
@property (nonatomic, readonly) _WKActivatedElementType type;
|
||||||
|
@property (nonatomic, readonly) CGRect boundingRect;
|
||||||
|
@property (nonatomic, readonly) NSString *ID WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic, readonly) BOOL isAnimatedImage WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@property (nonatomic, readonly) BOOL isAnimating;
|
||||||
|
@property (nonatomic, readonly) BOOL canShowAnimationControls;
|
||||||
|
@property (nonatomic, readonly) NSDictionary *userInfo WK_API_AVAILABLE(ios(11.0));
|
||||||
|
@property (nonatomic, readonly, copy) UIImage *image;
|
||||||
|
#else
|
||||||
|
@property (nonatomic, readonly, copy) NSImage *image;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@end
|
||||||
65
WebKit Headers/WebKit/_WKAttachment.h
Normal file
65
WebKit Headers/WebKit/_WKAttachment.h
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, _WKAttachmentDisplayMode) {
|
||||||
|
_WKAttachmentDisplayModeAuto = 1,
|
||||||
|
_WKAttachmentDisplayModeInPlace,
|
||||||
|
_WKAttachmentDisplayModeAsIcon
|
||||||
|
} WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
|
||||||
|
|
||||||
|
WK_CLASS_AVAILABLE(macos(10.13.4), ios(11.3))
|
||||||
|
@interface _WKAttachmentDisplayOptions : NSObject
|
||||||
|
@property (nonatomic) _WKAttachmentDisplayMode mode;
|
||||||
|
@end
|
||||||
|
|
||||||
|
WK_CLASS_AVAILABLE(macos(10.14), ios(12.0))
|
||||||
|
@interface _WKAttachmentInfo : NSObject
|
||||||
|
@property (nonatomic, readonly, nullable) NSString *contentType;
|
||||||
|
@property (nonatomic, readonly, nullable) NSString *name;
|
||||||
|
@property (nonatomic, readonly, nullable) NSString *filePath;
|
||||||
|
@property (nonatomic, readonly, nullable) NSData *data;
|
||||||
|
@property (nonatomic, readonly, nullable) NSFileWrapper *fileWrapper;
|
||||||
|
@end
|
||||||
|
|
||||||
|
WK_CLASS_AVAILABLE(macos(10.13.4), ios(11.3))
|
||||||
|
@interface _WKAttachment : NSObject
|
||||||
|
|
||||||
|
- (void)setFileWrapper:(NSFileWrapper *)fileWrapper contentType:(nullable NSString *)contentType completion:(void(^ _Nullable)(NSError * _Nullable))completionHandler WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, nullable) _WKAttachmentInfo *info WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
@property (nonatomic, readonly) NSString *uniqueIdentifier;
|
||||||
|
@property (nonatomic, readonly, getter=isConnected) BOOL connected WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
// Deprecated SPI.
|
||||||
|
- (void)requestInfo:(void(^)(_WKAttachmentInfo * _Nullable, NSError * _Nullable))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-info", macos(10.14, 10.14.4), ios(12.0, 12.2));
|
||||||
|
- (void)setData:(NSData *)data newContentType:(nullable NSString *)newContentType newFilename:(nullable NSString *)newFilename completion:(void(^ _Nullable)(NSError * _Nullable))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("Please use -setFileWrapper:contentType:completion: instead.", macos(10.13.4, 10.14.4), ios(11.3, 12.2));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
41
WebKit Headers/WebKit/_WKFindDelegate.h
Normal file
41
WebKit Headers/WebKit/_WKFindDelegate.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@protocol _WKFindDelegate <NSObject>
|
||||||
|
|
||||||
|
@optional
|
||||||
|
|
||||||
|
- (void)_webView:(WKWebView *)webView didCountMatches:(NSUInteger)matches forString:(NSString *)string;
|
||||||
|
- (void)_webView:(WKWebView *)webView didFindMatches:(NSUInteger)matches forString:(NSString *)string withMatchIndex:(NSInteger)matchIndex;
|
||||||
|
- (void)_webView:(WKWebView *)webView didFailToFindString:(NSString *)string;
|
||||||
|
|
||||||
|
- (void)_webView:(WKWebView *)webView didAddLayerForFindOverlay:(CALayer *)layer;
|
||||||
|
- (void)_webViewDidRemoveLayerForFindOverlay:(WKWebView *)webView;
|
||||||
|
|
||||||
|
@end
|
||||||
43
WebKit Headers/WebKit/_WKFindOptions.h
Normal file
43
WebKit Headers/WebKit/_WKFindOptions.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKFindOptions) {
|
||||||
|
_WKFindOptionsCaseInsensitive = 1 << 0,
|
||||||
|
_WKFindOptionsAtWordStarts = 1 << 1,
|
||||||
|
_WKFindOptionsTreatMedialCapitalAsWordStart = 1 << 2,
|
||||||
|
_WKFindOptionsBackwards = 1 << 3,
|
||||||
|
_WKFindOptionsWrapAround = 1 << 4,
|
||||||
|
_WKFindOptionsShowOverlay = 1 << 5,
|
||||||
|
_WKFindOptionsShowFindIndicator = 1 << 6,
|
||||||
|
_WKFindOptionsShowHighlight = 1 << 7,
|
||||||
|
_WKFindOptionsNoIndexChange = 1 << 8,
|
||||||
|
_WKFindOptionsDetermineMatchIndex = 1 << 9,
|
||||||
|
|
||||||
|
_WKFindOptionsIrrelevantForIncrementalResults = _WKFindOptionsShowOverlay | _WKFindOptionsShowFindIndicator | _WKFindOptionsShowHighlight | _WKFindOptionsDetermineMatchIndex,
|
||||||
|
_WKFindOptionsIrrelevantForBatchResults = _WKFindOptionsBackwards | _WKFindOptionsWrapAround | _WKFindOptionsIrrelevantForIncrementalResults
|
||||||
|
|
||||||
|
} WK_API_AVAILABLE(macos(10.10), ios(8.0));
|
||||||
38
WebKit Headers/WebKit/_WKLayoutMode.h
Normal file
38
WebKit Headers/WebKit/_WKLayoutMode.h
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, _WKLayoutMode) {
|
||||||
|
_WKLayoutModeViewSize = 0,
|
||||||
|
_WKLayoutModeFixedSize = 1,
|
||||||
|
|
||||||
|
// Lay out the view with its frame scaled by the inverse viewScale.
|
||||||
|
_WKLayoutModeDynamicSizeComputedFromViewScale = 2,
|
||||||
|
|
||||||
|
// Lay out the view at a heuristically-determined size based on the minimum size of the document.
|
||||||
|
_WKLayoutModeDynamicSizeComputedFromMinimumDocumentSize = 4,
|
||||||
|
|
||||||
|
} WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
37
WebKit Headers/WebKit/_WKOverlayScrollbarStyle.h
Normal file
37
WebKit Headers/WebKit/_WKOverlayScrollbarStyle.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, _WKOverlayScrollbarStyle) {
|
||||||
|
_WKOverlayScrollbarStyleDefault,
|
||||||
|
_WKOverlayScrollbarStyleDark,
|
||||||
|
_WKOverlayScrollbarStyleLight,
|
||||||
|
|
||||||
|
// Setting the overlay scrollbar style to automatic will cause WebKit to use its normal
|
||||||
|
// heuristic to choose an appropriate color.
|
||||||
|
_WKOverlayScrollbarStyleAutomatic
|
||||||
|
|
||||||
|
} WK_API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
86
WebKit Headers/WebKit/_WKProcessPoolConfiguration.h
Normal file
86
WebKit Headers/WebKit/_WKProcessPoolConfiguration.h
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014-2020 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <WebKit/WKBase.h>
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
#import "WebKitDefines.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
WK_CLASS_AVAILABLE(macos(10.10), ios(8.0))
|
||||||
|
@interface _WKProcessPoolConfiguration : NSObject <NSCopying>
|
||||||
|
|
||||||
|
@property (nonatomic, copy) NSURL *injectedBundleURL;
|
||||||
|
@property (nonatomic, copy) NSSet<Class> *customClassesForParameterCoder WK_API_DEPRECATED("No longer supported", macos(10.15.4, WK_MAC_TBA), ios(13.4, WK_IOS_TBA));
|
||||||
|
@property (nonatomic) NSUInteger maximumProcessCount WK_API_DEPRECATED("It is no longer possible to limit the number of processes", macos(10.0, 10.15), ios(1.0, 13.0));
|
||||||
|
@property (nonatomic) BOOL usesSingleWebProcess WK_API_AVAILABLE(macos(10.15), ios(13.0));
|
||||||
|
@property (nonatomic, nullable, copy) NSString *customWebContentServiceBundleIdentifier WK_API_DEPRECATED("No longer supported", macos(10.14.4, WK_MAC_TBA), ios(12.2, WK_IOS_TBA));
|
||||||
|
|
||||||
|
@property (nonatomic) BOOL ignoreSynchronousMessagingTimeoutsForTesting WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic) BOOL attrStyleEnabled WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
// Defaults to YES.
|
||||||
|
@property (nonatomic) BOOL shouldThrowExceptionForGlobalConstantRedeclaration WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
|
||||||
|
@property (nonatomic, copy) NSArray<NSURL *> *additionalReadAccessAllowedURLs WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR
|
||||||
|
@property (nonatomic) NSUInteger wirelessContextIdentifier WK_API_DEPRECATED("Use of this API is no longer necessary and can be removed", ios(10.12, 13.0));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Network Process properties
|
||||||
|
// FIXME: These should be be per-session/data store when we support multiple non-persistent sessions/data stores.
|
||||||
|
|
||||||
|
@property (nonatomic) NSInteger diskCacheSizeOverride WK_API_DEPRECATED("Use [WKWebsiteDataStore nonPersistentDataStore] to limit disk cache size to 0", macos(10.11, 10.14.4), ios(9.0, 12.2));
|
||||||
|
@property (nonatomic, copy) NSArray *cachePartitionedURLSchemes;
|
||||||
|
@property (nonatomic, copy) NSArray<NSString *> *alwaysRevalidatedURLSchemes WK_API_AVAILABLE(macos(10.12), ios(10.0));
|
||||||
|
@property (nonatomic) BOOL diskCacheSpeculativeValidationEnabled WK_API_DEPRECATED_WITH_REPLACEMENT("_WKWebsiteDataStoreConfiguration.networkCacheSpeculativeValidationEnabled", macos(10.12, 10.15.4), ios(10.0, 13.4));
|
||||||
|
@property (nonatomic, nullable, copy) NSString *sourceApplicationBundleIdentifier WK_API_DEPRECATED_WITH_REPLACEMENT("_WKWebsiteDataStoreConfiguration.sourceApplicationBundleIdentifier", macos(10.12.3, 10.14.4), ios(10.3, 12.2));
|
||||||
|
@property (nonatomic, nullable, copy) NSString *sourceApplicationSecondaryIdentifier WK_API_DEPRECATED_WITH_REPLACEMENT("_WKWebsiteDataStoreConfiguration.sourceApplicationSecondaryIdentifier", macos(10.12.3, 10.14.4), ios(10.3, 12.2));
|
||||||
|
@property (nonatomic) BOOL shouldCaptureAudioInUIProcess WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
@property (nonatomic) BOOL alwaysRunsAtBackgroundPriority WK_API_AVAILABLE(ios(10.3));
|
||||||
|
@property (nonatomic) BOOL shouldTakeUIBackgroundAssertion WK_API_AVAILABLE(ios(11.0));
|
||||||
|
#endif
|
||||||
|
@property (nonatomic) pid_t presentingApplicationPID WK_API_AVAILABLE(macos(10.13), ios(11.0));
|
||||||
|
@property (nonatomic) audit_token_t presentingApplicationProcessToken WK_API_AVAILABLE(macos(10.13), ios(11.3));
|
||||||
|
@property (nonatomic) BOOL processSwapsOnNavigation WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
@property (nonatomic) BOOL alwaysKeepAndReuseSwappedProcesses WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
@property (nonatomic) BOOL processSwapsOnWindowOpenWithOpener WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
@property (nonatomic) BOOL processSwapsOnNavigationWithinSameNonHTTPFamilyProtocol WK_API_AVAILABLE(macos(12.0), ios(15.0));
|
||||||
|
@property (nonatomic) BOOL prewarmsProcessesAutomatically WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
@property (nonatomic) BOOL usesWebProcessCache WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
@property (nonatomic) BOOL pageCacheEnabled WK_API_AVAILABLE(macos(10.14), ios(12.0));
|
||||||
|
@property (nonatomic, getter=isJITEnabled) BOOL JITEnabled WK_API_AVAILABLE(macos(10.14.4), ios(12.2));
|
||||||
|
|
||||||
|
@property (nonatomic) BOOL configureJSCForTesting WK_API_AVAILABLE(macos(10.15.4), ios(13.4));
|
||||||
|
|
||||||
|
@property (nonatomic, nullable, copy) NSString *timeZoneOverride WK_API_AVAILABLE(macos(13.0), ios(16.0));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
43
WebKit Headers/WebKit/_WKRemoteObjectInterface.h
Normal file
43
WebKit Headers/WebKit/_WKRemoteObjectInterface.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013-2020 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
|
||||||
|
@interface _WKRemoteObjectInterface : NSObject
|
||||||
|
|
||||||
|
+ (instancetype)remoteObjectInterfaceWithProtocol:(Protocol *)protocol;
|
||||||
|
|
||||||
|
- (id)initWithProtocol:(Protocol *)protocol identifier:(NSString *)identifier;
|
||||||
|
|
||||||
|
@property (readonly, nonatomic) Protocol *protocol;
|
||||||
|
@property (readonly, nonatomic) NSString *identifier;
|
||||||
|
|
||||||
|
- (NSSet *)classesForSelector:(SEL)selector argumentIndex:(NSUInteger)argumentIndex ofReply:(BOOL)ofReply;
|
||||||
|
- (void)setClasses:(NSSet *)classes forSelector:(SEL)selector argumentIndex:(NSUInteger)argumentIndex ofReply:(BOOL)ofReply;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
39
WebKit Headers/WebKit/_WKRemoteObjectRegistry.h
Normal file
39
WebKit Headers/WebKit/_WKRemoteObjectRegistry.h
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@class _WKRemoteObjectInterface;
|
||||||
|
|
||||||
|
@interface _WKRemoteObjectRegistry : NSObject
|
||||||
|
|
||||||
|
- (void)registerExportedObject:(id)object interface:(_WKRemoteObjectInterface *)interface;
|
||||||
|
- (void)unregisterExportedObject:(id)object interface:(_WKRemoteObjectInterface *)interface;
|
||||||
|
|
||||||
|
- (id)remoteObjectProxyWithInterface:(_WKRemoteObjectInterface *)interface;
|
||||||
|
|
||||||
|
@end
|
||||||
38
WebKit Headers/WebKit/_WKRenderingProgressEvents 2.h
Normal file
38
WebKit Headers/WebKit/_WKRenderingProgressEvents 2.h
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKRenderingProgressEvents) {
|
||||||
|
_WKRenderingProgressEventFirstLayout = 1 << 0,
|
||||||
|
_WKRenderingProgressEventFirstVisuallyNonEmptyLayout WK_API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 1,
|
||||||
|
_WKRenderingProgressEventFirstPaintWithSignificantArea = 1 << 2,
|
||||||
|
_WKRenderingProgressEventReachedSessionRestorationRenderTreeSizeThreshold WK_API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 3,
|
||||||
|
_WKRenderingProgressEventFirstLayoutAfterSuppressedIncrementalRendering WK_API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 4,
|
||||||
|
_WKRenderingProgressEventFirstPaintAfterSuppressedIncrementalRendering WK_API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 5,
|
||||||
|
_WKRenderingProgressEventFirstPaint WK_API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 6,
|
||||||
|
_WKRenderingProgressEventDidRenderSignificantAmountOfText WK_API_AVAILABLE(macos(10.14), ios(12.0)) = 1 << 7,
|
||||||
|
_WKRenderingProgressEventFirstMeaningfulPaint WK_API_AVAILABLE(macos(10.14.4), ios(12.2)) = 1 << 8,
|
||||||
|
} WK_API_AVAILABLE(macos(10.10), ios(8.0));
|
||||||
38
WebKit Headers/WebKit/_WKRenderingProgressEvents.h
Normal file
38
WebKit Headers/WebKit/_WKRenderingProgressEvents.h
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, _WKRenderingProgressEvents) {
|
||||||
|
_WKRenderingProgressEventFirstLayout = 1 << 0,
|
||||||
|
_WKRenderingProgressEventFirstVisuallyNonEmptyLayout API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 1,
|
||||||
|
_WKRenderingProgressEventFirstPaintWithSignificantArea = 1 << 2,
|
||||||
|
_WKRenderingProgressEventReachedSessionRestorationRenderTreeSizeThreshold API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 3,
|
||||||
|
_WKRenderingProgressEventFirstLayoutAfterSuppressedIncrementalRendering API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 4,
|
||||||
|
_WKRenderingProgressEventFirstPaintAfterSuppressedIncrementalRendering API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 5,
|
||||||
|
_WKRenderingProgressEventFirstPaint API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 6,
|
||||||
|
_WKRenderingProgressEventDidRenderSignificantAmountOfText API_AVAILABLE(macos(10.14), ios(12.0)) = 1 << 7,
|
||||||
|
_WKRenderingProgressEventFirstMeaningfulPaint API_AVAILABLE(macos(10.14.4), ios(12.2)) = 1 << 8,
|
||||||
|
} API_AVAILABLE(macos(10.10), ios(8.0));
|
||||||
33
WebKit Headers/WebKit/_WKSameDocumentNavigationType.h
Normal file
33
WebKit Headers/WebKit/_WKSameDocumentNavigationType.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, _WKSameDocumentNavigationType) {
|
||||||
|
_WKSameDocumentNavigationTypeAnchorNavigation,
|
||||||
|
_WKSameDocumentNavigationTypeSessionStatePush,
|
||||||
|
_WKSameDocumentNavigationTypeSessionStateReplace,
|
||||||
|
_WKSameDocumentNavigationTypeSessionStatePop,
|
||||||
|
} API_AVAILABLE(macos(10.10), ios(8.0));
|
||||||
55
WebKit Headers/WebKit/_WKUserStyleSheet.h
Normal file
55
WebKit Headers/WebKit/_WKUserStyleSheet.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015-2020 Apple Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <WebKit/WKFoundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@class _WKUserContentWorld;
|
||||||
|
@class WKContentWorld;
|
||||||
|
@class WKWebView;
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, _WKUserStyleLevel) {
|
||||||
|
_WKUserStyleUserLevel,
|
||||||
|
_WKUserStyleAuthorLevel
|
||||||
|
} WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
WK_CLASS_AVAILABLE(macos(10.12), ios(10.0))
|
||||||
|
@interface _WKUserStyleSheet : NSObject <NSCopying>
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, copy) NSString *source;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, copy) NSURL *baseURL;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, getter=isForMainFrameOnly) BOOL forMainFrameOnly;
|
||||||
|
|
||||||
|
- (instancetype)initWithSource:(NSString *)source forMainFrameOnly:(BOOL)forMainFrameOnly;
|
||||||
|
|
||||||
|
- (instancetype)initWithSource:(NSString *)source forWKWebView:(nullable WKWebView *)webView forMainFrameOnly:(BOOL)forMainFrameOnly includeMatchPatternStrings:(nullable NSArray<NSString *> *)includeMatchPatternStrings excludeMatchPatternStrings:(nullable NSArray<NSString *> *)excludeMatchPatternStrings baseURL:(nullable NSURL *)baseURL level:(_WKUserStyleLevel)level contentWorld:(nullable WKContentWorld *)contentWorld WK_API_AVAILABLE(macos(11.0), ios(14.0));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Reference in New Issue
Block a user