MozillaZine

keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
hife
 
Posts: 5
Joined: May 20th, 2014, 6:38 am

Post Posted June 5th, 2017, 12:29 pm

morat wrote:http://kb.mozillazine.org/Keyconfig_ext ... rnal_links
[...]
It's okay, but link the following page in the external links section.

viewtopic.php?p=12492305#p12492305

It has a version with a confirm dialog to copy the command and a link to the original version.


Hi again, sorry for the delay, I don't have a KB account, so I couldn't add the link. If someone with an account could add it, I'm sure it will be helpful for people in the future.

bob99
 
Posts: 71
Joined: July 9th, 2006, 2:04 am

Post Posted June 23rd, 2017, 5:21 pm

Disabling the spacebar-pagedown function doesn't work when multiprocessing is enabled. Will this be fixed later? Using FF54.

Oomingmak
 
Posts: 162
Joined: July 10th, 2004, 7:46 pm
Location: UK

Post Posted June 29th, 2017, 3:20 pm

Can anyone tell me what command I would need to use to assign a hotkey to uBlock Origin''Zapper' and 'Picker' feature?

https://www.ghacks.net/2017/06/21/ubloc ... sp-filter/


UBlock removed the hotkeys from Firefox in the latest release, and the user is instructed to enter them manually into about:config. However, I already have many KeyConfig keys set up and would rather have these new keys added in KeyConfig so that they are all in once place (besides which, I couldn't even get the hotkey to work when using about:config).

By the way, I tried using Event Listener to figure out the code, but it gets disabled as soon as I press the uBlock icon. If I open the uBlock dialog in advance and then run Event Listener,when I click on the uBlock Zapper icon, nothing happens. Event listener doesn't give any results. Other buttons on the toolbar do work though. Just not uBlock.

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

Post Posted June 30th, 2017, 9:38 am

@Oomingmak

If you set up the shortcuts in uBO...

user_pref("extensions.ublock0.shortcuts.launch-element-picker", "alt-x");
user_pref("extensions.ublock0.shortcuts.launch-element-zapper", "alt-z");

Then you can run the commands in keyconfig...

Code: Select all
document.getElementById("uBlock0Key-launch-element-picker").doCommand();

Code: Select all
document.getElementById("uBlock0Key-launch-element-zapper").doCommand();

I don't know how to run the commands using the popup.

Code: Select all
// fails
var popupUrl = "chrome://ublock0/content/popup.html";
document.getElementById("ublock0-button").click();
setTimeout(function () {
  var panel = document.getElementById("customizationui-widget-panel");
  var panelmultiview = document.getElementById("customizationui-widget-multiview");
  var panelview = document.getElementById("ublock0-panel"); // anonymous content
  if (panel.hasAttribute("viewId") && panel.getAttribute("viewId") == "ublock0-panel") {
    // panel.setAttribute("noautohide", "true"); inspectDOMNode(panel); // dom inspector
    // alert(document.getAnonymousNodes(panelview)); // null
    // alert(document.getAnonymousElementByAttribute(panelview, "src", popupUrl)); // null
    // var iframe = ... // anonymous content
    // iframe.contentDocument.getElementById("gotoPick").click(); // picker
    // iframe.contentDocument.getElementById("gotoZap").click(); // zapper
    panel.hidePopup();
  }
}, 1000);

Maybe someone else knows how to get the iframe element.

VLMin
 
Posts: 55
Joined: April 14th, 2006, 7:15 pm

Post Posted June 30th, 2017, 10:21 am

morat, what you posted sounds like a complete solution. My problem is that I don't know what to put where. Would you be willing to add some instructions aimed at nonprogrammers? Thanks!

Oomingmak
 
Posts: 162
Joined: July 10th, 2004, 7:46 pm
Location: UK

Post Posted June 30th, 2017, 1:11 pm

Thank you SO much, Morat. It works perfectly!

Once again you have come to my rescue. I am most grateful.

Oomingmak
 
Posts: 162
Joined: July 10th, 2004, 7:46 pm
Location: UK

Post Posted June 30th, 2017, 2:05 pm

VLMin wrote:morat, what you posted sounds like a complete solution. My problem is that I don't know what to put where. Would you be willing to add some instructions aimed at nonprogrammers? Thanks!

Are you talking about morat's response to my post regarding uBlock?

If that's what you are talking about, then let me try to explain. It is very rare that a clueless a non-programmer like me is ever in a position to help (instead of just asking for assistance) so we'll leave morat to better use his time doing the serious 'heavy lifting', and I'll try to talk you through these basic steps. Please bear in mind that I am not experienced in these matters, so my method may not be the most elegant.


Assigning keyboard shortcuts to uBlock's Picker and Zapper tools


If you try to assign hotkeys to uBlock's Zapper and Picker tools by using KeyConfig's dialog, you won't be able to at first because the entries for those two functions won't show up in KeyConfig's list until the settings have been created. So first we create the two settings.

1. Close you browser (important!) and go to your Firefox Profile folder. In the profile folder locate a file called prefs.js. Make a copy of it for safe keeping (so that an unmodified version can be replaced if you mess anything up).

2. Open prefs.js in a text editor, and do a word search for shortcuts.launch-element-zapper. You should see two entries next to each other that both have extensions.ublock0.shortcuts.launch-element in their name (one for the Picker, and one for the Zapper).

3. Paste over only those 2 entries with the text below:

Code: Select all
user_pref("extensions.ublock0.shortcuts.launch-element-picker", "alt-x");
user_pref("extensions.ublock0.shortcuts.launch-element-zapper", "alt-z");


After pasting, the entries should be the same as they were before except for the addition of the alt-x and alt-z at then end of each line.

4. Save the prefs.js file, and then open Firefox.

5. Now when you go to KeyConfig's list of keys, there should be 2 new entries for uBlock. Click on the 'Name' column heading in KeyConfig's window to sort all the entries alphabetically and make the uBlock entries easier to find. One entry is called uBlock0Key-launch-element-picker, and the other is called uBlock0Key-launch-element-zapper.

6. Double click on the uBlock "Picker" entry. A pop-up window will open. In the large text box (underneath the 'Name' box) delete the semi-colon character that is in there (so that the large text box is completely empty) and then paste the following text into the box.

Code: Select all
document.getElementById("uBlock0Key-launch-element-picker").doCommand();


Now go up to the smaller 'Name' text box above it, delete the string of numbers, and then give your hotkey a descriptive name by typing into the Name box, something like: uBlock PIcker. Press the 'OK' button to save the change.

7. You will now have a new entry in your KeyConfig list called "uBlock Picker". Click on it once, and press your preferred hotkey combination into the hotkey text box at the bottom of the KeyConfig window, then the press the 'Apply' button.

You have now assigned a hotkey for the Picker.

8. Now repeat steps 6 and 7, but this time for the Zapper. Double click on the uBlock0Key-launch-element-zapper entry to open the pop-up window. Make sure the large text box is empty, and this time paste the command for the zapper (shown below)

Code: Select all
document.getElementById("uBlock0Key-launch-element-zapper").doCommand();


Delete the string of numbers from the smaller 'Name' text box, and give the hotkey a descriptive name - e.g. uBlock Zapper. Find the new uBlock Zapper entry in the KeyConfig list, click it once and assign your preferred hotkey by pressing the desired hotkey combination in hotkey box at the bottom of the KeyConfig window. Press the 'Apply' button to save your changes.

Done!

Your hotkeys should now work in the browser.

VLMin
 
Posts: 55
Joined: April 14th, 2006, 7:15 pm

Post Posted June 30th, 2017, 4:00 pm

Oh my goodness, Oomingmak, what a PERFECT set of instructions! I've saved them offline … THANK YOU!!!!! :lol:

Oomingmak
 
Posts: 162
Joined: July 10th, 2004, 7:46 pm
Location: UK

Post Posted June 30th, 2017, 4:41 pm

@ VLMin

You're welcome.

kramb21
 
Posts: 5
Joined: October 31st, 2013, 2:05 am

Post Posted July 3rd, 2017, 2:20 am

Hi,

I used to open Google with the following script:

Code: Select all
BrowserOpenTab();
loadURI('google.de');
_content.focus(document.va);


Since the last Fireforx update, the cursor is active in the address bar, instead of Google search bar.

I would really appreciate your helpt!

Thank you

Elaphe666
 
Posts: 2
Joined: July 3rd, 2017, 3:39 am

Post Posted July 3rd, 2017, 3:42 am

Hello. I would like to know how to add a ctrl + c or any other hotkey to be able to copy a url to the clipboard simply by hovering my mouse pointer over a link and pressing that hotkey. Thanks.

chirpy_7
 
Posts: 165
Joined: March 19th, 2007, 6:24 am

Post Posted July 10th, 2017, 4:17 am

hey there. attempting to migrate from an older computer to a new one and carry keyconfig with me. everything seems to work, except for two rather vital bits:

- ctrl-c copy no longer works from the main window (it does, however, work in the url-bar, etc; and also from the "right-click" context menu)
- pg-up/dwn no longer works
- cursor-arrow up/dwn also no longer works

if I disable keyconfig, the three items above work as expected. I searched through keyconfig and about:config but as yet to no avail. any advice how to diagnose and remedy would be MUCH appreciated!!!

ps: happy 10-year anniversary :-))

