[Ext] userChrome.js [support discontinued]

Announce and Discuss the Latest Theme and Extension Releases.
Cye3s
Posts: 20
Joined: December 28th, 2007, 9:53 pm

Post by Cye3s »

Someone help?This code doesn't work on Firefox 3 beta2 anymore...

use this on Minefield only:

*::::::: For Bookmarks:::::::::::*

eval("PlacesController.prototype.openSelectedNodeIn = " + PlacesController.prototype.openSelectedNodeIn.toString().replace('openUILinkIn(node.uri, aWhere);','var tabBrowser = null, browserWindow = getTopWin(); if (browserWindow) tabBrowser = browserWindow.getBrowser(); if (tabBrowser && (tabBrowser.currentURI.spec != "about:blank" || tabBrowser.webProgress.isLoadingDocument) && (!/^j/.test(node.uri) && aWhere == "current")) aWhere = "tab"; $&'));
phunkydizco
Posts: 73
Joined: February 1st, 2006, 11:34 pm

Post by phunkydizco »

How can I move tab-bar above nav-bar?
phunkydizco
Posts: 73
Joined: February 1st, 2006, 11:34 pm

Post by phunkydizco »

With the following code the tab-bar is above the nav-bar.

Code: Select all

(function() {
  var navbar = document.getElementById("nav-bar");
  navbar.parentNode.insertBefore(gBrowser.mStrip, navbar);
})();


But then the tabs look strange and the personal-bar is empty.

Image

Can someone help?
lupin1984
Posts: 18
Joined: January 26th, 2008, 8:32 am

Post by lupin1984 »

http://forums.mozillazine.org/viewtopic ... 20#2188420

this js don't work!

i'm using ff 2.0.0.11 and userChrome.js 0.8

someone help me :)

you can find this extension here http://www.polarcloud.com/truncfix
User avatar
Alice0775
Posts: 2817
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA

Post by Alice0775 »

lupin1984 wrote:http://forums.mozillazine.org/viewtopic.php?p=2188420#2188420

this js don't work!

i'm using ff 2.0.0.11 and userChrome.js 0.8

someone help me :)

you can find this extension here http://www.polarcloud.com/truncfix


replace
window.addEventListener("load", truncFix.init, false);
with
truncFix.init();
lupin1984
Posts: 18
Joined: January 26th, 2008, 8:32 am

Post by lupin1984 »

Alice0775 wrote:
lupin1984 wrote:http://forums.mozillazine.org/viewtopic.php?p=2188420#2188420

this js don't work!

i'm using ff 2.0.0.11 and userChrome.js 0.8

someone help me :)

you can find this extension here http://www.polarcloud.com/truncfix


replace
window.addEventListener("load", truncFix.init, false);
with
truncFix.init();


it works,thanks :)
aronin
Posts: 243
Joined: November 9th, 2005, 7:31 pm

Post by aronin »

phunkydizco wrote:With the following code the tab-bar is above the nav-bar.

Code: Select all

(function() {
  var navbar = document.getElementById("nav-bar");
  navbar.parentNode.insertBefore(gBrowser.mStrip, navbar);
})();


But then the tabs look strange and the personal-bar is empty.

Can someone help?


Image

I tried various combinations of doing this... the closest I came to was moving the appcontent above the nav-bar (see the screenshot)... but then since appcontent includes the Tabbar as well as Browser Content area, the browser content area remained empty, though the Tabbar moved above nav-bar just fine.

I used the following code:

Code: Select all

(function() {
  var content = document.getElementById("content");
  var navbar = document.getElementById("nav-bar");
  navbar.parentNode.insertBefore(content, navbar);
})();


I guess the problem is that the Tabbar and Browser Content area are a part of the same element, hence if we try to move one, the other moves along. I don't know how to separate them or call them out using separate Ids. If someone can help me do that, I think we can crack this.
ithinc
Posts: 1029
Joined: February 19th, 2008, 12:10 am

Post by ithinc »

I'm curious why there is no dedicated site to post userChrome.js scripts. Here is my first useful script. It is used to place some toolbar buttons into the status bar. It works well in both Firefox 2 and 3. It creates a toolbar named "statusbar", and places the toolbar to the end of the statusbar. When you start customizing the toolbars, it popups to the area of toolbox and after the customization, it returns the end of the statusbar.
There's a little conflict with Organize Status Bar, but it can still work. I have a modified version of OSB 0.5.2 which cooperates well with my script. With it, I can place my newly-created taskbar anywhere in the status bar.

Code: Select all

// ==UserScript==
// @name           toolbarInStatusbar.uc.js
// @namespace      ithinc#mozine.cn
// @description    Toolbar in Statusbar
// @include        main
// @compatibility  Firefox 2.0 3.0
// @author         ithinc
// @version        LastMod 2008/3/4 19:30 Code simplification
// @version        LastMod 2008/3/1 06:30 Initial release
// @Note           null
// ==/UserScript==

/* :::: Toolbar in Statusbar :::: */

var statusbar = document.getElementById("status-bar");
var statusbarToolbar = document.getElementById("__customToolbar_statusbar");
if (statusbarToolbar) {
  statusbar.appendChild(statusbarToolbar);
  statusbarToolbar.setAttribute("style", "-moz-appearance: statusbar;");
  statusbarToolbar.setAttribute("mode", "icons");
  statusbarToolbar.setAttribute("iconsize", "small");
}

