keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
bkveida
Posts: 2
Joined: April 5th, 2011, 2:29 pm

Re: Bookmarks Toolbar Keyconfig Bug in Firefox 4

Post by bkveida »

rahul wrote:
bkveida wrote:I really hope someone can help me with this issue. There is this bug which only occurs after I installed Firefox 4.

Whenever I start Firefox 4 and toggle bookmarks toolbar using my designated shortcut key, the toolbar does show up, but it's blank.

So, I have to toggle it using right click > tick bookmarks toolbar. Then the bookmarks toolbar will show up and right after that my shortcut key works again.

The key I am currently using is:

var E=document.getElementById('PersonalToolbar');
if(E.collapsed){E.removeAttribute('collapsed')}
else{E.setAttribute('collapsed',true)}

I know there are a lot of keys out there to toggle bookmarks toolbar. I think I have tried most of them and everyone one of them gave me the same result - blank bookmarks toolbar.

I saw few people facing the same problem though and this is one of them: (check it out at the comment part, the person is eblabla)

http://blog.vicshih.com/2008/11/toggle-firefox-bookmarks-toolbar.html

How to I solve this problem? I have been googling it. Can't get any answers though. Thanks for any help!


this should work in firefox 4:

Code: Select all

var bar = document.getElementById("PersonalToolbar");
setToolbarVisibility(bar, bar.collapsed);


Thanks! It works perfectly! =D>
chirpy_7
Posts: 165
Joined: March 19th, 2007, 6:24 am

Re: keyconfig 20110323

Post by chirpy_7 »

hello again,

I'm searching for the

code to

- create
and
- give focus to

- a new group (panorama group)
- with one (and only one) new tab

Thanks !

chirpy

ps:

nb:

NOT from within panorama, but directly from a normal FF tab...
chirpy_7
Posts: 165
Joined: March 19th, 2007, 6:24 am

Re: keyconfig 20110323

Post by chirpy_7 »

hi,

I'm looking for the code to open the active / focussed tab's

tab context menu

Thanks!

chirpy
ballyhairs
Posts: 63
Joined: May 5th, 2009, 2:44 pm

Re: keyconfig 20110323

Post by ballyhairs »

Oh this incompatibility issue every update is just annoying
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110323

Post by dorando »

rtega wrote:Has anyone figured out a way yet to switch from tab-group to tab-group (just like next-tab but for tab-groups).
If you want to assign a shortcut to it try

Code: Select all

var groupItems TabView._window.GroupItems;
var 
tabItem groupItems.getNextGroupItemTab(true);
if (!
tabItem)
 return;

var 
oldGroupItem groupItems.getActiveGroupItem();
window.gBrowser.selectedTab tabItem.tab;
oldGroupItem.closeIfEmpty(); 
and for previous group

Code: Select all

var groupItems TabView._window.GroupItems;
var 
tabItem groupItems.getNextGroupItemTab(false);
if (!
tabItem)
 return;

var 
oldGroupItem groupItems.getActiveGroupItem();
window.gBrowser.selectedTab tabItem.tab;
oldGroupItem.closeIfEmpty(); 

K4RBQT99 wrote: I want to toggle the visibility of the menubar.
Try

Code: Select all

var toolbar document.getElementById("toolbar-menubar");
toolbar.setAttribute("autohide"toolbar.getAttribute("autohide") != "true"); 
K4RBQT99 wrote:Oh, now I see that F10 do this on gnome. With KDE is Alt. crap, i prefer use Alt.
Try setting the ui.key.menuAccessKeyFocuses to true in about:config.
K4RBQT99 wrote:I need the code anyway.
Try

Code: Select all

var utils content.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);

utils.sendKeyEvent("keypress"KeyEvent.DOM_VK_F1000); 

geon wrote:is it possible to have keyconfig in Thunderbird and simultaneously not to have in contacts (in tb)? or to have one shortcut (Del) different in tb and in its contacts? Thank you.
Add a new key, tick the Global checkbox, and use something like

