keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
Bananasik
Posts: 12
Joined: November 7th, 2016, 3:10 am

Re: keyconfig 20110522

Post by Bananasik »

@morat

Sorry, its 'multiple tab handler' functionality. I`m using it since 2008, and thought its default lol.
http://i.imgur.com/NJAC3A1.png
morat
Posts: 6437
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Bananasik

The extension is rather complicated so I'm not sure if the code is correct.

Code: Select all

var tab = gBrowser.selectedTab;
MultipleTabService.setSelection(tab, true);
MultipleTabService.lastManuallySelectedTab = tab;
MultipleTabService.selectionChanging = true;
view-source:chrome://multipletab/content/multipletab.js

Multiple Tab Handler
http://addons.mozilla.org/firefox/addon/4838
Bananasik
Posts: 12
Joined: November 7th, 2016, 3:10 am

Re: keyconfig 20110522

Post by Bananasik »

@morat
THANK YOU!

Code: Select all

var tab = gBrowser.selectedTab;
MultipleTabService.setSelection(tab, true);
is working properly
Bananasik
Posts: 12
Joined: November 7th, 2016, 3:10 am

Re: keyconfig 20110522

Post by Bananasik »

And another request. A little harder this time.
Refresh timer for 2chan.net

I use macro for menu item selection <Apps><Up><Enter>
http://i.imgur.com/sLu3bEl.gif
But it does not always work correctly.



Extension http://nenaiko.sakura.ne.jp/nenaiko/
Address example is http://may.2chan.net/id/res/277036.htm
I think necessary code is in the beginning of content/contextmenu.js
morat
Posts: 6437
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Bananasik

Try this:

Code: Select all

nenaiko.threadmarking();
view-source:chrome://nenaiko/content/overlay.xul
view-source:chrome://nenaiko/content/contextmenu.js

You can use a menu item label to run a command.

Code: Select all

document.getElementsByAttribute("label", "スレをマーキング")[0].doCommand();
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.
Bananasik
Posts: 12
Joined: November 7th, 2016, 3:10 am

Re: keyconfig 20110522

Post by Bananasik »

@morat

You are definitely a lifesaver.
Especially for "code to easily extract commands"
I done everything i want.

And the last question.

Can keyconfig read the state of the command?
Something like this

Code: Select all

var tab = gBrowser.selectedTab;
MultipleTabService.setSelection(tab, true);

if already selected then do

var tab = gBrowser.selectedTab;
MultipleTabService.setSelection(tab, false);
Really want to select and unselect tabs with one button.
morat
Posts: 6437
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Bananasik

Try these:

Code: Select all

var tab = gBrowser.selectedTab;
if (MultipleTabService.isSelected(tab)) {
  MultipleTabService.setSelection(tab, false);
} else {
  MultipleTabService.setSelection(tab, true);
}

Code: Select all

var tab = gBrowser.selectedTab;
var mouseEvent = document.createEvent("MouseEvents");
mouseEvent.initMouseEvent(
 "mousedown" /* type          */,
  true       /* bubbles       */,
  true       /* cancelable    */,
  window     /* view          */,
  1          /* detail        */,
  0          /* screenX       */,
  0          /* screenY       */,
  0          /* clientX       */,
  0          /* clientY       */,
  true       /* ctrlKey       */,
  false      /* altKey        */,
  false      /* shiftKey      */,
  false      /* metaKey       */,
  0          /* button        */,
  null       /* relatedTarget */
);
tab.dispatchEvent(mouseEvent);
view-source:chrome://multipletab/content/multipletab.js
sridhar
Posts: 184
Joined: June 18th, 2004, 2:54 pm
Contact:

Re: keyconfig 20110522

Post by sridhar »

Does anyone know if it's possible to use Keyconfig in regular edition of Firefox?

This screenshot shows the problem: http://d.pr/i/ldX1

https://support.mozilla.org/en-US/kb/ad ... nced-users states that I need to use Firefox ESR version 45 or Developer Edition or Nightly versions.
User avatar
WildcatRay
Posts: 7486
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: keyconfig 20110522

Post by WildcatRay »

sridhar wrote:Does anyone know if it's possible to use Keyconfig in regular edition of Firefox?

This screenshot shows the problem: http://d.pr/i/ldX1

https://support.mozilla.org/en-US/kb/ad ... nced-users states that I need to use Firefox ESR version 45 or Developer Edition or Nightly versions.
Dorando keyconfig is signed and works with Firefox.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
sridhar
Posts: 184
Joined: June 18th, 2004, 2:54 pm
Contact:

Re: keyconfig 20110522

Post by sridhar »

Thanks WildcatRay. That worked.
Springtime
Posts: 68
Joined: November 8th, 2013, 8:59 pm

Re: keyconfig 20110522

Post by Springtime »

mz user wrote:Also, could anyone make a script to mute the current tab/all visible tabs ?
Quoting this as I too would like to know which command could be used to mute both the current tab, and separately all tabs. Very useful feature.
morat
Posts: 6437
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Springtime
@mz user

Try these:

Code: Select all

// mute current tab
var tab = gBrowser.selectedTab;
if (tab.hasAttribute("muted") == false) {
  tab.toggleMuteAudio();
}

Code: Select all

// mute all tabs
for (var i = 0; i < gBrowser.tabContainer.childNodes.length; i++) {
  var tab = gBrowser.tabContainer.childNodes[i];
  if (tab.hasAttribute("muted") == false) {
    tab.toggleMuteAudio();
  }
}
Post by mz user: http://forums.mozillazine.org/viewtopic ... #p14520953
Springtime
Posts: 68
Joined: November 8th, 2013, 8:59 pm

Re: keyconfig 20110522

Post by Springtime »

morat wrote:@Springtime
@mz user

Try these:
Thank you! Added an else if for my own use so it toggles on/off and it works nicely :)
Oomingmak
Posts: 203
Joined: July 10th, 2004, 7:46 pm
Location: UK

Re: keyconfig 20110522

Post by Oomingmak »

I've created hotkey that opens a website in a new tab and then makes that tab pinned.

Code: Select all

gBrowser.selectedTab = gBrowser.addTab("https://somewebsite.org/");

gBrowser.pinTab(gBrowser.mCurrentTab); 
What code do I need to add in order to make the hotkey focus the existing tab (if it already exists) instead of opening another new identical tab when there's one already open?

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

Re: keyconfig 20110522

Post by TBDTBD »

Hi,

when I am outside my VPN, I need to have my ThunderBird stop trying to reach the LDAP server. In order to do that, I need to do the following:

Tools -> Options -> Composition -> Addressing -> Directory Server
Change the selection from "Global" to "None"

What would be the code to do this (and also the opposite change, from None to Global) with a keybinding?

Thanks!
Post Reply