[Webkit-unassigned] [Bug 164718] [GTK] webkit_navigation_action_get_modifiers() returns 0 for JavaScript events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 16 17:09:39 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=164718

--- Comment #3 from antoyo <bouanto at zoho.com> ---
So, I made an example [here](https://github.com/antoyo/webkit-bug) (sorry, it is written in Rust, but it should be easy to understand).

You can see that there's a web extension that [clicks on a link](https://github.com/antoyo/webkit-bug/blob/master/webkit-bug-extension/src/lib.rs#L21-L22) and the `ctrlKey` parameter is set to true.
The JavaScript will show that this parameter is indeed true [here](https://github.com/antoyo/webkit-bug/blob/master/tests/index.html#L7).
It works the same as when the user ctrl-click manually the link.

However, the difference is that `webkit_navigation_action_get_modifiers()` [will return 0](https://github.com/antoyo/webkit-bug/blob/master/src/main.rs#L26) when the click was triggered by the web extension, while it will return 4 on a manual ctrl-click.

This might be because this API matches the JavaScript API and it might be disallowed in JavaScript for security reasons.
However, I believe it should be possible to simulate a ctrl-click in a web extension.

If you need more info, feel free to ask.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170517/f35d2049/attachment.html>


More information about the webkit-unassigned mailing list