Use a bridging header for the Web Inspector API instead of KVC
This commit is contained in:
parent
4f405009f5
commit
0c89bc43c1
@ -30,17 +30,10 @@ final class DetailWebViewController: NSViewController, WKUIDelegate {
|
|||||||
|
|
||||||
private var webInspectorEnabled: Bool {
|
private var webInspectorEnabled: Bool {
|
||||||
get {
|
get {
|
||||||
if let webView = webView {
|
return webView.configuration.preferences._developerExtrasEnabled
|
||||||
let val: NSNumber? = webView.configuration.preferences.value(forKey: "developerExtrasEnabled") as? NSNumber
|
|
||||||
return val != nil ? val!.boolValue : false
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if let webView = webView {
|
webView.configuration.preferences._developerExtrasEnabled = newValue
|
||||||
webView.configuration.preferences.setValue(newValue, forKey: "developerExtrasEnabled")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
Mac/NetNewsWire-Bridging-Header.h
Normal file
9
Mac/NetNewsWire-Bridging-Header.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//
|
||||||
|
// NetNewsWire-Bridging-Header.h
|
||||||
|
// NetNewsWire
|
||||||
|
//
|
||||||
|
// Created by Nate Weaver on 2019-09-17.
|
||||||
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "WKPreferencesPrivate.h"
|
15
Mac/WKPreferencesPrivate.h
Normal file
15
Mac/WKPreferencesPrivate.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// WKPreferencesPrivate.h
|
||||||
|
// NetNewsWire
|
||||||
|
//
|
||||||
|
// Created by Nate Weaver on 2019-09-17.
|
||||||
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <WebKit/WebKit.h>
|
||||||
|
|
||||||
|
@interface WKPreferences (Private)
|
||||||
|
|
||||||
|
@property (nonatomic, setter=_setDeveloperExtrasEnabled:) BOOL _developerExtrasEnabled API_AVAILABLE(macos(10.11), ios(9.0));
|
||||||
|
|
||||||
|
@end
|
@ -917,6 +917,8 @@
|
|||||||
84F9EAE4213660A100CF2DE4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
84F9EAE4213660A100CF2DE4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
84FB9A2D1EDCD6B8003D53B9 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Frameworks/Vendor/Sparkle.framework; sourceTree = SOURCE_ROOT; };
|
84FB9A2D1EDCD6B8003D53B9 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Frameworks/Vendor/Sparkle.framework; sourceTree = SOURCE_ROOT; };
|
||||||
84FF69B01FC3793300DC198E /* FaviconURLFinder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaviconURLFinder.swift; sourceTree = "<group>"; };
|
84FF69B01FC3793300DC198E /* FaviconURLFinder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaviconURLFinder.swift; sourceTree = "<group>"; };
|
||||||
|
B24EFD482330FF99006C6242 /* NetNewsWire-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NetNewsWire-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
|
B24EFD5923310109006C6242 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = "<group>"; };
|
||||||
D553737C20186C1F006D8857 /* Article+Scriptability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Article+Scriptability.swift"; sourceTree = "<group>"; };
|
D553737C20186C1F006D8857 /* Article+Scriptability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Article+Scriptability.swift"; sourceTree = "<group>"; };
|
||||||
D57BE6DF204CD35F00D11AAC /* NSScriptCommand+NetNewsWire.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSScriptCommand+NetNewsWire.swift"; sourceTree = "<group>"; };
|
D57BE6DF204CD35F00D11AAC /* NSScriptCommand+NetNewsWire.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSScriptCommand+NetNewsWire.swift"; sourceTree = "<group>"; };
|
||||||
D5907CDC2002F0BE005947E5 /* NetNewsWire_project_release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = NetNewsWire_project_release.xcconfig; sourceTree = "<group>"; };
|
D5907CDC2002F0BE005947E5 /* NetNewsWire_project_release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = NetNewsWire_project_release.xcconfig; sourceTree = "<group>"; };
|
||||||
@ -1585,6 +1587,8 @@
|
|||||||
6581C73620CED60100F4AD34 /* SafariExtension */,
|
6581C73620CED60100F4AD34 /* SafariExtension */,
|
||||||
84C9FC8322629E8F00D921D6 /* Resources */,
|
84C9FC8322629E8F00D921D6 /* Resources */,
|
||||||
84FB9A2C1EDCD6A4003D53B9 /* Frameworks */,
|
84FB9A2C1EDCD6A4003D53B9 /* Frameworks */,
|
||||||
|
B24EFD482330FF99006C6242 /* NetNewsWire-Bridging-Header.h */,
|
||||||
|
B24EFD5923310109006C6242 /* WKPreferencesPrivate.h */,
|
||||||
);
|
);
|
||||||
path = Mac;
|
path = Mac;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -3087,6 +3091,7 @@
|
|||||||
MACOSX_DEPLOYMENT_TARGET = 10.14.4;
|
MACOSX_DEPLOYMENT_TARGET = 10.14.4;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.ranchero.NetNewsWire-Evergreen";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.ranchero.NetNewsWire-Evergreen";
|
||||||
PRODUCT_NAME = NetNewsWire;
|
PRODUCT_NAME = NetNewsWire;
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Mac/NetNewsWire-Bridging-Header.h";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@ -3102,6 +3107,7 @@
|
|||||||
MACOSX_DEPLOYMENT_TARGET = 10.14.4;
|
MACOSX_DEPLOYMENT_TARGET = 10.14.4;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.ranchero.NetNewsWire-Evergreen";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.ranchero.NetNewsWire-Evergreen";
|
||||||
PRODUCT_NAME = NetNewsWire;
|
PRODUCT_NAME = NetNewsWire;
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Mac/NetNewsWire-Bridging-Header.h";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user