[Ext] userChrome.js

Announce and Discuss the Latest Theme and Extension Releases.
Locked
Old Greg S
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by Old Greg S »

Zoolcar9 wrote:
Greg S wrote:When I use this code to add the find close button to the right within the ViewSource window, the code for sizing the customize toolbar window doesn't work. Any ideas?

All scripts that use WindowHook snippet must be in a same file.
  • <a href="data:application/x-javascript;base64,KGZ1bmN0aW9uKCkgewogIC8vc3RhcnQgV2luZG93SG9vayBzbmlwcGV0CiAgdmFyIFdpbmRvd0hvb2sgPSB7CiAgICBvYnNlcnZlOiBmdW5jdGlvbihhU3ViamVjdCwgYVRvcGljLCBhRGF0YSkgewogICAgICAvLy4uLi4uCiAgICB9LAogICAgb25Mb2FkX3dpbmRvdzogZnVuY3Rpb24oKSB7CiAgICAgIC8vLi4uLi4KICAgIH0sCiAgICByZWdpc3RlcjogZnVuY3Rpb24oYVVSTCwgYUZ1bmMpIHsKICAgICAgLy8uLi4uLgogICAgfQogIH07CiAgLy9lbmQgV2luZG93SG9vayBzbmlwcGV0CgogIC8vY3VzdG9taXplIHRvb2xiYXIgd2luZG93CiAgV2luZG93SG9vay5yZWdpc3RlcigiY2hyb21lOi8vZ2xvYmFsL2NvbnRlbnQvY3VzdG9taXplVG9vbGJhci54dWwiLAogICAgZnVuY3Rpb24oYVdpbmRvdykgewogICAgICAvLy4uLi4uCiAgICB9CiAgKTsKCiAgLy92aWV3IHNvdXJjZSB3aW5kb3cKICBXaW5kb3dIb29rLnJlZ2lzdGVyKCJjaHJvbWU6Ly9nbG9iYWwvY29udGVudC92aWV3U291cmNlLnh1bCIsCiAgICBmdW5jdGlvbihhV2luZG93KSB7CiAgICAgIC8vLi4uLi4KICAgIH0KICApOwoKICAvL290aGVyIHdpbmRvdwogIFdpbmRvd0hvb2sucmVnaXN0ZXIoImNocm9tZTovL2Zvby9jb250ZW50L2Zvby54dWwiLAogICAgZnVuY3Rpb24oYVdpbmRvdykgewogICAgICAvLy4uLi4uCiAgICB9CiAgKTsKCn0pKCk7IA%3D%3D">example</a>


OOps, I called myself doing just that but it appears the CTW code wasn't pasted in after all. No wonder it didn't work,lol.

Now, here's one I think may not be possible but won't know for sure until I ask. Is there a way to add a context menu to FF's vertical scrollbar only? What I'd like to do is add the page up/page down, go to top/go to bottom etc. to this context menu but only want it to popup with the added menuitems when right clicking the vertical scrollbar.

If not then I'd settle for a page up/page down added to the content area context menu like the go to bottom/back to top extension does.
Old Greg S
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by Old Greg S »

And another one I'd like to have, a toolbarbutton to open the CustomizeToolbarWindow. I have the xul, css & the js for the toolbarbutton which work as part of my custom toolbarbuttons, the only problem is that the window is blank. Is this even possible?
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »


:arrow: Context menu for Home button

The context menu will display list of home pages.
This is usefull if you have multiple home pages and wants to open only one of them.

Updated 2006-08-31:
Adds menu items to set home page to current tab, all opened tabs, blank tab, bookmark(s)
Last edited by Zoolcar9 on September 5th, 2006, 5:42 am, edited 3 times in total.
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
Old Greg S
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by Old Greg S »

Zoolcar9 wrote:
Greg S wrote:And another one I'd like to have, a toolbarbutton to open the CustomizeToolbarWindow

http://forums.mozillazine.org/viewtopic ... 94#2354294



I'd rather do it without the extension if possible
pile0nades
Posts: 756
Joined: May 15th, 2005, 2:31 am

Post by pile0nades »