var cmd = document.getElementById("cmd_CustomizeToolbars");
cmd.setAttribute("oncommand", '(function(){\
  /*alert("cmd_CustomizeToolbars_Entry");*/\
  var navbox = document.getElementById("navigator-toolbox");\
  var statusbarToolbar = document.getElementById("__customToolbar_statusbar");\
  var currentset = "";\
  if(statusbarToolbar) {\
    currentset = statusbarToolbar.getAttribute("currentset");\
    statusbarToolbar.parentNode.removeChild(statusbarToolbar);\
  }\
  navbox.appendCustomToolbar("statusbar", currentset);\
  BrowserCustomizeToolbar();\
})()');

setTimeout(function() {
  var navbox = document.getElementById("navigator-toolbox");
  navbox.__tis__customizeDone = navbox.customizeDone;
  navbox.customizeDone = function(aToolboxChanged) {
    //alert("customizeDone_Entry");
    this.__tis__customizeDone(aToolboxChanged);

    var statusbar = document.getElementById("status-bar");
    var statusbarToolbar = document.getElementById("__customToolbar_statusbar");
    if(statusbarToolbar) {
      statusbar.appendChild(statusbarToolbar);
      statusbarToolbar.setAttribute("style", "-moz-appearance: statusbar;");
      statusbarToolbar.setAttribute("mode", "icons");
      statusbarToolbar.setAttribute("iconsize", "small");
    }
    //alert("customizeDone_Exit");
  }
}, 100);


Note:
1. When pasting the code to your editor, don't add any blank after each "\". "\" must be the last character of the line.
2. If the toolbar doesn't return the end of status bar after a customization, you may increase the timeout[default 100ms] and restart firefox.
3. Sometimes some newly installed extension may invoke the BrowserCustomizeToolbar() directly, then you will see the statusbarToolbar not popuped in advance. In this case, you need to do a manual customization and make any change before you close or restart firefox, otherwise you may lose the statusbarToolbar at your next startup.
aronin
Posts: 243
Joined: November 9th, 2005, 7:31 pm

Post by aronin »

Cye3s wrote:Someone help?This code doesn't work on Firefox 3 beta2 anymore...

use this on Minefield only:

*::::::: For Bookmarks:::::::::::*

eval("PlacesController.prototype.openSelectedNodeIn = " + PlacesController.prototype.openSelectedNodeIn.toString().replace('openUILinkIn(node.uri, aWhere);','var tabBrowser = null, browserWindow = getTopWin(); if (browserWindow) tabBrowser = browserWindow.getBrowser(); if (tabBrowser && (tabBrowser.currentURI.spec != "about:blank" || tabBrowser.webProgress.isLoadingDocument) && (!/^j/.test(node.uri) && aWhere == "current")) aWhere = "tab"; $&'));


@Cye3s

This code doesn't work with the latest nightlies anymore.
adriennex
Posts: 89
Joined: February 9th, 2008, 12:11 pm

Post by adriennex »

ithinc wrote:I'm curious why there is no dedicated site to post userChrome.js scripts.

I have a modified version of OSB 0.5.2 which cooperates well with my script. With it, I can place my newly-created taskbar anywhere in the status bar.
Maybe no dedicated site to post userChrome.js scripts for same reason you don't post link to modified version of OSB or how to modify.
User avatar
Eygte450
Posts: 179
Joined: July 20th, 2006, 12:52 pm

Post by Eygte450 »

wrong message
plz someone delete it
punistation
Posts: 8
Joined: August 21st, 2006, 12:44 am

Post by punistation »

I pasted the following into userchrome to bring the FIND bar to the top of the screen.



/* Find bar on top */
(function () {
// move find bar to the top
// thanks to Zoolcar9 for this code
var findbar = document.getElementById('FindToolbar');
var tabbrowser = document.getElementById('content');
var tabpanels = tabbrowser.mPanelContainer;
tabpanels.parentNode.insertBefore(findbar, tabpanels);

// move the top border to the bottom
findbar.setAttribute("style", "-moz-border-bottom-colors: none;"); // thanks again Zoolcar9!
findbar.style.borderTop = "1px solid";
findbar.style.borderBottom = "1px solid";

// move close button right
findbar.appendChild(document.createElement("toolbarspring"));
findbar.appendChild(document.getElementById("find-closebutton"));

})();


And it works. However, I also have FF's inbuilt "search for text when I start typing" option enabled, and when the FIND bar appears, it IS on the top... but the NEXT and PREVIOUS buttons aren't there.
User avatar
Orphu of Io
Posts: 172
Joined: December 3rd, 2007, 7:20 pm

Post by Orphu of Io »

punistation wrote:I also have FF's inbuilt "search for text when I start typing" option enabled, and when the FIND bar appears, it IS on the top... but the NEXT and PREVIOUS buttons aren't there.

Those buttons are hidden on the Quickfind toolbar. Add this to userChrome.css:

Code: Select all

#FindToolbar > * {
  display: -moz-box !important;
}
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 »

Orphu of Io wrote:Those buttons are hidden on the Quickfind toolbar. Add this to userChrome.css:

Code: Select all

#FindToolbar > * {
  display: -moz-box !important;
}


Tried pasting it in various places (Before the "FIND Bar on top" code, after it, in the middle, etc), and all it did was put the FIND bar back on the bottom again.
User avatar
Orphu of Io
Posts: 172
Joined: December 3rd, 2007, 7:20 pm

Post by Orphu of Io »

punistation wrote:
Orphu of Io wrote:Those buttons are hidden on the Quickfind toolbar. Add this to userChrome.css:

Code: Select all

#FindToolbar > * {
  display: -moz-box !important;
}


Tried pasting it in various places (Before the "FIND Bar on top" code, after it, in the middle, etc), and all it did was put the FIND bar back on the bottom again.


It needs to go in userChrome.css, not userChrome.js.

http://kb.mozillazine.org/UserChrome.css
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0
Locked