MozillaZine

[Ext] userChrome.js

Announce and Discuss the Latest Theme and Extension Releases.
Coce
 
Posts: 16
Joined: December 31st, 2006, 9:03 am
Location: Germany

Post Posted January 7th, 2007, 3:28 am

zeniko: Sorry for choosing the wrong forum, I chose this one, because codes were posted here and because a user in the German Firefox-Forum recommended me to ask here.
Sorry also for not showing enough effort, I tried to shift parts of the code which caused the code not to work anymore. ;-) Can you tell me a website, which helps me to easily understand the meaning of the codes?


max1million: Thanks, these codes work perfectly, I just have to see, why the wrong day of the week is displayed, perhaps I just can shift the days...
Regards, Coce

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted January 7th, 2007, 6:06 am

Coce wrote:Can you tell me a website, which helps me to easily understand the meaning of the codes?

Sure: about JavaScript, a bunch of tutorials, official reference, further resources.

For debugging, I recommend installing my Console² extension which enhances the Error Console (from the Tools menu), making it easier to see the errors your non-working code produces.

Zoolcar9

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

Post Posted January 7th, 2007, 8:36 am

Coce wrote:I have another question concerning another script:
The following code
Code: Select all
<snip />


adds a submenu to the context menu, containing two entries which allow uploading an image directly either to Flickr or to Imageshack. As I have no Flickr account, I don't need this option. How do I have to modify the script, so the Imageshack upload is the only one I can use and this entry is directly in the context menu (no submenu)?


Code: Select all
(function() {
  var menuAttr = [
    { label: "Send Image to ImageShack",
      id: "context-sendimageTo",
      before: "context-sendimage",
      url: "imageURL" },
    { label: "Send Background Image to ImageShack",
      id: "context-sendbgimageTo",
      before: "context-viewbgimage",
      url: "bgImageURL" }
  ];

  for(var i = 0; i < menuAttr.length; i++) {
    var mi = document.createElement("menuitem");
    mi.id = menuAttr[i].id;
    mi.setAttribute("label", menuAttr[i].label);
    mi.setAttribute("oncommand",
      "gBrowser.loadOneTab('http://imageshack.us/transload.php?url=' + " +
      "escape(gContextMenu." + menuAttr[i].url + "), " +
      "null, null, null, false)")

    var beforeId = document.getElementById(menuAttr[i].before);
    beforeId.parentNode.insertBefore(mi, beforeId.nextSibling);
  }

  var cm = document.getElementById("contentAreaContextMenu");
  cm.addEventListener("popupshowing", function(event) {
    gContextMenu.showItem("context-sendimageTo", gContextMenu.onImage);
    gContextMenu.showItem("context-sendbgimageTo", gContextMenu.hasBGImage);
  }, false);

})();

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."

UnfocusedOne
 
Posts: 5
Joined: January 12th, 2007, 4:23 am
Location: New Zealand

Post Posted January 12th, 2007, 4:58 am

Heres a few scripts from me.

<a href="data:text/javascript;charset=utf-8;base64,KGZ1bmN0aW9uKCkNCnsNCgl2YXIgc2VhcmNoYmFyID0gQnJvd3NlclNlYXJjaC5nZXRTZWFyY2hCYXIoKTsNCglpZihzZWFyY2hiYXIgJiYgImhhbmRsZVNlYXJjaENvbW1hbmQiIGluIHNlYXJjaGJhcikNCgl7DQoJCWV2YWwoInNlYXJjaGJhci5oYW5kbGVTZWFyY2hDb21tYW5kID0iK3NlYXJjaGJhci5oYW5kbGVTZWFyY2hDb21tYW5kLnRvU3RyaW5nKCkucmVwbGFjZSgNCgkJCSd2YXIgdGV4dFZhbHVlID0gdGV4dEJveC52YWx1ZTsnLA0KCQkJJ3ZhciB0ZXh0VmFsdWUgPSB0ZXh0Qm94LnZhbHVlOyBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7IEJyb3dzZXJTZWFyY2guZ2V0U2VhcmNoQmFyKCkudmFsdWUgPSAiIjsgfSwgMTAwMCk7Jw0KCQkJKSk7DQoJfQ0KDQp9KCkpOw0K">Clear search term</a>
Clears the main search box after searching. Rewritten to be compatible with TabMix Plus (may require TabMix Plus?).


