Bind switching tabs (previous/next) to F2/F3
-
- Posts: 40
- Joined: September 18th, 2008, 3:05 am
Bind switching tabs (previous/next) to F2/F3
Tried editing chrome/browser/content/browser/browser.xul in browser/omni.ja archive:
@@ -304,8 +304,8 @@
<key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
<key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
- <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
- <key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>
+ <key id="my_prevTab" key="VK_F2" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);" reserved="true"/>
+ <key id="my_nextTab" key="VK_F3" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);" reserved="true"/>
But can't make it work, both keys just move the tab backwards. Could somebody take a look?
@@ -304,8 +304,8 @@
<key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
<key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
- <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
- <key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>
+ <key id="my_prevTab" key="VK_F2" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);" reserved="true"/>
+ <key id="my_nextTab" key="VK_F3" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);" reserved="true"/>
But can't make it work, both keys just move the tab backwards. Could somebody take a look?
-
- Posts: 6406
- Joined: February 3rd, 2009, 6:29 pm
Re: Bind switching tabs (previous/next) to F2/F3
I would do it like so...
Remember to clear the javascript cache by adding the -purgecaches flag to the executable commandline.
I never used the reserved attribute.
Reference
view-source:chrome://browser/content/browser.xhtml
view-source:chrome://browser/locale/browser.dtd
Similar reply
http://forums.mozillazine.org/viewtopic ... #p14845838
P.S.
Isn't the omni.ja file signed now? I thought you couldn't hack it anymore.
Code: Select all
- <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
+ <key keycode="VK_F3" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);"/>
+ <key keycode="VK_F2" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);"/>
I never used the reserved attribute.
Reference
view-source:chrome://browser/content/browser.xhtml
view-source:chrome://browser/locale/browser.dtd
Similar reply
http://forums.mozillazine.org/viewtopic ... #p14845838
P.S.
Isn't the omni.ja file signed now? I thought you couldn't hack it anymore.
-
- Posts: 40
- Joined: September 18th, 2008, 3:05 am
Re: Bind switching tabs (previous/next) to F2/F3
morat
Now it works, thank you!
PS Apparently, not signed yet in 68esr.
Now it works, thank you!
PS Apparently, not signed yet in 68esr.
-
- Posts: 6406
- Joined: February 3rd, 2009, 6:29 pm
Re: Bind switching tabs (previous/next) to F2/F3
I tested...
The omni.ja files are not signed for Firefox Portable 68.2.0 esr build.
The omni.ja files are not signed for Firefox Portable 68.0.2 release build.
The omni.ja files are signed for Firefox Portable 69.0.3 release build.
The omni.ja files are signed for Firefox Portable 70.0 release build.
Command Prompt:
The omni.ja files are not signed for Firefox Portable 68.2.0 esr build.
The omni.ja files are not signed for Firefox Portable 68.0.2 release build.
The omni.ja files are signed for Firefox Portable 69.0.3 release build.
The omni.ja files are signed for Firefox Portable 70.0 release build.
Command Prompt:
Code: Select all
rem testing with unzip by info-zip
unzip -l omni.ja | find "META-INF"
unzip -l browser\omni.ja | find "META-INF"
-
- Posts: 40
- Joined: September 18th, 2008, 3:05 am
Re: Bind switching tabs (previous/next) to F2/F3
So, can one edit omni.ja in the 78esr?
-
- Posts: 6406
- Joined: February 3rd, 2009, 6:29 pm
Re: Bind switching tabs (previous/next) to F2/F3
I tested...
The omni.ja files are signed for Firefox Portable 78.2.0 esr build.
The omni.ja files are signed for Firefox Portable 80.0 release build.
The omni.ja file is not signed for Thunderbird Portable 68.12.0 release build.
The omni.ja file is not signed for Thunderbird Portable 78.2.0 test build.
I know I can't hack a signed extension so I assume I can't hack a signed omni.ja file. That's the whole point of signing.
The omni.ja files are signed for Firefox Portable 78.2.0 esr build.
The omni.ja files are signed for Firefox Portable 80.0 release build.
The omni.ja file is not signed for Thunderbird Portable 68.12.0 release build.
The omni.ja file is not signed for Thunderbird Portable 78.2.0 test build.
I know I can't hack a signed extension so I assume I can't hack a signed omni.ja file. That's the whole point of signing.
-
- Posts: 40
- Joined: September 18th, 2008, 3:05 am
Re: Bind switching tabs (previous/next) to F2/F3
morat
thank you for testing.
So is there any correct way to implement what I want?
Where is in the code that 'signature activated' flag? Maybe it's a 1 -byte patch in libxul.so?
BTW, ESR editions can disable addon signatures, so omni.ja signature check will then be disabled, too?
If it is, then it's all right. Nothing's changed for me. Gotta check, though.
thank you for testing.
So is there any correct way to implement what I want?
Where is in the code that 'signature activated' flag? Maybe it's a 1 -byte patch in libxul.so?
BTW, ESR editions can disable addon signatures, so omni.ja signature check will then be disabled, too?
If it is, then it's all right. Nothing's changed for me. Gotta check, though.
-
- Posts: 6406
- Joined: February 3rd, 2009, 6:29 pm
Re: Bind switching tabs (previous/next) to F2/F3
I got the hack working in the browser console in Firefox 80.
Instructions:
* open about:config page
* set devtools.chrome.enabled preference to true
* open browser console i.e. tools > web developer > browser console
* copy and paste code into browser console command line
* press enter to run
Reference
http://searchfox.org/mozilla-release/se ... mainKeyset
http://searchfox.org/mozilla-release/se ... ortcut-alt
http://searchfox.org/mozilla-release/so ... ersion.txt
Maybe you could use the autoconfig.js and mozilla.cfg files to run the hack at startup.
More info
http://forums.mozillazine.org/viewtopic ... #p14845838
...
I think the Nightly and Developer Edition builds don't sign the omni.ja files. (not tested)
Instructions:
* open about:config page
* set devtools.chrome.enabled preference to true
* open browser console i.e. tools > web developer > browser console
* copy and paste code into browser console command line
* press enter to run
Code: Select all
(function () {
var keyset = document.getElementById("mainKeyset");
var key = document.querySelector('key[keycode="VK_F3"][command="cmd_findAgain"]');
keyset.removeChild(key);
var key = document.createXULElement("key");
key.setAttribute("id", "key_hack_next_tab");
key.setAttribute("keycode", "VK_F3");
key.setAttribute("oncommand", "gBrowser.tabContainer.advanceSelectedTab(1, true);");
keyset.prepend(key);
var key = document.createXULElement("key");
key.setAttribute("id", "key_hack_prev_tab");
key.setAttribute("keycode", "VK_F2");
key.setAttribute("oncommand", "gBrowser.tabContainer.advanceSelectedTab(-1, true);");
keyset.prepend(key);
})();
http://searchfox.org/mozilla-release/se ... mainKeyset
http://searchfox.org/mozilla-release/se ... ortcut-alt
http://searchfox.org/mozilla-release/so ... ersion.txt
Maybe you could use the autoconfig.js and mozilla.cfg files to run the hack at startup.
More info
http://forums.mozillazine.org/viewtopic ... #p14845838
...
I think the Nightly and Developer Edition builds don't sign the omni.ja files. (not tested)
-
- Posts: 40
- Joined: September 18th, 2008, 3:05 am
Re: Bind switching tabs (previous/next) to F2/F3
awesome, thanks!morat wrote:I got the hack working in the browser console in Firefox 80.
- dickvl
- Posts: 54146
- Joined: July 18th, 2005, 3:25 am
Re: Bind switching tabs (previous/next) to F2/F3
Note that you can easily check this in Firefox:
resource:///
resource://gre/
Nightly and DE show the META-INF folder.
resource:///
resource://gre/
Nightly and DE show the META-INF folder.
-
- Posts: 40
- Joined: September 18th, 2008, 3:05 am
Re: Bind switching tabs (previous/next) to F2/F3
I can confirm that editing (now) browser.xhtml and repacking omni.ja works on ESR 78.
-
- Posts: 40
- Joined: September 18th, 2008, 3:05 am
Re: Bind switching tabs (previous/next) to F2/F3
I can confirm that editing browser.xhtml and repacking omni.ja works on ESR 91.
- therube
- Posts: 21703
- Joined: March 10th, 2004, 9:59 pm
- Location: Maryland USA
Re: Bind switching tabs (previous/next) to F2/F3
As omni.ja has META-INF & META-INF has signatures for all the files in omni.ja, why does modifying omni.ja not invalid it?
And yes, I can confirm that mod'd instalDir/omni.ja (93.0, I changed greprefs.js) does work after mod.
(I have the mozilla-EMEfree release, though I don't think that should matter.)
And I suppose that your changes would need to be done again with every new FF release.
Could your changes be done through AutoConfig or policies.json?
And yes, I can confirm that mod'd instalDir/omni.ja (93.0, I changed greprefs.js) does work after mod.
(I have the mozilla-EMEfree release, though I don't think that should matter.)
And I suppose that your changes would need to be done again with every new FF release.
Could your changes be done through AutoConfig or policies.json?
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript