MozillaZine

[Ext] userChromeJS 2.0 [2015-08-02]

Announce and Discuss the Latest Theme and Extension Releases.
morat
 
Posts: 2277
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 7th, 2013, 9:56 pm

@alta88

Could you upload an update to Rod Whiteley's chrome.xpi extension to the userchromejs folder?

I can ask rsx11m to update the Bindings page with the new link.

chrome.manifest
Code: Select all
content userchrome ../../chrome/

install.rdf
Code: Select all
<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">

    <em:id>chrome@user</em:id>
    <em:name>User Chrome</em:name>
    <em:version>1.1</em:version>
    <em:type>2</em:type>
    <em:unpack>true</em:unpack>
    <em:creator>Rod Whiteley</em:creator>
    <em:description>User chrome enabler.</em:description>

    <em:targetApplication><!-- Firefox -->
      <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>4.0</em:minVersion>
        <em:maxVersion>99.*</em:maxVersion>
      </Description>
    </em:targetApplication>

    <em:targetApplication><!-- Thunderbird -->
      <Description>
        <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
        <em:minVersion>5.0</em:minVersion>
        <em:maxVersion>99.*</em:maxVersion>
      </Description>
    </em:targetApplication>

    <em:targetApplication><!-- SeaMonkey -->
      <Description>
        <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
        <em:minVersion>2.1</em:minVersion>
        <em:maxVersion>99.*</em:maxVersion>
      </Description>
    </em:targetApplication>

    <em:targetApplication><!-- Gecko Toolkit -->
      <Description>
        <em:id>toolkit@mozilla.org</em:id>
        <em:minVersion>2.0</em:minVersion>
        <em:maxVersion>99.*</em:maxVersion>
      </Description>
    </em:targetApplication>

  </Description>

</RDF>

zip chrome.zip chrome.manifest install.rdf
ren chrome.zip chrome.xpi
Last edited by morat on February 11th, 2013, 9:24 am, edited 1 time in total.

alta88
 
Posts: 980
Joined: January 28th, 2006, 3:08 pm

Post Posted February 10th, 2013, 5:49 pm

could you explain what that is and what this is about?

morat
 
Posts: 2277
Joined: February 3rd, 2009, 6:29 pm

Post Posted February 11th, 2013, 9:54 am

Sorry, I didn't explain well.

Rod Whiteley wrote the User Chrome extension a few years ago to enable the use of bindings in the chrome folder. The extension is just an enabler - it has no effect at all on its own. The extension broke in Gecko 2.0 because xpi files are no longer unpacked when extensions are installed. Rod Whiteley is no longer an active member of the forum so I was wondering if you would update and host the extension. You would only need to add the unpack property and SeaMonkey compatibility to the install.rdf file.

Philip Chee

User avatar
 
Posts: 6475
Joined: March 1st, 2005, 3:03 pm

Post Posted February 12th, 2013, 9:22 am

morat wrote:Sorry, I didn't explain well.

Rod Whiteley wrote the User Chrome extension a few years ago to enable the use of bindings in the chrome folder. The extension is just an enabler - it has no effect at all on its own. The extension broke in Gecko 2.0 because xpi files are no longer unpacked when extensions are installed. Rod Whiteley is no longer an active member of the forum so I was wondering if you would update and host the extension. You would only need to add the unpack property and SeaMonkey compatibility to the install.rdf file.

Isn't Alice0755 still maintaining a fork of userChromeJS?

Phil

alta88
 
Posts: 980
Joined: January 28th, 2006, 3:08 pm

Post Posted February 13th, 2013, 9:04 am

sure, i can add that xpi. if mozdev commit comes back, not working at the moment.

delicacy
 
Posts: 400
Joined: February 3rd, 2013, 4:09 pm

Post Posted March 16th, 2013, 4:14 pm

"alta88

Post Posted October 16th, 2012, 10:02 am
there's no fix because there's no bug"

Wrong .. .

userchromeJS is incompatible with the actual versions of firefox & badly interfering, it disables the toolbar customization & removes the icons from its palette.

A userchromeJS 1.6 would be welcomed.

Alice0775

User avatar
 
Posts: 2509
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA JPN

Post Posted August 30th, 2014, 12:47 pm

Updating bug add-on userChromeJS to version 1.6 from 1.5:
[*]#1060747 [Toolkit:Add-ons Manager]-Add-on does not run after update the Add-on [Win]

jorgev

User avatar
 
Posts: 53
Joined: May 26th, 2005, 9:54 am
Location: Costa Rica

Post Posted December 1st, 2014, 3:16 pm

Jorge Villalobos
Add-ons Developer Relations Lead, Mozilla

alta88
 
Posts: 980
Joined: January 28th, 2006, 3:08 pm

Post Posted August 3rd, 2015, 12:36 pm

