keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
User avatar
WildcatRay
Posts: 7486
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: keyconfig 20110522

Post by WildcatRay »

Cattleya wrote:I enabled Click to play feature by go to about:config -> change plugins.click_to_play to true.
But I want a hotkey to active all plugin in page, please help me, thanks!

Image

With the drop-down, you can choose the plugin or plugins you wish to activate on that page.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
Cattleya
Posts: 57
Joined: October 7th, 2010, 11:14 pm

Re: keyconfig 20110522

Post by Cattleya »

WildcatRay wrote:
Cattleya wrote:I enabled Click to play feature by go to about:config -> change plugins.click_to_play to true.
But I want a hotkey to active all plugin in page, please help me, thanks!

Image

With the drop-down, you can choose the plugin or plugins you wish to activate on that page.

Sorry, but what I need is a hotkey to active plugin in current page.
User avatar
WildcatRay
Posts: 7486
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: keyconfig 20110522

Post by WildcatRay »

Sorry about that. Hopefully, someone else can figure this out for you.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

rahul wrote:the keyconfig UI still uses the symbols, so Opt-Cmd-Z appears as ⌥⌘Ω (since Opt-Z produces the omega symbol). i had to change the Ω to a Z in prefs.js to get the shortcut working again.

what i haven't figured out is why it only affects *some* of my option-key shorcuts, but i'm guessing other mac users will run into this problem too. anyway, i figured bug 418091 would necessitate changing the symbols back to letters at some point.
The patch seems to only have an effect on <key>s with an empty or no key attribute, but the key attribute is used for characters like Ω (keycode is used for VK_*).

Maybe it was caused by the patch for Bug 492931 - Case change algorithm in DOM should use ASCII upper/lowercasing (Firefox 13) which was partly backed out in Bug 776075 - Command keys using upper-case non-ASCII characters are broken (Firefox 16).

kit kat wrote:Is there a way to switch the dTa! Selector button on and off in what shortcut?
Answered there.

Cleverson wrote:Dear, I've just migrated to Seamonkey. When reading RSS feeds, pressing Enter on a feed item opens it on a new window. I'd like Enter to open it in a new tab so it doesn't load the entire page. Currently, to open in a new tab I have to right click and choose that option.
The code responsible for that does run before it can reach a <key>, so keyconfig can't help here.

You could try setting the browser.tabs.opentabfor.doubleclick pref to true in about:config, which would change the behavior of Enter/Double Click in Mail & Newsgroups.

agiz wrote:I am long-time user of keyconfig, but after upgrading to Firefox 15 all my buttons stopped working.
I guess it has something to do with the fact i am using special characters "Ć Ž Đ".

But they dont work... and i am at a loss how to make it work again.
Any suggestions?

UPDATE: I found what the problem was. Keyconfig writes all characters into prefs.js in uppercase, but for those special characters it needed to be in lowercase (i have combination of CTRL + ć...).
All good again, but i think other people might have similar problems.
That might have been the same issue rahul encountered (see above), it does work again in Firefox 16.

nigelle wrote:- Is there a way to make them appears in the source and so access them with a short cut giving the content of the source ?
Assuming similar to the copy source code, you could try something like

Code: Select all

var request = new XMLHttpRequest();
request.open("GET", "view-source:"+content.location, false);
request.send(null);

