Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Web Inspector: Implement
frameURL
option for `devtools.inspectedWin…
…dow.eval` command https://bugs.webkit.org/show_bug.cgi?id=222568 Reviewed by Devin Rousso. Source/WebInspectorUI: New test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm Add support for evaluating script from an extension in a specific frame on the page by referring to it by the frame's URL. Frame URLs are matched in three steps, first looking for an exact URL match, including query parameters and fragment identifier. If no match is found and the provided `options.frameURL` does not have any fragment identifier or query parameters, a check is then made against each known frame again, this time excluding their fragment identifier. If that check still fails to find a frame for the URL, we perform one more pass, this time excluding the fragment identifier and query parameters for each known frame. * UserInterface/Controllers/WebInspectorExtensionController.js: (WI.WebInspectorExtensionController.prototype.evaluateScriptForExtension): (WI.WebInspectorExtensionController.prototype.reloadForExtension): - Drive-by removal of trailing spaces. (WI.WebInspectorExtensionController.prototype._frameForFrameURL): Source/WebKit: New test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm Correct the API to indicate that `frameURL` and `contextSecurityOrigin` are nullable parameters. * UIProcess/API/Cocoa/_WKInspectorExtension.h: Tools: Add test coverage for evaluating script on an inspected page from an extension, including evaluating on an inner frame. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm: (TEST): * TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPage.html: Added. * TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPageInnerFrame.html: Added. Canonical link: https://commits.webkit.org/246008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
249 additions
and 10 deletions.
- +22 −0 Source/WebInspectorUI/ChangeLog
- +50 −9 Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js
- +13 −0 Source/WebKit/ChangeLog
- +1 −1 Source/WebKit/UIProcess/API/Cocoa/_WKInspectorExtension.h
- +16 −0 Tools/ChangeLog
- +8 −0 Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
- +124 −0 Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm
- +8 −0 Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPage.html
- +7 −0 Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionEvaluateScriptOnPageInnerFrame.html
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head>Test page to be inspected</head> | ||
<body> | ||
<p>Test page to be inspected.</p> | ||
<p id="secret">42-mainFrame</p> | ||
<iframe src="./WKInspectorExtensionEvaluateScriptOnPageInnerFrame.html?query=param#fragment"></iframe> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,7 @@ | ||
<html> | ||
<head>Test inner frame to be inspected</head> | ||
<body> | ||
<p>Test inner frame to be inspected.</p> | ||
<p id="secret">42-innerFrame</p> | ||
</body> | ||
</html> |