[Ext] userChrome.js [support discontinued]

Announce and Discuss the Latest Theme and Extension Releases.
punistation
Posts: 8
Joined: August 21st, 2006, 12:44 am

Post by punistation »

Orphu of Io wrote:It needs to go in userChrome.css, not userChrome.js.

http://kb.mozillazine.org/UserChrome.css


Hmm.

I saved the UserChrome.css file you linked into my C:\Program Files\Mozilla Firefox\chrome directory, opened it and pasted the code into the bottom of all the content and rebooted Firefox.

Didn't work.

Just in case, I copied the file into C:\Program Files\Mozilla Firefox\defaults\profile\chrome as well. Still no buttons in the QUICK FIND bar.

I feel great n00bness within me. I MUST be putting it in the wrong place.
User avatar
Orphu of Io
Posts: 172
Joined: December 3rd, 2007, 7:20 pm

Post by Orphu of Io »

Make sure you name it userChrome.css- note the lowercase u. Also, it needs to be in the chrome folder of your profile, not the program folder. The same location as userChrome.js.

See http://kb.mozillazine.org/Profile_folder

I feel great n00bness within me. I MUST be putting it in the wrong place.

:) I wouldn't feel too bad. There's only about a million different places to put things on modern computers.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0
punistation
Posts: 8
Joined: August 21st, 2006, 12:44 am

Post by punistation »

Ah. Solved the problem.

1. Found my Profile folder. (Many thanks!)

2. The linked UserChrome.css from a few posts back was filled with all sorts of code. Pasting the QUICK FIND code at the end of it never worked. But pasting the code into a blank Notepad file and saving it as userChrome.css worked perfectly. Hurrah!

Now for sleep. Ah, sweet sleep: Half my life well spent.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »


This is the modified version for Firefox 3 tabs of Zeniko's Fashion Tabs
Last edited by Zoolcar9 on March 13th, 2008, 6:15 pm, edited 1 time in total.
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
User avatar
pirlouy
Posts: 232
Joined: February 11th, 2005, 6:29 am
Location: France

Post by pirlouy »

Thanks LouCypher.

Maybe you could release your Chrome Inspector extension on AMO too... :-)
User avatar
Ria
Posts: 3550
Joined: March 21st, 2004, 3:25 am
Location: Netherlands

Post by Ria »

This extension is broken now on trunk.
OTOKITI
Posts: 1
Joined: August 10th, 2006, 9:14 am

Post by OTOKITI »

Ria wrote:This extension is broken now on trunk.


Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre) Gecko/2008031803 Minefield/3.0b5pre

broken
User avatar
logan
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403
Contact:

Post by logan »

http://bonsai.mozilla.org/cvslog.cgi?fi ... &mark=1.26

Code: Select all

1.26   bzbarsky%mit.edu   2008-03-17 20:46       Set the right url in the script and don't allow loading non-chrome scripts.
Bug 418356, r+sr=jst

must be security related, I can't view the bug..
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »

BZ wrote:don't allow loading non-chrome scripts

Yikes!

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
User avatar
logan
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403
Contact:

Post by logan »

it sounds like this will be coming to 2.0 as well
zeniko
Posts: 201
Joined: October 19th, 2007, 4:50 am
Location: Swiss Confederation
Contact:

Post by zeniko »

Ria wrote:This extension is broken now on trunk.

You'll have to wait at least a few days until I'll have time to look for a work-around. Should anybody want to step in for me, please be my guest!
logan wrote:it sounds like this will be coming to 2.0 as well

They're still discussing alternatives for the branch. First comes checking AMO for further potentially affected extensions (see bug 423732) and shipping Firefox 3.0 Beta 5 to a larger audience.
User avatar
logan
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403
Contact:

Post by logan »

I saw mention of Components.utils.import(), but didn't spend any time on that. How about if you register a chrome directory and then load chrome://dir/content/userChrome.js? Would change the location of the file though.

Code: Select all

diff -ruN a/chrome/userchrome_js/content/userChrome.js b/chrome/userchrome_js/content/userChrome.js
--- a/chrome/userchrome_js/content/userChrome.js   1969-12-31 18:00:00.000000000 -0600
+++ b/chrome/userchrome_js/content/userChrome.js   2008-03-18 13:50:14.000000000 -0500
@@ -0,0 +1 @@
+if (location != "chrome://browser/content/browser.xul") throw "stop";
diff -ruN a/chrome.manifest b/chrome.manifest
--- a/chrome.manifest   2007-10-24 14:22:02.000000000 -0500
+++ b/chrome.manifest   2008-03-18 13:33:49.000000000 -0500
@@ -0,0 +1 @@
+content   userchrome_js   chrome/userchrome_js/content/
diff -ruN a/components/userChrome_js.js b/components/userChrome_js.js
--- a/components/userChrome_js.js   2007-08-29 23:09:00.000000000 -0500
+++ b/components/userChrome_js.js   2008-03-18 13:47:52.000000000 -0500
@@ -107,7 +107,7 @@
       {
          try
          {
-            Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader).loadSubScript(this.mFileURL, document.defaultView);
+            Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader).loadSubScript("chrome://userchrome_js/content/userChrome.js", document.defaultView);
          }
          catch (ex)
          {

A simple test with this worked, but stopped functioning after I put in my whole switch(location) { case browser.xul: ... }.
User avatar
alterna
Posts: 3993
Joined: January 16th, 2007, 8:27 am
Location: Big Apple

Post by alterna »

I'm getting the following in error console

Error: Trying to load a non-chrome URI.
Source File: file:///C:/Documents%20and%20Settings/Jim/Application%20Data/Mozilla/Firefox/Profiles/dx5xi2aw.Cat/extensions/%7B1280606b-2510-4fe0-97ef-9b5a22eafe64%7D/components/userChrome_js.js
Line: 116

using userChrome.js 0.8 inMozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre) Gecko/2008031806 Minefield/3.0b5pre ID:2008031806

What's, and should I just ignore this for now?

Thanks.
"So it goes" - Kurt Vonnegut, Jr.
zeniko
Posts: 201
Joined: October 19th, 2007, 4:50 am
Location: Swiss Confederation
Contact:

Post by zeniko »

Minefield users: Temporary work-around: userChrome.js 0.8.0+. This version will copy your script(s) to a cache from which they are loaded without causing the above mentioned issue on current Trunk builds. The only thing which won't work is the loading of further subscripts (through e.g. my Sub-Script/XUL Loader snippet).

For convenience, this version offers one method available from JavaScript anywhere:

Code: Select all

loadSubScript(aFilename);

(where filename is a path relative to your profile's chrome directory, e.g. <code>"mousegestures.uc.js"</code> or <code>aFile.leafName</code>). This will load your scripts through the same cache as userChrome.js itself. Note: Don't rely on this, if you don't have to!
User avatar
logan
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403
Contact:

Post by logan »

Still the odd problem with switch(location) { case browser.xul: ...; break; }, but I'll just change back to if()'s. :P Thanks for the quick fix.
Locked