<a href="data:text/javascript;charset=utf-8;base64,KHsNCglpbml0OiBmdW5jdGlvbigpDQoJew0KCQljb25zdCBuc0lXZWJQcm9ncmVzcyA9IENvbXBvbmVudHMuaW50ZXJmYWNlcy5uc0lXZWJQcm9ncmVzczsNCgkJY29uc3QgZmlsdGVyID0gbnNJV2ViUHJ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oKTsJDQoJfSwNCg0KCW9uTG9jYXRpb25DaGFuZ2U6IGZ1bmN0aW9uKCkgeyB9LA0KCW9uU3RhdHVzQ2hhbmdlOiBmdW5jdGlvbigpIHsgfSwNCglvblNlY3VyaXR5Q2hhbmdlOiBmdW5jdGlvbigpIHsgfSwNCglvbkxpbmtJY29uQXZhaWxhYmxlOiBmdW5jdGlvbigpIHsgfSwNCg0KDQoJUXVlcnlJbnRlcmZhY2U6IGZ1bmN0aW9uKGFJSUQpIHsNCgkJdmFyIENpID0gQ29tcG9uZW50cy5pbnRlcmZhY2VzOw0KCQlpZiAoIVtDaS5uc0lET01FdmVudExpc3RlbmVyLCBDaS5uc0lXZWJQcm9ncmVzc0xpc3RlbmVyLCBDaS5uc0lTdXBwb3J0c1dlYWtSZWZlcmVuY2UsIENpLm5zSVN1cHBvcnRzXS5zb21lKGFJSUQuZXF1YWxzKSkNCgkJew0KCQkJdGhyb3cgQ29tcG9uZW50cy5yZXN1bHRzLk5TX05PSU5URVJGQUNFOw0KCQl9DQoJCXJldHVybiB0aGlzOw0KCX0NCn0pLmluaXQoKTsNCg%3D%3D">Load progress in title</a>
Shows page load progress of the current tab (in percentage) in the title bar of a browser window. Handy when theres multiple windows open, and things are moving slowly.


<a href="data:text/javascript;charset=utf-8;base64,LyoNClJlcXVpcmVzIFRhYk1peCENCk1vdmVzIHRoZSBsZWZ0IHNjcm9sbCBidXR0b24gb2YgdGhlIHRhYiBiYXIgdG8gdGhlIGZhciBsZWZ0LA0KYW5kIGVuYWJsZXMgc2Nyb2xsaW5nIGJ5IGp1c3QgaG92ZXJpbmcgb3ZlciBvbmUgb2YgdGhlIHNjcm9sbCBidXR0b25zLg0KKi8NCihmdW5jdGlvbiAoKSB7DQoNCgl2YXIgdGFic2ZyYW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3Njcm9sbC10YWJzLWZyYW1lJyk7DQoJaWYobnVsbCA9PSB0YWJzZnJhbWUpIHJldHVybjsNCg0K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IuZW5zdXJlVGFiSXNWaXNpYmxlKGdldEJyb3dzZXIoKS5tQ3VycmVudFRhYi5fdFBvcyk7DQoJdGFiYmFyLmNhblNjcm9sbFRhYnNSaWdodCA9ICF0YWJiYXIucmlnaHRFbmQ7DQoNCn0pKCk7">Hover tab bar scroll-buttons</a>
When using TabMix and a full tab bar, it shows 2 scroll buttons on the far right. This moves the left scroll button to the left, and scrolls the tab bar by just hovering the mouse over one of the buttons.
Again, requires TabMix Plus.
Updated 21-01-07: Fixes the disabled attribute of the buttons. Great for use when applying <a href="data:text/javascript;charset=utf-8;base64,LnRhYnMtc2Nyb2xsLXJpZ2h0LWJ1dHRvbltkaXNhYmxlZD0idHJ1ZSJdLA0KLnRhYnMtc2Nyb2xsLWxlZnQtYnV0dG9uW2Rpc2FibGVkPSJ0cnVlIl0gew0KICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7DQp9">this style</a> to hide either button if its disabled (thanks alta88).
Last edited by UnfocusedOne on January 20th, 2007, 8:13 am, edited 1 time in total.