chirpy_7
 
Posts: 165
Joined: March 19th, 2007, 6:24 am

Post Posted July 10th, 2017, 1:52 pm

SOLVED.

(reset FF (on the new machine) and then painstakingly added my keys one-by-one).

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

Post Posted July 12th, 2017, 12:38 pm

@kramb21

Try this:

Code: Select all
gBrowser.selectedTab = gBrowser.addTab("https://www.google.de/");

@Elaphe666

Try this:

Code: Select all
if (XULBrowserWindow.overLink) {
  Components.classes["@mozilla.org/widget/clipboardhelper;1"].
    getService(Components.interfaces.nsIClipboardHelper).
      copyString(XULBrowserWindow.overLink);
}

Similar post: viewtopic.php?p=9739973#p9739973

nohamelin
 
Posts: 85
Joined: September 3rd, 2013, 4:04 pm
Location: Chile

Post Posted July 13th, 2017, 9:45 pm

Somebody have a snippet to insert an arbitrary text string in html textboxes compatible with e10s? I have been using the following, and the FireGestures site have another (Insert text), but neither of these are e10s compatible.

Code: Select all
var str = "dududu";
var editor = (commandDispatcher.focusedElement instanceof Components.interfaces.nsIDOMNSEditableElement)
           ? commandDispatcher.focusedElement.editor : null;
if (editor) {
    editor instanceof Components.interfaces.nsIPlaintextEditor;
    editor.insertText(str);
}

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 1 guest