MozillaZine

keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
morat
 
Posts: 2287
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 7th, 2016, 6:52 am

@Oomingmak

Try this:

Code: Select all
// select or add tab
var url = "http://www.mozillazine.org/"
for (var i = 0; i < gBrowser.tabContainer.childNodes.length; i++) {
  if (gBrowser.tabContainer.childNodes[i].linkedBrowser.currentURI.spec == url) {
    gBrowser.selectedTab = gBrowser.tabContainer.childNodes[i];
    return;
  }
}
gBrowser.selectedTab = gBrowser.addTab(url);

Test
http://www.mozillazine.org/

@TBDTBD

Try this:

Code: Select all
// tools > options > composition > addressing > directory server
// toggle between "None" and "Global"
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"].
  getService(Components.interfaces.nsIPrefBranch);
var pref = "ldap_2.autoComplete.directoryServer";
var directoryServer = prefBranch.getCharPref(pref);
if (directoryServer) {
  prefBranch.clearUserPref(pref);
} else {
  prefBranch.setCharPref(pref, "ldap_2.servers.Global");
}

nsIPrefBranch
http://developer.mozilla.org/en-US/docs ... PrefBranch

I'm using the following button to easily tell what preference corresponds to what option.

Custom Buttons
http://addons.mozilla.org/thunderbird/addon/2707

Preferences Tracker
http://custombuttons.sourceforge.net/fo ... f=4&t=1262

TBDTBD
 
Posts: 12
Joined: April 24th, 2015, 11:23 pm

Post Posted December 7th, 2016, 9:39 am

@morat

Thanks for the quick response. The code changes Global into None, which is perfect. However, it changes None into "blank". That is, after running the code when the preference was initially None, there is no selection at all. The last line of the code does not seem to be working...

Thanks!

morat
 
Posts: 2287
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 7th, 2016, 10:47 am

@TBDTBD

Open the about:config window and search for the "directoryServer" string.

Tools > Options > Advanced > General > Config Editor

Are these the only directoryServer preferences in the about:config window?

1. ldap_2.autoComplete.directoryServer
2. mail.identity.default.directoryServer

Manually change the directory server from "None" to "Global" in the Options dialog.

Tools > Options > Composition > Addressing > Directory Server

Did the value of preference (1) change? What is the value?
Did the value of preference (2) change? What is the value?

TBDTBD
 
Posts: 12
Joined: April 24th, 2015, 11:23 pm

Post Posted December 7th, 2016, 11:05 am

@morat

Thanks a lot again. Now it works perfectly!

Speckles
 
Posts: 4
Joined: December 8th, 2016, 5:16 pm

Post Posted December 8th, 2016, 6:21 pm

Hello, I'm looking for help trying to use Ctrl + Left/Right arrow to navigate tabs with e10s enabled.

Other Dorando Keyconfig custom keys still work when enabling e10s, but not these:

Image

I'm using Firefox 64 bit stable on Windows 7. Thanks for any and all help!

emf10679
 
Posts: 20
Joined: April 15th, 2009, 8:07 pm

Post Posted December 14th, 2016, 10:30 pm

I'd like to go to full screen with (left) Alt + Enter (It's not easy to find F11). How do I do this?

Thanks,

emf

--
Firefox 50, Windows 7 64 bit

morat
 
Posts: 2287
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 16th, 2016, 11:25 am

@Speckles

Try this:

Code: Select all
// e10s code
// select tab to right
var win = Services.wm.getMostRecentWindow("navigator:browser");
if (win) {
  var browser = win.gBrowser;
  browser.tabContainer.advanceSelectedTab(1, true);
}

@emf10679

Try this:

Code: Select all
BrowserFullScreen();

P.S.

You can use the following code to easily extract commands.

Code: Select all
function getCommand(event) {
  window.removeEventListener("command", getCommand, true);
  event.preventDefault();
  event.stopPropagation();
  alert(event.originalTarget.getAttribute("oncommand") ||
    event.originalTarget.getAttribute("onclick"));
}
window.addEventListener("command", getCommand, true);

The trick does not work for all user interface elements.

Speckles
 
Posts: 4
Joined: December 8th, 2016, 5:16 pm

Post Posted December 16th, 2016, 8:25 pm

morat wrote:@Speckles

Try this:

