MozillaZine

keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Elaphe666
 
Posts: 2
Joined: July 3rd, 2017, 3:39 am

Post Posted July 14th, 2017, 3:48 am

morat wrote:@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



Thank you. I have been able to make it work (I had to tick the global option). However, when I assign it to Ctrl C, the normal behaviour of this hotkey (copying text to the clipboard, for instance) no longer works. Is there any way to have both functions working at the same time (normal Ctrl C behaviour and the copy url hovering a url special function)?

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

Post Posted July 14th, 2017, 4:42 am

@Elaphe666

Try this:

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

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

Post Posted July 15th, 2017, 12:57 pm

morat wrote:@kramb21

Try this:

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

@Elaphe666


Thank you so much! It works perfectly!

nerbrume
 
Posts: 1
Joined: July 24th, 2017, 7:58 am

Post Posted July 24th, 2017, 8:06 am

Hi,

My Firefox recently switched to e10s, and I have some troubles.
I used to have a shortcut that search for the selected text (probably taken from here :P ) :
Code: Select all
goDoCommand('cmd_copy');
var paste = readFromClipboard();
if(!paste)
  return;
gBrowser.selectedTab = gBrowser.addTab('https://www.google.com/search?q='+paste);

However, this does not work : the searched term is the previous content of the clipboard, rather than the selected text. But if I hit the shortcut again, while on the "wrong search" tab, the new opened search is made on the correct term.
In other words : cmd_copy is correctly executed, but readFromClipboard() is somehow executed before.

Any ideas ?

avada
 
Posts: 1742
Joined: February 10th, 2008, 6:30 am
Location: Hungary

Post Posted July 30th, 2017, 2:32 am

morat wrote:@avada

Try something like:

Code: Select all
var url = content.document.location.href;
var localFile = Components.classes["@mozilla.org/file/local;1"].
  createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes["@mozilla.org/process/util;1"].
  createInstance(Components.interfaces.nsIProcess);
var args = ["--incognito", url];
localFile.initWithPath("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe");
process.init(localFile);
process.run(false, args, args.length);
avada wrote:Hmmm... Nothing seems to be happening.
I assume I need to change the chrome path to yt-dl's?

Update:
So if I use this code via custom buttons it works

Here's the modified code:
Code: Select all
var url = content.document.location.href;
var localFile = Components.classes["@mozilla.org/file/local;1"].
  createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes["@mozilla.org/process/util;1"].
  createInstance(Components.interfaces.nsIProcess);
var args = [url];
localFile.initWithPath("d:\\Path\\to\\YTDL\\youtube-dl.exe");
process.init(localFile);
process.run(false, args, args.length);


For whatever reason nothing happens with keyconfig. Anyway, it'll serve... Thanks a lot!


Hi Morat!
I want to tweak the code to pass an argument to a download folder, but I'm failing as usual...

This is what I'm trying:
Code: Select all
var url = content.document.location.href;
var localFile = Components.classes["@mozilla.org/file/local;1"].
  createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes["@mozilla.org/process/util;1"].
  createInstance(Components.interfaces.nsIProcess);
var args = ["-o "d:\Letöltés\%(title)s.%(ext)s\"", url];
//var args = [url];
localFile.initWithPath("d:\\Programok\\videó\\CLI\\youtube-dl.exe");
process.init(localFile);
process.run(false, args, args.length);