The DragAndGo script no longer works with searching selected text (edit: still works with links) in 20060706 branch nightly. I get this error when dragging:

Code: Select all

Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIStringBundle.GetStringFromName]
Source file: XStringBundle
Line: 17
Linkify bug numbers - test: bug 258287
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

pile0nades wrote:The DragAndGo script no longer works with searching selected text (edit: still works with links) in 20060706 branch nightly.

I've updated the snippet: instead of using Firefox' default fallback search engine (which recently got removed), it now defaults to Google - if the pref browser.search.defaulturl isn't set.

Greg S wrote:I'd rather do it without the extension if possible

Just get one of the "add a toolbar button" snippets and modify the button to call <code>BrowserCustomizeToolbar();</code> when you click it.
Old Greg S
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by Old Greg S »

zeniko wrote:
Greg S wrote:I'd rather do it without the extension if possible

Just get one of the "add a toolbar button" snippets and modify the button to call <code>BrowserCustomizeToolbar();</code> when you click it.

And as always, you are correct. Thank you

Edit: Ok the above works fine from userChrome.js and I'm thankful for that but with my limited knowledge on this, my button was at a fixed postion on the toolbar next to whatever button I told it to be next to and without the option to drag it off the toolbar into the customize toolbar window. My original intent was to add this to the collection of custom toolbar buttons that I've made using the tutorial on how to do so. My original reply on this made mention of it working but the window would come up blank. I've since been able to overcome that by adding your code above to mybuttons.xul for this particular button and it works. This is what I've added in the xul

Code: Select all

  oncommand="BrowserCustomizeToolbar();"

but all the other toolbarbuttons use there respective numbers/id for oncommand as in

Code: Select all

oncommand="CustomButton[4]()"


Is what I've done OK or do I need to do something different? It works fine but I don't know for sure if it will eventually puke on me.
ephemeralskin
Posts: 5
Joined: April 1st, 2004, 5:47 pm

Post by ephemeralskin »

any chance someone could hook me up with a userchrome.js script that would allow for tabs to be selected by pausing on them with the mouse (and not clicking)? i know it is included in tabmix, but i just need this one thing. thatd be the awesomest! :)
Old Greg S
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by Old Greg S »

How about one that would change the menuitem label of "Work Offline" to "Work Online" when the work offline is checked. I use an icon for each mode which means the check doesn't appear for me when work offline is checked. Each icon is different and it's easy to spot but the Work Online label to go with it would be nice.
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Post by Diorser »

Is it possible to change default source viewer without adding any extension by using UserChrome.js or anything else but an extension ?
Thanks.
KDE4.3 RC
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »

Diorser wrote:Is it possible to change default source viewer without adding any extension by using UserChrome.js or anything else but an extension ?

If you're using 2.0 alpha or beta:

http://kb.mozillazine.org/View_source.editor.external
http://kb.mozillazine.org/View_source.editor.path

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Post by Diorser »

Ha thanks; I was sure I did not dream and read this one day.

But I did not notice it was only compatible with release 2.0 and above.

As I don't really need Fx 2.0 for the moment, it will be for later, except if a trick is proposed for 1.5 in the meantime !
I am surprised that userChrome.js does not offer this feature.

Thanks again.

EDIT: tried Fx 2.0 with view editor configuration as proposed above.
Seems to be bugged for the moment.
SilentJ
Posts: 251
Joined: November 8th, 2002, 6:42 am

Post by SilentJ »

ephemeralskin wrote:any chance someone could hook me up with a userchrome.js script that would allow for tabs to be selected by pausing on them with the mouse (and not clicking)? i know it is included in tabmix, but i just need this one thing. thatd be the awesomest! :)
#

...that is exactly what i need, also one to move the tab close button back to the right without breaking the built-in undo close tab
User avatar
Columba
Posts: 217
Joined: August 16th, 2004, 7:27 am

Post by Columba »

Is there a way to specify a fixed tab width for BonEcho with this extension ?
User avatar
aaron
Posts: 3130
Joined: November 4th, 2002, 8:49 pm
Location: Texas
Contact:

Post by aaron »

I'd like to know if I can hide the "local folders" account in SeaMonkey mail.
Locked