RESOLVED FIXED 217629
Add a property on WKWebView to determine if it is being inspected by Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=217629
Summary Add a property on WKWebView to determine if it is being inspected by Web Insp...
Test
Reported 2020-10-12 12:43:50 PDT
If you are inspecting a webview, the property will be true.
Attachments
Patch (2.76 KB, patch)
2020-10-12 13:22 PDT, Ellie
no flags
Patch (2.43 KB, patch)
2020-10-12 15:04 PDT, Ellie
no flags
Patch (2.34 KB, patch)
2020-10-12 15:19 PDT, Ellie
hi: review+
bburg: commit-queue-
Patch (5.92 KB, patch)
2020-10-13 13:18 PDT, Ellie Epskamp-Hunt
no flags
Patch (5.98 KB, patch)
2020-10-13 14:22 PDT, Ellie Epskamp-Hunt
no flags
Ellie
Comment 1 2020-10-12 13:06:00 PDT
Ellie
Comment 2 2020-10-12 13:22:57 PDT
Kate Cheney
Comment 3 2020-10-12 13:39:39 PDT
Comment on attachment 411149 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411149&action=review > Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:1656 > +- (BOOL)_isBeingInspected I am not sure you need this in both WKWebView and WKWebViewMac. Is there a reason you put it in both?
Devin Rousso
Comment 4 2020-10-12 14:19:26 PDT
Comment on attachment 411149 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411149&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:579 > +@property (nonatomic, readonly) BOOL _isBeingInspected WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); I'd put this right above the `_inspector`, as that will cover both macOS and iOS I'd do the same with the implementation in `Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm` too
Ellie
Comment 5 2020-10-12 14:59:32 PDT
(In reply to katherine_cheney from comment #3) > Comment on attachment 411149 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=411149&action=review > > > Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:1656 > > +- (BOOL)_isBeingInspected > > I am not sure you need this in both WKWebView and WKWebViewMac. Is there a > reason you put it in both? You are right, I don't need it in both! My reason? I was confused :)
Ellie
Comment 6 2020-10-12 15:04:46 PDT
Devin Rousso
Comment 7 2020-10-12 15:12:57 PDT
Comment on attachment 411168 [details] Patch r=me
Devin Rousso
Comment 8 2020-10-12 15:13:50 PDT
Comment on attachment 411168 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411168&action=review > Source/WebKit/ChangeLog:13 > + * UIProcess/API/mac/WKWebViewMac.mm: > + (-[WKWebView _isBeingInspected]): oh btw these lines should be removed :P
Ellie
Comment 9 2020-10-12 15:19:59 PDT
Blaze Burg
Comment 10 2020-10-12 16:11:04 PDT
Comment on attachment 411169 [details] Patch I'm in favor of this SPI, though the name seems inelegant. (We don't use 'Being' much in Cocoa API). Please remove the now-redundant _hasInspectorFrontend from WKWebViewPrivateForTesting and its uses in the WKInspectorDelegate API test.
Eric Carlson
Comment 11 2020-10-13 10:37:12 PDT
Comment on attachment 411169 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411169&action=review This should have a test. > Source/WebKit/ChangeLog:8 > + Reviewed by NOBODY (OOPS!). > + It would be helpful to have a comment about why the is needed.
Ellie Epskamp-Hunt
Comment 12 2020-10-13 13:18:36 PDT
Ellie Epskamp-Hunt
Comment 13 2020-10-13 14:22:35 PDT
Ellie Epskamp-Hunt
Comment 14 2020-10-13 14:24:09 PDT
(In reply to Eric Carlson from comment #11) > Comment on attachment 411169 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=411169&action=review > > This should have a test. > > > Source/WebKit/ChangeLog:8 > > + Reviewed by NOBODY (OOPS!). > > + > > It would be helpful to have a comment about why the is needed. I updated the existing tests and added a comment about why the property is needed.
Blaze Burg
Comment 15 2020-10-13 15:20:03 PDT
Comment on attachment 411255 [details] Patch r=me
EWS
Comment 16 2020-10-13 15:49:14 PDT
Committed r268428: <https://trac.webkit.org/changeset/268428> All reviewed patches have been landed. Closing bug and clearing flags on attachment 411255 [details].
Note You need to log in before you can comment on or make changes to this bug.