dpacassi / disable-javascript

Adds the ability to disable JavaScript on specific sites.
MIT License
275 stars 36 forks source link

Shortcuts conflict #4

Closed yuriiz closed 6 years ago

yuriiz commented 6 years ago

Alt+1, Alt+2, ... are built-in Firefox shortcuts on Linux to go to tab number 1, 2, ... and are not supposed to be used by any extension.

bayuah commented 6 years ago

Yeah. It should be any way to disable/enable or change it.

cuducos commented 6 years ago

Yes, please: I use Alt + <number> a lot and it's been really annoying to have this shortcut kidnapped by this extension, (which is awesome BTW, many many thanks, @dpacassi!)…

cuducos commented 6 years ago

Just in case: while this is still an issue, I'm using version 1.1.0 – anyone can install it from the all versions page.

dpacassi commented 6 years ago

Hi guys!

First off, thanks for your feedback. It's true, I didn't test the shortcuts on Linux but on Windows and Mac (Firefox & Chrome) the shortcuts appeared to be free (with the EN-US locale). Tab switching on Windows & Mac is done with Ctrl (Cmd) and going for the alt key seemed like a nice solution as I'm not a big fan of three keys for shortcuts.

I would have liked a generic approach where people can customize the shortcuts at will but currently this is not supported by the web extension API. I therefor follow your suggestions to change the shortcuts.

Seems like Alt+Shift+D (for toggling) and Alt+Shift+S (for settings) are free on Mac and Windows. What do you guys think? I'm also open for better proposals :)

bayuah commented 6 years ago

Is enable/disable the shortcut possible? Because for me, personally, prefer clicking the cute icon on the top.

dpacassi commented 6 years ago

Well, using shortcuts doesn't remove the cute icon from the top ;-) I think if we find nice shortcuts, which don't collide with standard shortcuts, it should be fine? AFAIK adding/removing or enabling/disabling shortcuts programmatically is not possible yet with the web extensions API.

dpacassi commented 6 years ago

Labeling as help wanted to get proposals or feedback to my new shortcuts proposal.

cuducos commented 6 years ago

Just tested (Firefox, 58.0.1 using Debian sid):

Alt + Shift + D seems free (I tried it and nothing happened), but Alt + Shift S opens History textual menu (which is bizarre, just Alt + S is the proper shortcut; as nothing is set to Alt + Shift + S it might be overwriting it).

Anyway, the shortcuts suggested here LGTM…

dpacassi commented 6 years ago

I've created a branch with the proposed new shortcut commands Alt+Shift+D and Alt+Shift+S. However, the second command didn't work for me on Ubuntu 16.04 with Firefox 58.0.2. The first command doesn't work if a form element has focus on Mac OS. Quite strange, but you can test it by downloading https://github.com/dpacassi/disable-javascript/archive/shortcuts-proposal-alt-shift-d.zip

I've created another branch with the shortcut commands Alt+Shift+1 and Alt+Shift+2, you can download it from here: https://github.com/dpacassi/disable-javascript/archive/shortcuts-proposal-alt-shift-1.zip This shortcuts seem to work on every OS and Firefox + Chrome for me. I therefor propose to change the shortcuts to Alt+Shift+1 and Alt+Shift+2.

What do you guys think? Any feedback is welcome! @cuducos @yuriiz @bayuah @ed-w-lee

(I'm planning to publish a new release this weekend so people don't get used too fast to the existing shortcuts.)

bayuah commented 6 years ago

I confirm that Alt+Shift+D and Alt+Shift+S are worked properly on my Lubuntu 14.04 system.

And fortunately those aren't conflict with any of my other custom global shortcuts. :smile:

By the way, I also did manually check ${HOME}/.config/openbox/lubuntu-rc.xml to see if there's any conflict too. This is the file where your keyboard shortcuts configuration is placed which you can easily customized.

Sorry, out of the topic: Is there any translation plan?

cuducos commented 6 years ago

I couldn't test it here (couldn't install the .zip nor the extracted files), but both combinations of shortcuts seems non-conflicting ; )

bayuah commented 6 years ago

@cuducos: Try this: https://blog.mozilla.org/addons/2015/12/23/loading-temporary-add-ons/

dpacassi commented 6 years ago

@bayuah My new proposal is Alt+Shift+1 and Alt+Shift+2 since I had trouble with the other ones on Mac and Ubuntu 16.04. Are those shortcuts for you okay as well? :)

@cuducos Yeah, you can follow the steps provided above. Basically you only need to unpack the zip file, access about:debugging from Firefox and load the manifest.json file from the unpacked zip file. If you don't want to mess up your current Firefox addons, you can install Firefox Developer Edition.

I will add documentation on how to do this in the future (see #9).

cuducos commented 6 years ago

Many thanks you both :+1: I'm not much experienced in dev for browsers ; )

Alt + Shift + 1 and Alt + Shift + 1 working here (Debian, Firefox). Yay :tada:

bayuah commented 6 years ago

@dpacassi: I also confirm that Alt+Shift+1 and Alt+Shift+2 are worked properly on my Mozilla Firefox 58.0.2 of Lubuntu 14.04 system with no conflict.

sverde1 commented 6 years ago

Alt + Shift + 2 is conflicting on OS X opens settings page when I want to type "at" (@) sign. Please add option to disable shortcuts, I personally don't see need for them..

dpacassi commented 6 years ago

Thanks everyone for helping out on this one! I've created a new release, the web extension should update itself in the next 24 hours.

I not only changed the shortcuts but I also added a setting where you can define if you want to use short cuts or not.