paulfox
 
Posts: 1510
Joined: May 8th, 2004, 1:38 pm

Post Posted January 13th, 2007, 3:07 am

@UnfocusedOne: You seem pretty focused to me!! That middle one with the progress bar in title is GREAT!! Thanks so much for that - I don't use the status bar, and the percentage is almost imperceptible - except if you're looking at it because the page is taking forever! Brilliant, excellent job. Really. Cheers/ p
PentiumIII/W2K, Toshiba AMD laptop/Vista. FX 3 on both.

pile0nades
 
Posts: 756
Joined: May 15th, 2005, 2:31 am

Post Posted January 13th, 2007, 12:53 pm

<a href="data:text/javascript;charset=utf-8;base64,dmFyIHN0YXR1c2JhciA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdGF0dXMtYmFyIik7DQp2YXIgbWVudWJhciA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJ0b29sYmFyLW1lbnViYXIiKTsNCg0KbWVudWJhci5hcHBlbmRDaGlsZChzdGF0dXNiYXIpOw0Kc3RhdHVzYmFyLnNldEF0dHJpYnV0ZSgic3R5bGUiLCAiLW1vei1hcHBlYXJhbmNlOiB0b29sYmFyOyIpOw0Kc3RhdHVzYmFyLnNldEF0dHJpYnV0ZSgiZmxleCIsICI0MDAiKTs%3D">Status bar in menubar</a>
Moves the status bar into the menu bar for a look like this:
Image
Linkify bug numbers - test: bug 258287

Chad-)
 
Posts: 166
Joined: August 29th, 2005, 7:01 am

Post Posted January 13th, 2007, 3:24 pm

UnfocusedOne wrote:<a href="data:text/javascript;charset=utf-8;base64,KHsNCglpbml0OiBmdW5jdGlvbigpDQoJew0KCQljb25zdCBuc0lXZWJQcm9ncmVzcyA9IENvbXBvbmVudHMuaW50ZXJmYWNlcy5uc0lXZWJQcm9ncmVzczsNCgkJY29uc3QgZmlsdGVyID0gbnNJV2ViUHJvZ3Jlc3MuTk9USUZZX1BST0dSRVNTICYNCgkJCQkJCW5zSVdlYlByb2dyZXNzLk5PVElGWV9TVEFURSAmDQoJCQkJCQluc0lXZWJQcm9ncmVzcy5OT1RJRllfU1RBVEVfV0lORE9XOw0KDQoJCUFycmF5LmZvckVhY2goZ2V0QnJvd3NlcigpLm1UYWJzLCBmdW5jdGlvbihhVGFiKSB7DQoJCQlhVGFiLmxpbmtlZEJyb3dzZXIuYWRkUHJvZ3Jlc3NMaXN0ZW5lcih0aGlzLCBmaWx0ZXIpOw0KCQl9LCB0aGlzKTsNCgkJDQoJCWdCcm93c2VyLmFkZEV2ZW50TGlzdGVuZXIoIlRhYk9wZW4iLCB0aGlzLCBmYWxzZSk7DQoJCWdCcm93c2VyLmFkZEV2ZW50TGlzdGVuZXIoIlRhYkNsb3NlIiwgdGhpcywgZmFsc2UpOw0KDQoNCg0KCQlldmFsKCJnQnJvd3Nlci51cGRhdGVUaXRsZWJhciA9ICIgKyBnQnJvd3Nlci51cGRhdGVUaXRsZWJhci50b1N0cmluZygpLnJlcGxhY2UoJ3RoaXMub3duZXJEb2N1bWVudC50aXRsZSA9IG5ld1RpdGxlOycsIA0KCQkJJ3Zh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lNUQVRFX1NUT1ApKQ0KCQkJcmV0dXJuOw0KDQoJCXZhciBiaW5kZXggPSBnQnJvd3Nlci5nZXRCcm93c2VySW5kZXhGb3JEb2N1bWVudChhUHJvZ3Jlc3MuRE9NV2luZG93LmRvY3VtZW50KTsNCgkJZ0Jyb3dzZXIuZ2V0QnJvd3NlckF0SW5kZXgoYmluZGV4KS5pc0xvYWRpbmcgPSAoYVN0YXRlRmxhZ3MgJiBpc0lXUEwuU1RBVEVfU1RBUlQpID09IGlzSVdQTC5TVEFURV9TVEFSVDsNCg0KDQoJCWlmKGdCcm93c2VyLm1UYWJCb3guc2VsZWN0ZWRJbmRleCAhPSBiaW5kZXgpDQoJCQlyZXR1cm47DQoNCgkJZ0Jyb3dzZXIudXBkYXRlVGl0bGViYXIoKTsJDQoJfSwNCg0KCW9uTG9jYXRpb25DaGFuZ2U6IGZ1bmN0aW9uKCkgeyB9LA0KCW9uU3RhdHVzQ2hhbmdlOiBmdW5jdGlvbigpIHsgfSwNCglvblNlY3VyaXR5Q2hhbmdlOiBmdW5jdGlvbigpIHsgfSwNCglvbkxpbmtJY29uQXZhaWxhYmxlOiBmdW5jdGlvbigpIHsgfSwNCg0KDQoJUXVlcnlJbnRlcmZhY2U6IGZ1bmN0aW9uKGFJSUQpIHsNCgkJdmFyIENpID0gQ29tcG9uZW50cy5pbnRlcmZhY2VzOw0KCQlpZiAoIVtDaS5uc0lET01FdmVudExpc3RlbmVyLCBDaS5uc0lXZWJQcm9ncmVzc0xpc3RlbmVyLCBDaS5uc0lTdXBwb3J0c1dlYWtSZWZlcmVuY2UsIENpLm5zSVN1cHBvcnRzXS5zb21lKGFJSUQuZXF1YWxzKSkNCgkJew0KCQkJdGhyb3cgQ29tcG9uZW50cy5yZXN1bHRzLk5TX05PSU5URVJGQUNFOw0KCQl9DQoJCXJldHVybiB0aGlzOw0KCX0NCn0pLmluaXQoKTsNCg%3D%3D">Load progress in title</a>
Shows page load progress of the current tab (in percentage) in the title bar of a browser window. Handy when theres multiple windows open, and things are moving slowly.

