Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3d99c5a137548afb19025ccd16979e9357a8cde7
      
https://github.com/WebKit/WebKit/commit/3d99c5a137548afb19025ccd16979e9357a8cde7
  Author: Patrick Angle <pan...@apple.com>
  Date:   2022-10-14 (Fri, 14 Oct 2022)

  Changed paths:
    M Source/JavaScriptCore/API/JSContext.h
    M Source/JavaScriptCore/API/JSContext.mm
    M Source/JavaScriptCore/API/JSContextPrivate.h
    M Source/JavaScriptCore/API/JSContextRef.cpp
    M Source/JavaScriptCore/API/JSContextRef.h
    M Source/JavaScriptCore/API/JSContextRefPrivate.h
    M Source/JavaScriptCore/API/JSRemoteInspector.cpp
    M Source/JavaScriptCore/API/JSRemoteInspector.h
    M Source/JavaScriptCore/API/WebKitAvailability.h
    M Source/JavaScriptCore/API/tests/testIncludes.m
    M Source/JavaScriptCore/config.h
    M Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
    M Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.cpp
    M Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.h
    M Source/JavaScriptCore/inspector/remote/RemoteInspector.h
    M Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h
    M Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm
    M Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp
    M Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp
    M Source/JavaScriptCore/jsc.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.h
    M Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h
    M Source/WebCore/config.h
    M Source/WebCore/inspector/InspectorController.cpp
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
    M Source/WebKit/UIProcess/API/C/WKPage.cpp
    M Source/WebKit/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Source/WebKit/UIProcess/Inspector/mac/WKInspectorViewController.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/WebKit2Prefix.h
    M Source/WebKitLegacy/mac/WebView/WebView.mm
    M Tools/MiniBrowser/mac/WK2BrowserWindowController.m
    M Tools/MobileMiniBrowser/MobileMiniBrowserFramework/WebViewController.m
    M Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm

  Log Message:
  -----------
  Remote Web Inspector: [Cocoa] `inspectable` API
https://bugs.webkit.org/show_bug.cgi?id=245986
rdar://100736163

Reviewed by Devin Rousso.

Add API to allow applications to explicitly mark a WKWebView or JSContext as 
inspectable. This flips assumptions about
inspectability of content. Previously the default state for inspectability was 
`true`, with a platform-specific deamon
making decisions about which applications would actually be inspectable on a 
system. This patch moves that decision into
WebKit/WebCore/JavaScriptCore instead, and flips the default for inspectability 
to be `false` unless an application
would have previously been always-inspectable. Those cases include:
- Applications with the `get-task-allow`/`com.apple.security.get-task-allow` 
development entitlements when linked
against an SDK without the API.
- Applications with the 
`com.apple.webinspector.allow`/`com.apple.private.webinspector.allow-remote-inspection`
entitlements.

These entitlements will no longer be necessary to enable inspection, and 
instead the new `inspectable` API should be
used.

* Source/JavaScriptCore/API/JSContext.h:
* Source/JavaScriptCore/API/JSContext.mm:
(-[JSContext inspectable]):
(-[JSContext setInspectable:]):
(-[JSContext _remoteInspectionEnabled]):
(-[JSContext _setRemoteInspectionEnabled:]):
* Source/JavaScriptCore/API/JSContextPrivate.h:
* Source/JavaScriptCore/API/JSContextRef.cpp:
(JSGlobalContextCreateInGroup):
(JSGlobalContextIsInspectable):
(JSGlobalContextSetInspectable):
(JSGlobalContextGetRemoteInspectionEnabled):
(JSGlobalContextSetRemoteInspectionEnabled):
* Source/JavaScriptCore/API/JSContextRef.h:
* Source/JavaScriptCore/API/JSContextRefPrivate.h:
* Source/JavaScriptCore/API/JSRemoteInspector.cpp:
(mainProcessHasEntitlement):
(defaultStateForRemoteInspectionEnabledByDefault):
(JSRemoteInspectorGetInspectionEnabledByDefault):
* Source/JavaScriptCore/API/JSRemoteInspector.h:
* Source/JavaScriptCore/API/WebKitAvailability.h:
* Source/JavaScriptCore/API/tests/testIncludes.m:
* Source/JavaScriptCore/config.h:
* Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::developerExtrasEnabled const):
* Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.cpp:
(Inspector::RemoteInspectionTarget::remoteControlAllowed const):
(Inspector::RemoteInspectionTarget::inspectable const):
(Inspector::RemoteInspectionTarget::setInspectable):
(Inspector::RemoteInspectionTarget::pauseWaitingForAutomaticInspection):
(Inspector::RemoteInspectionTarget::setRemoteDebuggingAllowed): Deleted.
* Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.h:
* Source/JavaScriptCore/inspector/remote/RemoteInspector.h:
* Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h:
* Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::globalStateForNotify):
(Inspector::RemoteInspector::singleton):
(Inspector::RemoteInspector::parentProcessAuditToken):
(Inspector::RemoteInspector::listingForInspectionTarget const):
(Inspector::globalAutomaticInspectionState): Deleted.
* Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* Source/JavaScriptCore/jsc.cpp:
(CommandLine::parseArguments):
(runJSC):
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::setInspectable):
(JSC::JSGlobalObject::inspectable const):
(JSC::JSGlobalObject::setRemoteDebuggingEnabled): Deleted.
(JSC::JSGlobalObject::remoteDebuggingEnabled const): Deleted.
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
* Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h:
* Source/WebCore/config.h:
* Source/WebCore/inspector/InspectorController.cpp:
(WebCore::InspectorController::enabled const):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::inspectable const):
(WebCore::Page::setInspectable):
(WebCore::Page::remoteInspectionAllowed const): Deleted.
(WebCore::Page::setRemoteInspectionAllowed): Deleted.
* Source/WebCore/page/Page.h:
* Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageGetAllowsRemoteInspection):
(WKPageSetAllowsRemoteInspection):
* Source/WebKit/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
(API::SharedJSContext::ensureContext):
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView inspectable]):
(-[WKWebView setInspectable:]):
(-[WKWebView _allowsRemoteInspection]):
(-[WKWebView _setAllowsRemoteInspection:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/Inspector/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController webView]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::m_fullscreenVideoTextRecognitionTimer):
(WebKit::WebPageProxy::inspectable const):
(WebKit::WebPageProxy::setInspectable):
(WebKit::WebPageProxy::allowsRemoteInspection const): Deleted.
(WebKit::WebPageProxy::setAllowsRemoteInspection): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebKit2Prefix.h:
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
(-[WebView allowsRemoteInspection]):
(-[WebView setAllowsRemoteInspection:]):
* Tools/MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
* Tools/MobileMiniBrowser/MobileMiniBrowserFramework/WebViewController.m:
(-[WebViewController createWebView]):
* Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView initWithFrame:configuration:]):

Canonical link: https://commits.webkit.org/255557@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to