Code: Select all

switch(document.location.toString()) {
 case 
"chrome://messenger/content/messenger.xul":
  
alert("Main");
  break;
 case 
"chrome://messenger/content/addressbook/addressbook.xul":
  
alert("Contacts");
  break;
 default:
  
alert(document.location);
  break;

bolidew wrote:I used this command to "Hide/Show TabBar":
"gBrowser.mStrip.collapsed = !gBrowser.mStrip.collapsed;"

But it doesn't work any more in Firefox 4 (with "Tabs on Top" disabled).

Would appreciate any suggestions for a shortcut key to Hide/Show TabBar ! Thanks.
Try

Code: Select all

gBrowser.tabContainer.parentNode.collapsed = !gBrowser.tabContainer.parentNode.collapsed

ballyhairs wrote:Hey dorando,
I need a key that is global, which means it works even when FF is not active or even minimized to the tray that will activate FF if not active and minimize it if active, I hope its possible and thanks anyway.
Gecko 2.0 doesn't have any API for that, but with js-ctypes it is relatively easy to hook into the system API. Try

Code: Select all

Components.utils.import("resource://gre/modules/Services.jsm");
if(!
Services.ww.activeWindow) {
 
Components.utils.import("resource://gre/modules/ctypes.jsm");
 const 
user32 ctypes.open("user32");

 const 
BOOL    ctypes.int;

 const 
PVOID   ctypes.voidptr_t;
 const 
HANDLE  PVOID;
 const 
HWND    HANDLE;

 const 
WCHAR   ctypes.jschar;
 const 
LPCWSTR WCHAR.ptr;
 const 
LPCTSTR LPCWSTR;

 const 
FindWindow user32.declare("FindWindowW"ctypes.winapi_abiHWNDLPCTSTRLPCTSTR);
 const 
SetForegroundWindow user32.declare("SetForegroundWindow"ctypes.winapi_abiBOOLHWND);

 var 
win FindWindow("MozillaWindowClass"document.title);
 
SetForegroundWindow(win);
 
window.focus();
} else if(
Services.ww.activeWindow != window){
 
window.focus();
} else {
 
window.minimize();
together with a bootstrapped (restartless) extension for Windows which during startup tries to register a handler for any shortcut marked as global in keyconfig to invoke the associated <key> in the topmost Gecko window (adding a keyconfig.globalWindowType pref containing navigator:browser will use the topmost Browser window only). These shortcuts also work while a plugin has the focus, and the meta modifier (Windows key) can also be used (needs to be set trough about:config).

chirpy_7 wrote:a code to toggle
Pin and Unpin (as App Tab)
would also be highly desirable / nice-to-have
Try

Code: Select all

if(gBrowser.mCurrentTab.pinned)
 
gBrowser.unpinTab(gBrowser.mCurrentTab);
else
 
gBrowser.pinTab(gBrowser.mCurrentTab); 

Cattleya wrote:[...] a hotkey that can On/Off Adobe Flash Player Plugin [...]
Try

Code: Select all

Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonsByTypes("plugin", function(addons) {
 for(var 
0addons.lengthli++)
  if(
addons[i].name == "Shockwave Flash"addons[i].userDisabled = !addons[i].userDisabled;
}); 

ekbworldwide wrote:Does "functions for keyconfig" exist for FF4?

The only link I know of for it is dead:

Code: Select all

http://www.pqrs.org/tekezo/firefox/extensions/functions_for_keyconfig/

It redirects to pqrs.org
Assumable he removed it since it wasn't updated anymore (version 1.4.0 might work in Firefox 4 if you disable the compatibility claim enforcing).

zakk wrote:

Code: Select all

Error: gDocument.getElementById(node.getAttribute("command")) is null
Source File: chrome://keyconfig/content/keyconfig.js
Line: 470
Hmm, that extension adds a

Code: Select all

<key id="key_openwebapps" keycode="" command="cmd_openSharePage"/> 
but no cmd_openSharePage (and during initialization the keycode is strangely set to VK_OWA)…

Until I have time for another release you can edit Profile/extensions/keyconfig@dorando.xpi/keyconfig.zip/content/keyconfig.js (.xpi is the same as .zip) while Firefox is closed and replace

Code: Select all

return gDocument.getElementById(node.getAttribute("command")).getAttribute("oncommand"); 
with

Code: Select all

try { return gDocument.getElementById(node.getAttribute("command")).getAttribute("oncommand"); } catch(err){} 
to fix that issue.

chirpy_7 wrote:I'm searching for the

code to

- create
and
- give focus to

- a new group (panorama group)
- with one (and only one) new tab
Try

Code: Select all

var tab gBrowser.addTab();
TabView.moveTabTo(tabnull);
gBrowser.selectedTab tab
chirpy_7 wrote:I'm looking for the code to open the active / focussed tab's

tab context menu
Try

Code: Select all

var tabMenu gBrowser.tabContextMenu || document.getAnonymousElementByAttribute(gBrowser,"anonid","tabContextMenu");

document.popupNode gBrowser.mCurrentTab;
tabMenu.openPopup(gBrowser.mCurrentTab"after_start"00true); 

ballyhairs wrote:Oh this incompatibility issue every update is just annoying
Disable the compatibility claim enforcing, or don't use pre-releases…
Support mozilla.dorando.at through donations/contributions.
K4RBQT99
Posts: 284
Joined: November 11th, 2010, 3:23 pm

Re: keyconfig 20110323

Post by K4RBQT99 »

dorando wrote:
K4RBQT99 wrote: I want to toggle the visibility of the menubar.
Try

Code: Select all

var toolbar = document.getElementById("toolbar-menubar");
toolbar.setAttribute("autohide", toolbar.getAttribute("autohide") != "true"); 

Holy..., thanks for you help. Actually, showing permanently the menubar hides the firefox button in linux, and vice-versa, so the updated code would be:

Code: Select all

var toolbar = document.getElementById("toolbar-menubar");
toolbar.setAttribute("autohide", toolbar.getAttribute("autohide") != "true");

var button = document.getElementById("appmenu-toolbar-button");
button.setAttribute("hidden", toolbar.getAttribute("autohide") != "true"); 
chirpy_7
Posts: 165
Joined: March 19th, 2007, 6:24 am

Re: keyconfig 20110323

Post by chirpy_7 »

brilliant !!!

triple thank you :)

chirpy
User avatar
ekbworldwide
Posts: 53
Joined: May 28th, 2007, 3:53 am

Re: keyconfig 20110323

Post by ekbworldwide »

Solved: I answered my own question and 20110323 had nothing to do with my problem.
---

I upgraded to 20110323 - I'm using Firefox 3.6.10

The problem is that my code for "jump to the address bar" broke:

Code: Select all

f4kc_FocusURLBar();

---

I totally forgot that f4kc_(etc) stuff seemed to be directly connected to an ancient add-on"functions for keyconfig" that I just recently uninstalled. Uninstalling the add-on broke the code.

This code works:

Code: Select all

document.getElementById("urlbar").focus();

---

ballyhairs wrote:Oh this incompatibility issue every update is just annoying

I use...

MR Tech Toolkit
https://addons.mozilla.org/en-US/firefo ... h-toolkit/

...to override compatibility checking and for a whole bunch of other stuff. There's an irony though. The programmer can be very (very) slow to update it - it doesn't work with FF4.
Last edited by ekbworldwide on April 21st, 2011, 9:14 pm, edited 2 times in total.
...
bolidew
Posts: 64
Joined: June 1st, 2005, 4:52 pm

Re: keyconfig 20110323

Post by bolidew »

dorando wrote:
bolidew wrote:I used this command to "Hide/Show TabBar":
"gBrowser.mStrip.collapsed = !gBrowser.mStrip.collapsed;"

But it doesn't work any more in Firefox 4 (with "Tabs on Top" disabled).

Would appreciate any suggestions for a shortcut key to Hide/Show TabBar ! Thanks.
Try

Code: Select all

gBrowser.tabContainer.parentNode.collapsed = !gBrowser.tabContainer.parentNode.collapsed; 



I am using TreeStyleTab and this works on Top/Bottom tabbar position however if the tabbar is on Left/Right, it only toggles the visibility of tabs but not the BAR (placeholder). Any advice?
Thanks a lot.
nightson
Posts: 32
Joined: April 21st, 2011, 7:51 am

Re: keyconfig 20110323

Post by nightson »

I'm searching for the code to restore previous session in order to avoiding using any extension or put about:sessionrestore in my bookmarks toolbar. I tried

Code: Select all

restoreSession();
, which I found in the source of about:sessionrestore page but with no luck. Thanks in advance!


Edit. Solved by myself

I used MenuManipulator to get the correct code from "Restore Previous Session" in history menu :D

And here is the code in case anyone needs it.

Code: Select all

 restoreLastSession();
Last edited by nightson on April 21st, 2011, 11:13 pm, edited 2 times in total.
User avatar
ekbworldwide
Posts: 53
Joined: May 28th, 2007, 3:53 am

Re: keyconfig 20110323

Post by ekbworldwide »

nightson wrote:I'm searching for the code to restore previous session,

I seem to remember - I could be wrong - the code for that is built-into tab mix plus.You could google. They have a forum - you could ask there.
...
User avatar
ekbworldwide
Posts: 53
Joined: May 28th, 2007, 3:53 am

Re: keyconfig 20110323

Post by ekbworldwide »

nightson wrote:I used MenuManipulator to get the correct code from "Restore Previous Session" in history menu :D

Does MenuManipulator work like this(?)

  1. You select an element from a menu.
  2. The keyconfig(-like) code it uses can be copy and pasted.

Is that right?

Also - does it work inside the context-menu too?
...
Cattleya
Posts: 57
Joined: October 7th, 2010, 11:14 pm

Re: keyconfig 20110323

Post by Cattleya »

Try

Code: Select all
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonsByTypes("plugin", function(addons) {
for(var i = 0, l = addons.length; i < l; i++)
if(addons[i].name == "Shockwave Flash") addons[i].userDisabled = !addons[i].userDisabled;


Awesome, thanks dorando!

Now, can you help me a hotkey to Flush DNS Cache like these addons:
https://addons.mozilla.org/vi/firefox/addon/dns-cache/
https://addons.mozilla.org/vi/firefox/a ... s-flusher/

It works by set network.dnsCacheExpiration to 0, then restore it.

Thank you.
Noi
Posts: 2
Joined: April 26th, 2011, 4:48 am

Re: keyconfig 20110323

Post by Noi »

Hi dorando,

on Firefox 4.0 it is not possible to see the menu of "MenuManipulator", because no menu item is available (why not?), and i don't know other way to run this extension. For this reason I've tried to use "Keyconfig" to set a Hotkey for "MenuManipulator". This method had no success.

My questions:

1. How to run the "MenuManipulator" in Firefox 4.0?
2. How to set a Hotkey in Keyconfig to run "MenuManipulator”? Of course, the following code was added:
goDoCommand('cmd_menumanipulator');
but unfortunately it has no function (the hotkey was STRG+SCHIFT+N)


Thanks
Noi
ballyhairs
Posts: 63
Joined: May 5th, 2009, 2:44 pm

Re: keyconfig 20110323

Post by ballyhairs »

Hey dorando,
That didn't work for me, the only thing it does is to minimize when active, further nothing :?
Post Reply