Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firefox: Alt key is a default menu binding, causes glitches #3

Open
karlicoss opened this issue Nov 21, 2020 · 10 comments
Open

firefox: Alt key is a default menu binding, causes glitches #3

karlicoss opened this issue Nov 21, 2020 · 10 comments

Comments

@karlicoss
Copy link

https://support.mozilla.org/en-US/questions/1278533

Unlike in Chrome, the Firefox add-on persists the tooltips when holding alt + in addition this switches the menu on/off (might be annoying for some people).

Let me know if you can't reproduce, I can record a video! I'm on Ubuntu, in case it matters.

@posobin
Copy link
Owner

posobin commented Nov 21, 2020

You mean when letting go of Alt the popups still stay? Maybe because the menu that appears steals the keyboard focus and the keyup event for Alt is not fired. Could you check if the blur event for a document is fired after pressing alt? I guess I might have to offer a choice between {Alt, Ctrl}+(Shift)?, would holding down Ctrl be problematic? What about Meta?

@karlicoss
Copy link
Author

You mean when letting go of Alt the popups still stay?

Yep! I think the more annoying thing however is that it toggles the menu, which shifts the whole page down, so might discourage people from using it.

Tried this:

document.addEventListener('blur' , () => console.error("BLUR"));
document.addEventListener('focus', () => console.error("FOCUS"));

However pressing Alt doesn't trigger either of these. I'd imagine it's more of OS-level stuff.. I'd be surprised if you'd manage to bind Shift; Meta might work, but it also might conflict with the global menu key for some people. It's sad it's so complicated, but adding some sort of setting for this might be the best option :(

@karlicoss
Copy link
Author

Also, just realized, I have some other Alt bindings (e.g. Alt+j/k), and they work fine without causing the menu to toggle. In fact, I can press any non-existing Alt binding (e.g. Alt-F), and it causes Ampie to pop up without showing the window menu!

@posobin
Copy link
Owner

posobin commented Nov 25, 2020

I added the ability to switch to meta/ctrl/shift or disable it completely in the settings (you need to click the ampie icon in the extensions toolbar to open it). Does it work for you?

@karlicoss
Copy link
Author

Uhoh, it's not loading, just all white (was working before!) :(
image

Oddly, I can't run devtools against it, but in the background page there are a bunch of warnings, perhaps they are relevant

09:22:40.125 The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. popup.html
09:22:40.149
sendRemoveListener on closed conduit {4ca7b2f4-ff6f-4599-a39b-9f776f3e8ba6}.1374390572883 ConduitsChild.jsm:108
09:22:40.150
Promise resolved after context unloaded
popup-page.js:1545
09:22:40.151
Promise resolved after context unloaded
popup-page.js:1418
09:23:23.005
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. background.js:1

@posobin
Copy link
Owner

posobin commented Nov 26, 2020

Very weird, does this stay after you restart the browser? The messages look like the extension was unloaded after the popup page was opened, or the popup is running a different version of the source somehow.

@posobin
Copy link
Owner

posobin commented Nov 26, 2020

I took my old linux laptop out and can't reproduce this on firefox.

@karlicoss
Copy link
Author

Huh, indeed, after restart it works fine, thanks!
Yeah, I also remember now I had some issues with my extension after update unless I restarted. I think there is some extension lifecycle method one can listen on, but don't remember exactly.

@karlicoss
Copy link
Author

Hmm interesting, happened again after I briefly turned extension off and then back on. I'll see if I can consistently reproduce.

@karlicoss
Copy link
Author

P.S. oh sorry, and back to the original issue -- the hotkey selection works, thanks! I'll try Shift in the meantime, hopefully it won't conflict with anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants