MozillaZine


keyconfig 20110522

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

Post Posted November 9th, 2016, 6:23 pm

@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: 4343
Joined: February 3rd, 2009, 6:29 pm

Post Posted November 9th, 2016, 8:06 pm

@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

Post Posted November 9th, 2016, 10:30 pm

@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

Post Posted November 9th, 2016, 11:04 pm

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: 4343
Joined: February 3rd, 2009, 6:29 pm

Post Posted November 10th, 2016, 3:12 am

@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

Post Posted November 12th, 2016, 6:19 pm

@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: 4343
Joined: February 3rd, 2009, 6:29 pm

Post Posted November 12th, 2016, 7:05 pm

@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

Post Posted November 21st, 2016, 4:40 pm

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.

WildcatRay

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

Post Posted November 21st, 2016, 4:45 pm

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

Post Posted November 21st, 2016, 4:56 pm

Thanks WildcatRay. That worked.

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

Post Posted November 25th, 2016, 1:07 am

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: 4343
Joined: February 3rd, 2009, 6:29 pm

Post Posted November 25th, 2016, 10:45 am

@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: viewtopic.php?p=14520953#p14520953

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

Post Posted November 26th, 2016, 3:06 am

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: 200
Joined: July 10th, 2004, 7:46 pm
Location: UK

Post Posted November 30th, 2016, 12:46 pm

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

Post Posted December 7th, 2016, 1:41 am

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!

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 2 guests