MozillaZine

[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 Posted March 11th, 2008, 2:51 am

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.

Orphu of Io

User avatar
 
Posts: 172
Joined: December 3rd, 2007, 7:20 pm

Post Posted March 11th, 2008, 3:28 am

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 Posted March 11th, 2008, 5:01 am

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

User avatar
 
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)

Post Posted March 13th, 2008, 5:44 am


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."

pirlouy

User avatar
 
Posts: 232
Joined: February 11th, 2005, 6:29 am
Location: France

Post Posted March 13th, 2008, 4:31 pm

Thanks LouCypher.

Maybe you could release your Chrome Inspector extension on AMO too... :-)

Ria

User avatar
 
Posts: 3550
Joined: March 21st, 2004, 3:25 am
Location: Netherlands

Post Posted March 18th, 2008, 3:46 am

This extension is broken now on trunk.

OTOKITI
 
Posts: 1
Joined: August 10th, 2006, 9:14 am

Post Posted March 18th, 2008, 8:10 am

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

logan

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

Post Posted March 18th, 2008, 11:12 am

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

User avatar
 
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)

Post Posted March 18th, 2008, 1:36 pm

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."

logan

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

Post Posted March 18th, 2008, 1:43 pm

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

Post Posted March 18th, 2008, 2:46 pm

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.

logan

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

Post Posted March 18th, 2008, 3:57 pm

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: ... }.

alterna

User avatar
 
Posts: 3993
Joined: January 16th, 2007, 8:27 am
Location: Big Apple

Post Posted March 19th, 2008, 6:41 am

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

Post Posted March 19th, 2008, 1:07 pm

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!

logan

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

Post Posted March 19th, 2008, 1:28 pm

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.

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 1 guest