I guess I'm missing some syntax/escape peculiarity but I don't know what. Do you have tip? (If you're still around)

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

Post Posted July 30th, 2017, 6:06 am

@avada

Try this:

Code: Select all
var url = content.document.location.href;
var localFile = Components.classes["@mozilla.org/file/local;1"].
  createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes["@mozilla.org/process/util;1"].
  createInstance(Components.interfaces.nsIProcess);
var args = ["-o", "D:\\Letöltés\\%(title)s.%(ext)s", url];
localFile.initWithPath("D:\\Programok\\videó\\CLI\\youtube-dl.exe");
process.init(localFile);
process.run(false, args, args.length);

Reference
http://github.com/rg3/youtube-dl/blob/master/README.md

avada
 
Posts: 1742
Joined: February 10th, 2008, 6:30 am
Location: Hungary

Post Posted July 30th, 2017, 7:16 am

morat wrote:@avada

Try this:

Code: Select all
var url = content.document.location.href;
var localFile = Components.classes["@mozilla.org/file/local;1"].
  createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes["@mozilla.org/process/util;1"].
  createInstance(Components.interfaces.nsIProcess);
var args = ["-o", "D:\\Letöltés\\%(title)s.%(ext)s", url];
localFile.initWithPath("D:\\Programok\\videó\\CLI\\youtube-dl.exe");
process.init(localFile);
process.run(false, args, args.length);

Reference
http://github.com/rg3/youtube-dl/blob/master/README.md


Thanks! This seems to work.

I expected something like this to fail (if there's a space in the title) because of the lack of quotes around the path.

evo_9
 
Posts: 2
Joined: July 25th, 2017, 9:21 am

Post Posted August 7th, 2017, 10:42 am

How does one figure out how to create an entirely new shortcut? Aka, I want to add a shortcut for 'Email Link...' and since it currently does not have a shortcut, I can't easily re-assign it. What are the steps I need to take to determine the code to create a short-cut for this? Tutorial/wiki somewhere explains this?

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

Post Posted August 7th, 2017, 2:47 pm

@evo_9

Here is the command for the Email Link menu item in the File menu.

Code: Select all
MailIntegration.sendLinkForBrowser(gBrowser.selectedBrowser);

Instructions:

* open keyconfig window
* add a new key
* type a command in the /* CODE */ box, e.g. alert("test");
* type a shortcut in the <Disabled> box, e.g. Ctrl+Shift+!
* apply
* close

Springtime
 
Posts: 68
Joined: November 8th, 2013, 8:59 pm

Post Posted August 21st, 2017, 2:32 am

Quote-bumping in case anyone knows:

Springtime wrote:Regarding Dorando keyconfig, it states that it's Firefox for Android compatible but after installation there doesn't appear to be any way of accessing the settings. Is the compatibility for Android just an automatic label or is there indeed a way of using it on mobile?

Asking as I've been seeking a way to add hotkeys to the Firefox for Android browser, since I have a Blackberry physical keyboard and I'm used to the native browser hotkeys of 'T' for scroll to top, 'B' for scroll to bottom, etc. And also as the Firefox for Android toolbar lacks a back button. Would be marvelous to be able to recreate them.

Cleverson
 
Posts: 11
Joined: March 11th, 2009, 3:09 pm

Post Posted September 10th, 2017, 10:54 am

Hello, please how is the procedure for installing Dorando_keyconfig on Thunderbird? I've managed to download the XPI file, but there seems to be no option anywhere in TB to open an extension file. I also went to the add-ons manager > add, but it simply displays a web page for choosing an add-on, then when I choose one, instead of installing the extension, it prompts me to open or save the file. If I choose Open, it rather opens a new blank message.

Uinsg Thunderbird 52.3 on Windows 10.

WildcatRay

User avatar
 
Posts: 7426
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Post Posted September 10th, 2017, 10:58 am

Choose the drop down button at the top of the add on manager page and choose install from file option.
Ray

OS'es: 4 computers with Win10 (1703) Pro 64-bit; Current Firefox ESR, Beta, Nightly

Cleverson
 
Posts: 11
Joined: March 11th, 2009, 3:09 pm

Post Posted September 10th, 2017, 11:06 am

Thank you! That was the only thing I forgot to do... :-)

rocco.xyz
 
Posts: 24
Joined: December 28th, 2015, 10:54 pm

Post Posted September 22nd, 2017, 1:48 am

Hi guys. :)
I would like to know how to create a hotkey to show the drop-down list of the "back" and "forward" buttons and assign them the keys "Alt + Shift+ Left Arrow" and "Alt + Shift + Right Arrow" respectively, and (if possible) move the pointer there when pressed.
Image

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

Post Posted September 22nd, 2017, 5:50 am

rocco.xyz,

This is not a keyconfig solution, but there is an add-on called Back/forward Dropmarker

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 2 guests