Title: [280039] trunk/Source/WebKit
Revision
280039
Author
[email protected]
Date
2021-07-19 11:14:54 -0700 (Mon, 19 Jul 2021)

Log Message

[Cocoa] Web Inspector: Service workers can't be inspected in Safari Technology Preview
https://bugs.webkit.org/show_bug.cgi?id=228001

Reviewed by Per Arne Vollan.

For inspecting targets in the WebProcess, like Service Workers, we read the `ShowDevelopMenu` default on Cocoa
platforms to determine if remote inspection should be allowed, but the sandbox broker bundle identifier used to
read that preference is different for Safari Technology Preview. We need to read the preference with the
appropriate sandbox broker bundle identifier when the host application is Safari Technology Preview.

* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::shouldEnableRemoteInspector):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (280038 => 280039)


--- trunk/Source/WebKit/ChangeLog	2021-07-19 18:13:54 UTC (rev 280038)
+++ trunk/Source/WebKit/ChangeLog	2021-07-19 18:14:54 UTC (rev 280039)
@@ -1,5 +1,20 @@
 2021-07-19  Patrick Angle  <[email protected]>
 
+        [Cocoa] Web Inspector: Service workers can't be inspected in Safari Technology Preview
+        https://bugs.webkit.org/show_bug.cgi?id=228001
+
+        Reviewed by Per Arne Vollan.
+
+        For inspecting targets in the WebProcess, like Service Workers, we read the `ShowDevelopMenu` default on Cocoa
+        platforms to determine if remote inspection should be allowed, but the sandbox broker bundle identifier used to
+        read that preference is different for Safari Technology Preview. We need to read the preference with the
+        appropriate sandbox broker bundle identifier when the host application is Safari Technology Preview.
+
+        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
+        (WebKit::WebProcessProxy::shouldEnableRemoteInspector):
+
+2021-07-19  Patrick Angle  <[email protected]>
+
         [Cocoa] Web Inspector: REGRESSION(r271294) Service workers on iOS can't be inspected
         https://bugs.webkit.org/show_bug.cgi?id=227971
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm (280038 => 280039)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm	2021-07-19 18:13:54 UTC (rev 280038)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm	2021-07-19 18:14:54 UTC (rev 280039)
@@ -37,6 +37,7 @@
 #import "WKTypeRefWrapper.h"
 #import "WebProcessMessages.h"
 #import "WebProcessPool.h"
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <sys/sysctl.h>
 #import <wtf/NeverDestroyed.h>
 #import <wtf/Scope.h>
@@ -203,7 +204,10 @@
 #if PLATFORM(IOS_FAMILY)
     return CFPreferencesGetAppIntegerValue(WIRRemoteInspectorEnabledKey, WIRRemoteInspectorDomainName, nullptr);
 #else
-    return CFPreferencesGetAppIntegerValue(CFSTR("ShowDevelopMenu"), CFSTR("com.apple.Safari.SandboxBroker"), nullptr);
+    auto sandboxBrokerBundleIdentifier = CFSTR("com.apple.Safari.SandboxBroker");
+    if (WebCore::applicationBundleIdentifier() == "com.apple.SafariTechnologyPreview"_s)
+        sandboxBrokerBundleIdentifier = CFSTR("com.apple.SafariTechnologyPreview.SandboxBroker");
+    return CFPreferencesGetAppIntegerValue(CFSTR("ShowDevelopMenu"), sandboxBrokerBundleIdentifier, nullptr);
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to