Cannot use FuzzingFunctions.synthesizeKeyboardEvents to increase/decrease zoom
Categories
(Core :: Fuzzing, enhancement)
Tracking
()
People
(Reporter: jkratzer, Unassigned)
References
(Depends on 1 open bug)
Details
I tried the following to programmatically trigger zoom in/out without success. This feature would be incredibly useful for fuzzing.
<html>
<head>
<script>
window.addEventListener('load', () => {
for (let i = 0; i < 10; i++) {
FuzzingFunctions.synthesizeKeyboardEvents('-', { controlKey: true })
}
})
</script>
</head>
<body><p>This is a test</p></body>
</html>
Comment 1•3 years ago
|
||
If I understand https://bugzilla.mozilla.org/show_bug.cgi?id=1700004#c4 correctly, this would require the event to be synthesized via main process.
{ controlKey: true }
This should be { ctrlKey: true}
. Could you check it?
FYI: KeyboardEventInit
is declared here:
https://searchfox.org/mozilla-central/rev/1c5c3f4ec274462b92cf5bd82235ae3a56c508e9/dom/webidl/KeyboardEvent.webidl#61
https://searchfox.org/mozilla-central/rev/1c5c3f4ec274462b92cf5bd82235ae3a56c508e9/dom/webidl/UIEvent.webidl#47
Reporter | ||
Comment 3•3 years ago
|
||
(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #2)
{ controlKey: true }
This should be
{ ctrlKey: true}
. Could you check it?FYI:
KeyboardEventInit
is declared here:
https://searchfox.org/mozilla-central/rev/1c5c3f4ec274462b92cf5bd82235ae3a56c508e9/dom/webidl/KeyboardEvent.webidl#61
https://searchfox.org/mozilla-central/rev/1c5c3f4ec274462b92cf5bd82235ae3a56c508e9/dom/webidl/UIEvent.webidl#47
:mayasuki, even with the correct ctrlKey
parameter I am unable to programmatically trigger zoom increase/decrease. As per :truber's comment, it appears that the keyboard event is not synthesized via the main process.
Ah, I see. I guess that zoom shortcut keys are handled only in the main process...
Description
•