Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

User Chrome javascript to change keyboard shortcuts stopped working

  • No replies
  • 0 have this problem
  • 3 views
more options

I have autoconfig.js set up to run my own js file, see below. The intention is to change the keyboard shortcuts (shame that it's so difficult😃). It worked until a few weeks ago. Now it only partly works. C+J is fine. The other two succeed in deleting the existing command, and the shortcut key does nothing. Any ideas please?

// C+J = open downloads var element = document.getElementById('key_openDownloads'); if (element) {

 element.setAttribute('key', 'j');
 element.setAttribute('modifiers', 'accel');

}

// C+D = Duplicate tab var element = document.getElementById('addBookmarkAsKb'); if (element) {

 element.removeAttribute('command');
 element.setAttribute('oncommand', "duplicateTabIn(gBrowser.selectedTab, 'tab')");

}

// CS+N = move tab to new window var element = document.getElementById('key_undoCloseWindow'); if (element) {

 element.removeAttribute('command');
 element.setAttribute('oncommand', 'gBrowser.replaceTabsWithWindow(gBrowser.selectedTab)');

}

I have autoconfig.js set up to run my own js file, see below. The intention is to change the keyboard shortcuts (shame that it's so difficult😃). It worked until a few weeks ago. Now it only partly works. C+J is fine. The other two succeed in deleting the existing command, and the shortcut key does nothing. Any ideas please? // C+J = open downloads var element = document.getElementById('key_openDownloads'); if (element) { element.setAttribute('key', 'j'); element.setAttribute('modifiers', 'accel'); } // C+D = Duplicate tab var element = document.getElementById('addBookmarkAsKb'); if (element) { element.removeAttribute('command'); element.setAttribute('oncommand', "duplicateTabIn(gBrowser.selectedTab, 'tab')"); } // CS+N = move tab to new window var element = document.getElementById('key_undoCloseWindow'); if (element) { element.removeAttribute('command'); element.setAttribute('oncommand', 'gBrowser.replaceTabsWithWindow(gBrowser.selectedTab)'); }

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.