var src = request.responseText;
src = src.replace(/<link[^]*?rel=['"]stylesheet['"][^]*?>/g, function(match){
 match.match(/href=['"](.*?)['"]/);
 request = new XMLHttpRequest();
 var p = RegExp.$1;
 request.open("GET", "view-source:"+( p.indexOf(":") > -1 ? p : content.location.href.match(".*/") + p), false);
 try { request.send(null); } catch(err){};
 return "<style><![CDATA["+request.responseText+"]]></style>";
});

src = src.replace(/@import.*?['"](.*?)['"]\)?(.*?);/g, function(match, p1, p2){
 request = new XMLHttpRequest();
 request.open("GET", "view-source:"+( p1.indexOf(":") > -1 ? p1 : content.location.href.match(".*/") + p1), false);
 try { request.send(null); } catch(err){};
 return p2 ? "@media"+p2+"{\n"+request.responseText+"\n}" : request.responseText;
});

src = src.replace(/(<script[^]*?src=['"](.*?)['"][^]*?>)\s*(<\/script>)/g, function(match, p1, p2, p3){
 request = new XMLHttpRequest();
 request.open("GET", "view-source:"+( p2.indexOf(":") > -1 ? p2 : content.location.href.match(".*/") + p2), false);
 try { request.send(null); } catch(err){};
 return p1+"<![CDATA["+request.responseText+"]]>"+p3;
});

var ClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);

ClipboardHelper.copyString(src.replace(/\n/g,"\r\n"));
nigelle wrote:- Is there a way to access the value (result given in the clipboard) of a js variable (name given in the clipboard) with a short cut ?
Try

Code: Select all

var target content.wrappedJSObject;
var 
steps readFromClipboard().split(".");
while(
steps.length)
 
target target[steps.shift()];

var 
ClipboardHelper Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.
getService(Components.interfaces.nsIClipboardHelper);

ClipboardHelper.copyString(target); 
, but be aware of Accessing unsafe properties.

chirpy_7 wrote:Both issues resolved; probably by upgrading to FF 16.0.1 (ubuntu).

Why it didn't work (for a few FF releases, starting with FF 13, see below) remains a mystery to me;
Due to version range, maybe it was the same issue rahul and agiz encountered (see above).

Hamid_Y2K wrote:previous code for "copy link location" work,but "copy link text" not working for me?
Try

Code: Select all

if(XULBrowserWindow.overLink)
 for (var 
0links content.document.linkslinks.length li++)
  if(
XULBrowserWindow.overLink == (gURLBar._mayTrimURLs trimURL(links[i].href) : links[i].href)) {
   
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
   .
getService(Components.interfaces.nsIClipboardHelper)
   .
copyString(links[i].text);

   break;
  } 
Hamid_Y2K wrote:and code for "options"?
Try

Code: Select all

openDialog("chrome://colt/content/options.xul""""centerscreen,resizable=no"); 

Cattleya wrote:I enabled Click to play feature by go to about:config -> change plugins.click_to_play to true.
But I want a hotkey to active all plugin in page, please help me, thanks!
Try

Code: Select all

gPluginHandler.activatePlugins(content); 
Support mozilla.dorando.at through donations/contributions.
Cattleya
Posts: 57
Joined: October 7th, 2010, 11:14 pm

Re: keyconfig 20110522

Post by Cattleya »

Thank dorando :)
Worked like a charm!
Hamid_Y2K
Posts: 20
Joined: July 8th, 2010, 4:59 am

Re: keyconfig 20110522

Post by Hamid_Y2K »

Thank you dorando.
It works again. :D
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

hello

i find hard to create new key bindings

i was expecting some easy gui like this:

http://cdn.ghacks.net/wp-content/upload ... rtcuts.png

but it seems it isnt available??

any easy tutorial? (easy = commands names are clearly expressing what they do)
User avatar
WildcatRay
Posts: 7486
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: keyconfig 20110522

Post by WildcatRay »

It's pretty straight forward. (For those who may not know, the code is added in the lower box of the Add a new key dialog.)

To add the key sequence to activate the code, with the item you want to add or change the key sequence to, highlight it and then press the key sequence you want it to be and then press the Apply button.

Hope this helps.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

-how do i compose the *CODE*? I know this link: http://kb.mozillazine.org/Keyconfig_extension:_Firefox but it has only few examples...
-what the 'global' tickbox does?
-creating a new key, it mentions in 'name' this: key1352585746056. i supposedly change it to whatever i want? to something relevant with the action it will perform?
User avatar
WildcatRay
Posts: 7486
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: keyconfig 20110522

Post by WildcatRay »

firefoxuse wrote:-how do i compose the *CODE*? I know this link: http://kb.mozillazine.org/Keyconfig_extension:_Firefox but it has only few examples...
-what the 'global' tickbox does?
-creating a new key, it mentions in 'name' this: key1352585746056. i supposedly change it to whatever i want? to something relevant with the action it will perform?

To write the code, you need to be a coder (I'm not one) and know how to go through Firefox, Thunderbird, etc. code to ID what it is you want to do (also something I am not).

I don't know what the Global box is, either.

Yes, you can name the new key whatever you want. I named a key that I added with the help of others here "Check for Update..." because it checks for updates to Firefox or Thunderbird.

I think most on here ask for help for whatever they wish to add to their program and those who know what to do graciously provide the code for them.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

okay

I want to
go to the 'tab right from the current tab', when i press '1'
and
go to the 'tab left from the current tab', when i press '2'

obviously this should NOT work when the cursor is inside a text box, either in a webpage or the address bar, search bar, etc

also, when i click 1 or 2, the search bar shouldnt show up, while it should show up when i type other stuff (i have enabled the 'search as you type' option)

any hint?
User avatar
tonymec
Posts: 734
Joined: October 15th, 2004, 2:58 am
Location: Ixelles (Brussels Capital Region, Belgium)
Contact:

Re: keyconfig 20110522

Post by tonymec »

firefoxuse wrote:okay

I want to
go to the 'tab right from the current tab', when i press '1'
and
go to the 'tab left from the current tab', when i press '2'

obviously this should NOT work when the cursor is inside a text box, either in a webpage or the address bar, search bar, etc

also, when i click 1 or 2, the search bar shouldnt show up, while it should show up when i type other stuff (i have enabled the 'search as you type' option)

any hint?

I don't know how to program that, but until someone comes around who does you can use the built-in shortcuts:
  • Ctrl+PgUp for "Next tab leftwards"
  • Ctrl+PgDn for "Next tab rightwards"
Both of them work round-robin: "next right" of the last tab is the first one, and "next left" from the first one is the last one.
Best regards,
Tony
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

thanks anyway

something else, anyone know the CODE for "paste & go" ???
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

firefoxuse wrote:thanks anyway

something else, anyone know the CODE for "paste & go" ???


anyone please???
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

firefoxuse wrote:-how do i compose the *CODE*? I know this link: http://kb.mozillazine.org/Keyconfig_extension:_Firefox but it has only few examples...
Try as a new key

Code: Select all

function getCommand(event) {
 
window.removeEventListener("command"getCommandtrue);
 
event.preventDefault();
 
event.stopPropagation();

 
alert(event.originalTarget.getAttribute("oncommand") || event.originalTarget.getAttribute("onclick"));
}

window.addEventListener("command"getCommandtrue); 
and click on a menuitem/button after pressing the combination for the new key (does work for many, but not all UI elements).
firefoxuse wrote:-what the 'global' tickbox does?
By default a <key> will only be created for windows of the same type as the one selected from the drop down (most likely the main application window), ticking that box makes the <key> available for all window types (since the available functions are different in other window types, the code might need to be adjusted to actually work).

firefoxuse wrote:go to the 'tab right from the current tab', when i press '1'
Try

Code: Select all

gBrowser.tabContainer.advanceSelectedTab(1,true); 
firefoxuse wrote:go to the 'tab left from the current tab', when i press '2'
Try

Code: Select all

gBrowser.tabContainer.advanceSelectedTab(-1,true); 
firefoxuse wrote:obviously this should NOT work when the cursor is inside a text box, either in a webpage or the address bar, search bar, etc

also, when i click 1 or 2, the search bar shouldnt show up, while it should show up when i type other stuff (i have enabled the 'search as you type' option)
The application does all the handling, but due to the way things work, the 'search as you type' code runs before any <key> (keyconfig adds/modifies those).

You could try to built an extension modifying the 'search as you type' code by opening your Profile and create within the extensions folder a folder named userxul@nobody containing:

install.rdf

Code: Select all

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns="http://www.mozilla.org/2004/em-rdf#">

 <rdf:Description rdf:about="urn:mozilla:install-manifest">
  <id>userxul@nobody</id>
  <name>User XUL</name>
  <version>0</version>

  <targetApplication><rdf:Description>
   <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
   <minVersion>1.0+</minVersion>
   <maxVersion>*</maxVersion>
  </rdf:Description></targetApplication>

 </rdf:Description>
</rdf:RDF>
chrome.manifest

Code: Select all

content userxul .
overlay chrome://browser/content/browser.xul chrome://userxul/content/browser.xul 
browser.xul

Code: Select all

<?xml version="1.0"?>

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/javascript"><![CDATA[ "use strict";
 window.addEventListener("load",function tempFunction(event) {
  this.removeEventListener(event.type, tempFunction, false);

  window.eval("gFindBar._shouldFastFind ="+ gFindBar._shouldFastFind.toString().replace(
  /( *)(var elt)/,
  '$1// userxul@nobody\n'+
  '$1if (aEvent.charCode == 49 || aEvent.charCode == 50)\n'+
  '$1  return false;\n\n'+
  '$1$2'));

 },false);
]]></script>

</overlay>
(note that the files should not contain any space at the start).

firefoxuse wrote:[…], anyone know the CODE for "paste & go" ???
Try

Code: Select all

gURLBar.select(); goDoCommand('cmd_paste'); gURLBar.handleCommand(); 
Support mozilla.dorando.at through donations/contributions.
Post Reply