WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
260361
Transient activation should be dropped after evaluating JavaScript, except when required for application compatibility
https://bugs.webkit.org/show_bug.cgi?id=260361
Summary
Transient activation should be dropped after evaluating JavaScript, except wh...
Michael Catanzaro
Reported
2023-08-17 13:01:21 PDT
This is a follow-up to
bug #258037
and
bug #251276
. When a user interacts with a web page, the page is said to receive a user gesture and this grants additional permissions to the web content until the "transient activation" period expires, which in WebKit is 5 seconds. WebKit's API functions that allow applications to run JavaScript allow the application to force a user gesture in order to execute JS with full permissions. But in this case, the transient activation should expire immediately because the user did not really interact with the page. Web content should not unexpectedly receive additional permissions for 5 seconds whenever the application runs some of its own unrelated JS.
Bug #258037
and
bug #251276
fixed this for freshly built applications on Cocoa platforms, but left other platforms unchanged because dropping the transient activation is not backwards-compatible and could possible cause unknown breakage in applications. But the desired behavior is to always drop transient activation. Implement this everywhere: * In RemoteInspectorProtocolHandler.cpp, affecting JS executed by remote inspector. This change is surely safe. * In WebKitWebView.cpp, affecting the GTK and WPE port. This could possibly break GTK/WPE applications, so we won't backport it to the 2.40 stable branch. * In WKPageRunJavaScriptInMainFrame, affecting non-Cocoa ports. This should be safe because the C API is not public except for Windows and PlayStation ports, which control the version of WebKit they ship. * And finally in ScriptController::executeScriptIgnoringException. This will affect all ports and could possibly break things.
Attachments
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2023-08-17 13:38:58 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/16803
EWS
Comment 2
2023-08-28 07:59:06 PDT
Committed
267352@main
(3b7c5108fac6): <
https://commits.webkit.org/267352@main
> Reviewed commits have been landed. Closing PR #16803 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug