Open Bug 1704150 Opened 3 years ago Updated 3 years ago

Cannot use FuzzingFunctions.synthesizeKeyboardEvents to increase/decrease zoom

Categories

(Core :: Fuzzing, enhancement)

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>

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.

See Also: → 1700004

(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.

Flags: needinfo?(jkratzer)

Ah, I see. I guess that zoom shortcut keys are handled only in the main process...

You need to log in before you can comment on or make changes to this bug.