[Ext] userChrome.js [support discontinued]
-
- Posts: 201
- Joined: October 19th, 2007, 4:50 am
- Location: Swiss Confederation
- Contact:
[Ext] userChrome.js [support discontinued]
userChrome.js allows to easily customize Firefox through JavaScript code snippets (see e.g. these code snippet collections as a starting point).
Download/install userChrome.js 0.8
This release works for Firefox and Thunderbird 2 and 3 and all Gecko 1.9 applications.
Support: For code related questions, please use the Extension Development forum.
Download/install userChrome.js 0.8
This release works for Firefox and Thunderbird 2 and 3 and all Gecko 1.9 applications.
Support: For code related questions, please use the Extension Development forum.
Last edited by zeniko on April 19th, 2008, 12:21 am, edited 2 times in total.
-
- Posts: 20
- Joined: April 28th, 2006, 9:58 pm
- pirlouy
- Posts: 232
- Joined: February 11th, 2005, 6:29 am
- Location: France
I've found other sites with userChrome.js scripts, and I don't use this page anymore.
http://extensions.geckozone.org/userChrome_js_scripts
http://extensions.geckozone.org/userChrome_js_scripts
-
- Posts: 2225
- Joined: November 9th, 2004, 6:45 pm
- Location: Jakarta, Indonesia (UTC+7)
- Contact:
alice0775 has many useful userChrome.js scripts in her blog
http://space.geocities.yahoo.co.jp/gl/alice0775 (JA)
(<a href="http://honyaku.yahoofs.jp/url_result?ctw_=sT,eCR-JE,bF,hT,uaHR0cDovL3NwYWNlLmdlb2NpdGllcy55YWhvby5jby5qcC9nbC9hbGljZTA3NzU=,qlang=ja|for=0|sp=-5|fs=100%|fb=0|fi=0|fc=FF0000|db=T|eid=CR-EJ,">Translate to EN</a>)
- pirlouy
- Posts: 232
- Joined: February 11th, 2005, 6:29 am
- Location: France
Several scripts don't work anymore with version 3.0 beta 1. This one for example:
Is there a simple solution to have all these scripts compatible.
Code: Select all
var statusbar = document.getElementById("status-bar");
var menubar = document.getElementById("nav-bar");
menubar.appendChild(statusbar);
Is there a simple solution to have all these scripts compatible.
-
- Posts: 20
- Joined: April 28th, 2006, 9:58 pm
pirlouy wrote:Is there a simple solution to have all these scripts compatible.
Not if they're changing IDs at random which is what that looks like. If they are doing that it would be incredibly stupid by the way, it would break many many things that work fine now. I'm not keen on what they've been doing with Firefox by a long shot but I find it hard to believe they could do something that dumb on purpose.
-
- Posts: 243
- Joined: November 9th, 2005, 7:31 pm
Can someone advise me on whats wrong with this code? This is on Fx3preB2 nightly builds.
/* ::::::::::::::::::::::::: Places Organizer - Open in Tab ::::::::::::::::::::::::: */
document.getElementsByAttribute("key", "manBookmarkKb")[0].setAttribute("oncommand", '(getBrowser().selectedTab = getBrowser().addTab("chrome://browser/content/places/places.xul")).label = "Places Organizer";');
/* ::::::::::::::::::::::::: Places Organizer - Open in Tab ::::::::::::::::::::::::: */
document.getElementsByAttribute("key", "manBookmarkKb")[0].setAttribute("oncommand", '(getBrowser().selectedTab = getBrowser().addTab("chrome://browser/content/places/places.xul")).label = "Places Organizer";');
-
- Posts: 20
- Joined: April 28th, 2006, 9:58 pm
-
- Posts: 20
- Joined: April 28th, 2006, 9:58 pm
try something like this to see where it's dying:
var statusbar = document.getElementById("status-bar");
if(!statusbar){alert("Unable to grab statusbar")}
var menubar = document.getElementById("nav-bar");
if(!menubar){alert("Unable to grab menubar")}
menubar.appendChild(statusbar);
There are better ways to debug but that one is quickest for small temporary checks IMO.
var statusbar = document.getElementById("status-bar");
if(!statusbar){alert("Unable to grab statusbar")}
var menubar = document.getElementById("nav-bar");
if(!menubar){alert("Unable to grab menubar")}
menubar.appendChild(statusbar);
There are better ways to debug but that one is quickest for small temporary checks IMO.
-
- Posts: 201
- Joined: October 19th, 2007, 4:50 am
- Location: Swiss Confederation
- Contact:
pirlouy wrote:Code: Select all
var statusbar = document.getElementById("status-bar");
var menubar = document.getElementById("nav-bar");
menubar.appendChild(statusbar);
WFM with the latest nightly (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/2007112305 Minefield/3.0b2pre) on a clean profile. So either the Beta is borked - or your profile resp. an incompatible extension therein.
Besides: Does not working anymore have any other symptoms such as related errors in the Error Console or snippets following that one not working?
aronin wrote:Can someone advise me on whats wrong with this code?
It sets an <code>oncommand</code> handler on an element which already sports a <code>command</code> attribute (which AFAICT takes precedence). So you'll either have to modify the <code>Browser:ShowBookmarks</code> command element or remove the <code>command</code> attribute from the menuitem you're working on...
-
- Posts: 243
- Joined: November 9th, 2005, 7:31 pm
zeniko wrote:aronin wrote:Can someone advise me on whats wrong with this code?
It sets an <code>oncommand</code> handler on an element which already sports a <code>command</code> attribute (which AFAICT takes precedence). So you'll either have to modify the <code>Browser:ShowBookmarks</code> command element or remove the <code>command</code> attribute from the menuitem you're working on...
Ok, I tried it a different way and it worked:
/* ::::::::::::::::::::::::: Places Library - Open in Tab ::::::::::::::::::::::::: */
document.getElementById("Browser:ShowBookmarks").setAttribute("oncommand", '(getBrowser().selectedTab = getBrowser().addTab("chrome://browser/content/places/places.xul")).label = "Places Organizer";');
But ofcourse, couldn't be without problems:
Once I open Places Organizer in Tab ... New Folder command doesn't work anymore (within the organizer). Any ideas?