userChromeJS v2.0 has been released; this version is signed and also requires any prior version to be removed before it is re-installed/downloaded from the homepage.

liuxb
 
Posts: 5
Joined: March 21st, 2010, 5:36 am

Post Posted September 3rd, 2016, 8:22 pm

@alta88

It seens that there is conflict between userChromeJS 2.0 and Downloadthemall! 3.0.x. I can't MANUALLY add download link in DTA, when userChromeJS 2.0 installed.
Steps To Reproduce:
create a clean profile, install both DTA 3.0.5 and userChromeJS 2.0, restart firefox.
menubar - tools - Downloadall Tools - Manager, click "manually add a download to downloadthem all" button, type any url MANUALLY, there will be a red frame indicates an error.
snapshots:
http://i.imgur.com/5DZ1MLG.png
http://i.imgur.com/HB0WD1U.png
http://i.imgur.com/y2tSw54.png
http://i.imgur.com/SdsJdMR.png
When click "manually add a download to downloadthem all" button, I get this message "09:59:56.678 uncaught exception: 21475000371DownloadIntegration.jsm:785:12" in log console.
I have reported this issue to DTA team:
https://github.com/downthemall/downthemall/issues/49
Can you fix this problem, thanks!

morat
 
Posts: 2277
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 8th, 2016, 11:18 am

@alta88

liuxb wrote:conflict between userChromeJS 2.0 and DownThemAll! 3.0.5

I get an error if I remove the outer try catch block in the Dialog.download function in the addurl.js file.

TypeError: Services.fixups is undefined

These services don't get defined in the glub.jsm file when userChromeJS is enabled.

Services.catman
Services.clipboardhelper
Services.clipbrd
Services.eps
Services.favicons
Services.fixups
Services.httphandler
Services.memrm
Services.mime
Services.mimeheader
Services.pps
Services.sysprincipal
Services.ttsu
Services.uuid
Services.wintaskbar

view-source:chrome://dta/content/dta/addurl.js
view-source:chrome://dta-modules/content/glue.jsm

http://github.com/downthemall/downthema ... /addurl.js
http://github.com/downthemall/downthema ... s/glue.jsm

Nils Maier
 
Posts: 4
Joined: June 8th, 2007, 1:16 pm

Post Posted September 27th, 2016, 6:29 am

Yeah, userchrome breaks the world for DownThemAll!...
https://github.com/downthemall/downthemall/issues/94

Fixing it is probably easy enough: Don't pollute the "scope" with your stuff.
E.g. like so:

Code: Select all
var userChrome = (function() {
  // anonymous scope
 
  const {Services} = Components.utils.import("resource://gre/modules/Services.jsm", {} /*anonymous*/);
  let whatever = something;
  // exported
  return {
    info() {
       return `This is userChrome running in a ${document.location.href}  window on  ${Services.appinfo.name}`;
    }
    ...
  };
})();

Components.utils.reportError(userChrome.info());

alta88
 
Posts: 980
Joined: January 28th, 2006, 3:08 pm

Post Posted September 27th, 2016, 6:57 am

from the linked bug report, it appears the problem is the Components.* shortcut definitions in global scope. this was removed in v2.0 so it's not clear what the problem is. did the user uninstall old userChrome before installing v2.0 as noted on the home page?

Nils Maier
 
Posts: 4
Joined: June 8th, 2007, 1:16 pm

Post Posted September 27th, 2016, 9:40 pm

alta88 wrote:from the linked bug report, it appears the problem is the Components.* shortcut definitions in global scope. this was removed in v2.0 so it's not clear what the problem is. did the user uninstall old userChrome before installing v2.0 as noted on the home page?


If you were replying to me, the issue is that userChromeJS imports Services.jsm, but DownThemAll!'s |Services| object !== Services.jsm |Services| object. We layer a bunch of stuff on top of the Services.jsm version: https://github.com/downthemall/downthem ... #L151-L211

The more general issue is: userChromeJS "pollutes" the scope (namespace) of all windows it injects itself into. The ideal solution would be for userChromeJS to avoid creating/changing any new globals, or at least only add the "userChrome" global and only that. That also means that |Cu.import()| has to be called with a second argument (the scope argument) and that has to be different to the window/global scope

alta88
 
Posts: 980
Joined: January 28th, 2006, 3:08 pm

Post Posted September 28th, 2016, 5:10 am

why should anyone else be concerned with or affected by your "layers"? importing the system Services.jsm object as |Services| is a... service of userChromeJS, and having this available to all is not exactly global namespace pollution. in fact, Services is imported or "require"ed by very many things and all that's happening here is that you counted on being the last one to grab and hack it. right? any other extension can come along and has no greater or lesser right to modify Services; if it's loaded after your's, it will clobber you.

you should find a better solution for your monkeypatching. or, i'd be glad to give you ownership of userChromeJS ;)

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 2 guests