Closed Bug 1587041 Opened 5 years ago Closed 5 years ago

Firefox blocks Windows-key macros from other programs

Categories

(Firefox :: Untriaged, defect)

69 Branch
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: asoroudi, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36

Steps to reproduce:

  1. Create an AutoHotkey script with a Windows-key hotkey to Send text
  2. Compile the script
  3. Run the compiled program
  4. Use the hotkey in Firefox

Actual results:

Nothing.

Expected results:

The expected text should appear in Firefox.

Here's a sample AHK script:
; ⊞Win+C should paste "foobar"
#c::send foobar

Compile that and run the executable. Pressing win+c should now paste "foobar".

Here's the results of testing:
(0. "Everywhere" means in notepad, chrome, word, run-dialog, explorer, etc.)

  1. Running the raw script (.ahk file) works everywhere, including Firefox
  2. Running the compiled script (.exe file) works everywhere except Firefox
  3. Hotkeys with Ctrl/Alt/Shift work everywhere for raw and compiled scripts
    e.g., "^!+c::send baz" will send "baz" when pressing Ctrl+Alt+Shift+C in Firefox
  4. Win-key macros from other hotkey programs work everywhere

For some reason, Firefox is blocking Send commands from AHK scripts, but only for the Windows key, and only when compiled. 😕

I'll cross-post this to the AHK forums, but this bug is specific to Firefox.

I cannot reproduce this issue with Fx 69.0.3 2019-10-09 or Fx 71.0a1 (2019-10-16) on Windows 10, Windows 8.1

The test script would contain:

#c::send foobar

When I'm pressing windows + C, I will get foobar in addressbar. It would work both with complied(.exe) or with raw(.ahk).

You might want to try the same steps with a new profile (https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles) - if the #c works with a new profile, that means that probably there's a web-extension or other customization that interferes with the # shortcut.

If even with a new profile the #c doesn't work, could you please try to review what non-standard processes you might have open and shut them down to test if those are at fault for this behavior?

*Disclaimer:
Please note that creating and testing with a new profile as requested above implies that the "new profile" will have default settings, without any user customization, hence if custom accessibility requirements are needed, those are going to be defaulted during the new profile testing session.)

Flags: needinfo?(asoroudi)

I just tried a fresh profile and it's the same thing. I'll try making a fresh Windows VM and test in that to see what happens.

Flags: needinfo?(asoroudi)

(In reply to Synetech from comment #2)

I just tried a fresh profile and it's the same thing. I'll try making a fresh Windows VM and test in that to see what happens.

Was the original report from a VM as well? That might explain it !? ( my tests were on phisical machines)

I'll test in a VM because it won't have anything installed.

The original report is from my daily-driver; I wrote a script that lets me easily enter various Unicode characters with hotkeys, and the compiled version works just fine in Windows, Chrome, Notepad, and everywhere, except for Firefox, in Firefox, only hotkeys like Ctrl+Alt+8 or Ctrl+Alt+Shift+E work, any hotkey that includes the Windows key does nothing (unless I use the script instead of the compiled version).

I'll also test 32-bit and 64-bit copies of the compiled version.

I just tried it in a VM and got the same results:

• All versions work in Windows Explorer, Notepad, Chrome, everywhere
• All version of raw script work in Firefox
• Compiled script with msgbox before send works in Firefox
• Compiled script without msgbox (with send or sendinput) does NOT work in Firefox

It looks like it's a timing issue/race-condition because popping up a message-box before sending the keystroke allows it to work. I don't know why it only affects Firefox though. Maybe Firefox has an extra layer of input processing or something. 🤔

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME

I recompiled with the latest .bin files and it's working now. I'm not sure what the problem was, but it seems to be fixed now, so that's good. 🤷

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