Code: Select all
// e10s code
// select tab to right
var win = Services.wm.getMostRecentWindow("navigator:browser");
if (win) {
  var browser = win.gBrowser;
  browser.tabContainer.advanceSelectedTab(1, true);
}

Thank you morat, I tried pasting it into Dorando like this and it doesn't work:

Image

If I have to put it somewhere else on FF, I just don't know where, same with your "extract commands" code. Please tell me where. :)

Game-R
 
Posts: 23
Joined: October 6th, 2004, 7:21 pm

Post Posted December 17th, 2016, 12:40 am

[EDITED: Found the actual cause!]

For those who are, like me, having problems with getting custom coded keys to run, I have one likely cause for all this hair loss: S3 Menu Wizard

I found that this extension may have been interfering with KeyConfig and Dorando Keyconfig and causing custom Javascript keys to break.

Here's what you need to do to fix it :
- Open Menu Wizard's configuration screen
- Click on the keyboard shortcuts button in the upper right.
- Uncheck the "Keyboard Shortcuts" checkbox at the top to disable all of the shortcut keys.
- Go through the list and enable each of the shortcuts that you need, change the shortcut keys or disable the keys that have a conflict (indicated by a red warning label immediately below the shortcut entry textbox)
- Use KeyConfig or Dorando Keyconfig to add and code your custom Javascript keys, but set the keys or enable/disable the keys through Menu Wizard. This extension seems to take precedence over the other two and seems to override them.
Last edited by Game-R on December 18th, 2016, 12:56 am, edited 3 times in total.

morat
 
Posts: 2287
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 17th, 2016, 7:39 am

@Speckles

Okay. I enabled e10s in about:support.

Multiprocess Windows: 1/1 (Enabled by default)

The following code snippets works for me in trlkly's keyconfig and scratchpad in the browser environment.

Code: Select all
gBrowser.tabContainer.advanceSelectedTab(1, true);

Code: Select all
var win = Services.wm.getMostRecentWindow("navigator:browser");
if (win) {
  var browser = win.gBrowser;
  browser.tabContainer.advanceSelectedTab(1, true);
}

Keyconfig 2016.2 by trlkly
Firefox Portable 50.1.0

I'm not overly familiar with trlkly's keyconfig or e10s code so I won't be much help.

Speckles
 
Posts: 4
Joined: December 8th, 2016, 5:16 pm

Post Posted December 18th, 2016, 2:13 pm

morat wrote:The following code snippets works for me in trlkly's keyconfig and scratchpad in the browser environment.

Code: Select all
gBrowser.tabContainer.advanceSelectedTab(1, true);

Code: Select all
var win = Services.wm.getMostRecentWindow("navigator:browser");
if (win) {
  var browser = win.gBrowser;
  browser.tabContainer.advanceSelectedTab(1, true);
}

They're not working here. What key combination did you give them?

morat
 
Posts: 2287
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 18th, 2016, 4:05 pm

@Speckles

Shift+Ctrl+1
Shift+Ctrl+2
Last edited by morat on December 18th, 2016, 6:50 pm, edited 1 time in total.

Speckles
 
Posts: 4
Joined: December 8th, 2016, 5:16 pm

Post Posted December 18th, 2016, 5:50 pm

morat wrote:@Speckles

Shift+Ctrl+1
Shift+Ctrl+2[/code]


Those combinations work here but unfortunately not the ones I want to use:

Ctrl+Left arrow
Ctrl+Right arrow

With e10s enabled, that is.

emf10679
 
Posts: 20
Joined: April 15th, 2009, 8:07 pm

Post Posted December 21st, 2016, 7:40 pm

morat suggested that I try

BrowserFullScreen();

to be able to ope full screen using Alt+Enter.
So, in the keyconfig dialog I clicked [Add a new key], and in the new dialog I wrote the name FullScreen, pasted the code underneeth and clicked [OK]. Back in the main dialog, I selected the new FullScreen key, clicked Alt+Enter, and then clicked [Apply]. I restarted FF but FullScreen is still disabled.

What am I doing wrong?
Sorry for my ignorance,
eustace

morat
 
Posts: 2287
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 22nd, 2016, 6:39 am

@emf10679

The code works for me.

The Alt+Enter shortcut works for me.

Keyconfig 20110522
Firefox Portable 50.1.0
Last edited by morat on December 23rd, 2016, 6:37 am, edited 1 time in total.

Return to Extension/Theme Releases


Who is online

Users browsing this forum: Johan_et_Pirlouit and 1 guest