Skip to content

Commit

Permalink
wkwebview: Adapt debug mode for new macOS updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Mar 25, 2024
1 parent 5ebb802 commit b1983ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions wkwebview/WebView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -98,8 +98,9 @@
E9F655B026D2C6FD002DD3C1 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1420;
LastUpgradeCheck = 1530;
TargetAttributes = {
E9F655B726D2C6FD002DD3C1 = {
CreatedOnToolsVersion = 12.5.1;
Expand Down Expand Up @@ -201,6 +202,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -263,6 +265,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
6 changes: 5 additions & 1 deletion wkwebview/WebView/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ class ViewController: NSViewController, WKNavigationDelegate, WKUIDelegate, WKSc
view.layer?.backgroundColor = background
view.frame = CGRect(x: 0, y: 0, width: width, height: height)

webView.isHidden = true
webView.navigationDelegate = self
webView.uiDelegate = self
webView.configuration.userContentController.add(self, name: "download")
webView.configuration.preferences.setValue(true, forKey: "allowFileAccessFromFileURLs")

#if DEBUG
if #available(macOS 13.3, *) {
webView.isInspectable = true
}
webView.configuration.preferences.setValue(true, forKey: "developerExtrasEnabled")
#endif
webView.isHidden = true
}

override func viewDidLoad() {
Expand Down

0 comments on commit b1983ee

Please sign in to comment.