I wish someone would write a script that puts the progress meter on the tab.

pile0nades
 
Posts: 756
Joined: May 15th, 2005, 2:31 am

Post Posted January 14th, 2007, 3:42 am

Is it possible to add a toolbar button to the palette using userChrome.xul?
Linkify bug numbers - test: bug 258287

UnfocusedOne
 
Posts: 5
Joined: January 12th, 2007, 4:23 am
Location: New Zealand

Post Posted January 14th, 2007, 12:33 pm

pile0nades wrote:Is it possible to add a toolbar button to the palette using userChrome.xul?


Somewhere in the overlay:
Code: Select all
   <toolbarpalette id="BrowserToolbarPalette">
      <toolbarbutton id="whatever-button" class="toolbarbutton-1 chromeclass-toolbar-additional" label="do stuff" tooltiptext="does stuff" oncommand="doStuff();" onclick="doSuff();/>
   </toolbarpalette>


And, of course, some way to add style to that button. So at the top of the .xul file:
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet href="whatever.css" type="text/css"?>


What means you'll need a seperate .css file. Unless you explicitly add in a style="" attribute to the toolbarbutton, but then you get no hover effect. To add the image, just use list-style-image (and -moz-image-region, if needed). Something like:

Code: Select all
#whatever-button {
   list-style-image: url('whatever-toolbar.png');
   -moz-image-region: rect(0px 35px 28px 0px);
}
#whatever-button:hover {
   -moz-image-region: rect(0px 70px  28px 35px);
}
#whatever-button:active {
   -moz-image-region: rect(0px 140px 28px 105px);
}


Note: no idea if those relative paths will work... using a chrome:// URL won't.

DynaBMan

User avatar
 
Posts: 383
Joined: November 15th, 2003, 9:46 pm
Location: Oklahoma

Post Posted January 14th, 2007, 3:05 pm

