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

Allow overriding ctrl-w using a webextension command #103

Closed
tbodt opened this issue Sep 20, 2019 · 11 comments · Fixed by #481
Closed

Allow overriding ctrl-w using a webextension command #103

tbodt opened this issue Sep 20, 2019 · 11 comments · Fixed by #481

Comments

@tbodt
Copy link

tbodt commented Sep 20, 2019

https://developer.chrome.com/extensions/commands

If you create a command, then go to the extension keyboard shortcut settings and map ctrl-w to it, that will override the close tab shortcut. This may also work with firefox.

@glacambre
Copy link
Owner

Hi, thanks for pointing this out, I had completely forgotten about the commands API. This API doesn't let you override what happens when you press <C-w> on Firefox, which was the only browser I supported when I wrote the Drawbacks section of the readme.
I'll see what I can do for Chrome :).

@NilsIrl
Copy link
Contributor

NilsIrl commented Jan 8, 2020

According to the description of this addon, this might only be the case on Linux.

Related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1325692

glacambre added a commit that referenced this issue Mar 22, 2020
glacambre added a commit that referenced this issue Mar 22, 2020
@glacambre
Copy link
Owner

I've implemented the ability to override <C-n>, <C-t> and <C-w> (which are the only 3 keyboard shortcuts that can't be overriden on Chrome AFAIK) in 8c73600, read this to discover how to use it :).
Note that this is currently only available if you build the browser extensions from source - otherwise you'll have to wait for me to publish a new release.

@Freed-Wu
Copy link
Contributor

Thanks!

@glacambre
Copy link
Owner

glacambre commented Mar 14, 2021 via email

@glacambre
Copy link
Owner

Yes, you can narrow the replacement by using key id="key_close" data-l10n-id="close-shortcut" command="cmd_close" modifiers="accel" reserved="true" as the pattern and key id="key_close" data-l10n-id="close-shortcut" command="cmd_close" modifiers="accel" as the replacement :)

@glacambre
Copy link
Owner

But shouldn't the regex be like this (the spaces replacing the reserved attribute)?

Yeah, probably :)

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

Successfully merging a pull request may close this issue.

5 participants
@tbodt @glacambre @NilsIrl @Freed-Wu and others