I have a question about using this on Linux. I was telling my brother about this extension and sent him a copy of the userchrome.js with the sub-script loader and the code I am using to put the menubar items in the context menu of the home button. He is very computer savvy and has no trouble navigating Linspire, but the scripts simply do not work at all on his installation of Firefox 2. He does have Chrome Edit SE installed and he has checked the files. Everything seems to be in order except for the fact that it will not load the scripts. He has also disabled all extensions except for Chrome Edit SE and it still does not work. Is there something that has to be done to run this extension on Linux?
LJ
My best friend is my wife!!
Political Realities

peaveyman

User avatar
 
Posts: 341
Joined: June 1st, 2003, 6:24 pm

Post Posted January 14th, 2007, 3:19 pm

DynaBMan wrote:I have a question about using this on Linux. I was telling my brother about this extension and sent him a copy of the userchrome.js with the sub-script loader and the code I am using to put the menubar items in the context menu of the home button. He is very computer savvy and has no trouble navigating Linspire, but the scripts simply do not work at all on his installation of Firefox 2. He does have Chrome Edit SE installed and he has checked the files. Everything seems to be in order except for the fact that it will not load the scripts. He has also disabled all extensions except for Chrome Edit SE and it still does not work. Is there something that has to be done to run this extension on Linux?


I did try this with a fresh profile and it still doesn't work.

pirlouy

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

Post Posted January 14th, 2007, 3:46 pm

pile0nades wrote:<a href="data:text/javascript;charset=utf-8;base64,dmFyIHN0YXR1c2JhciA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzdGF0dXMtYmFyIik7DQp2YXIgbWVudWJhciA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJ0b29sYmFyLW1lbnViYXIiKTsNCg0KbWVudWJhci5hcHBlbmRDaGlsZChzdGF0dXNiYXIpOw0Kc3RhdHVzYmFyLnNldEF0dHJpYnV0ZSgic3R5bGUiLCAiLW1vei1hcHBlYXJhbmNlOiB0b29sYmFyOyIpOw0Kc3RhdHVzYmFyLnNldEF0dHJpYnV0ZSgiZmxleCIsICI0MDAiKTs%3D">Status bar in menubar</a>
It's wonderful. Big thanks for that. ;)

pile0nades
 
Posts: 756
Joined: May 15th, 2005, 2:31 am

Post Posted January 14th, 2007, 4:29 pm

I can't get the button to appear in the palette. Code:

Code: Select all
  <toolbarpalette id="BrowserToolbarPalette">
    <toolbarbutton
        id="compactmenu-button"
        class="toolbarbutton-1 chromeclass-toolbar-additional"
        label="Compact Menu"
        tooltiptext="Compact Menu"
        popup="main-menubar" />
  </toolbarpalette>


However, I can overlay it directly to the toolbar with:

Code: Select all
  <toolbar id="nav-bar">
    <toolbarbutton
        id="compactmenu-button"
        class="toolbarbutton-1 chromeclass-toolbar-additional"
        label="Compact Menu"
        tooltiptext="Compact Menu"
        popup="main-menubar" />
  </toolbar>
Linkify bug numbers - test: bug 258287

JNewbry

User avatar
 
Posts: 321
Joined: April 9th, 2005, 3:56 am
Location: Dallas,TX

Post Posted January 14th, 2007, 5:22 pm

DynaBMan... or anyone...
Just a gentle reminder, the ChromEdit Plus SE extension INCLUDES the userChrome.js extension.
So... if you have both installed, disable or uninstall the userChrome.js extension.
Running both can cause your brother's problem.
<a href="http://webdesigns.ms11.net/chromeditp.html" target="_blank">ChromEdit Plus</a> | <a href="http://webdesigns.ms11.net/winstripethemes.html" target="_blank">Firefox Themes</a>

DynaBMan

User avatar
 
Posts: 383
Joined: November 15th, 2003, 9:46 pm
Location: Oklahoma

Post Posted January 14th, 2007, 6:44 pm

JNewbry wrote:DynaBMan... or anyone...
Just a gentle reminder, the ChromEdit Plus SE extension INCLUDES the userChrome.js extension.
So... if you have both installed, disable or uninstall the userChrome.js extension.
Running both can cause your brother's problem.


I will have to check, but I do think he was only running ChromEdit Plus SE. I will make sure about that.
LJ
My best friend is my wife!!
Political Realities

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 1 guest