ZitatWie verwendet man eigentlich mehrere Scripte in der userchrome.js?
Ganz einfach. Sie müssen natürlich irgend einen Namen haben, immer zusammen schreiben, egal ob man ein _ oder + oder - dazwischen im Namen setzt. Auf alle Fälle kommt es auf das Ende des Scriptnamen. Also zB: Vertikal_Toolbar.uc.js , oder papalapap+hastdunichtgesehen.uc.xul
Die Scripte liegen einfach nur brav neben der userchrome.js im Chromeordner und dat was dann eigentlich schon.
Wie die userchrome.js mtw. dabei auszusehen hat, hab ich bereits hier geschrieben.
Hier der originale Javascriptcode für Nr. 27.) Vertikal Tollbar:
CSS
// Vertical Toolbar(mod) //
(function() {
var mode = "icons"; // "icons", "text" or "full"
var size = "large"; // "small" or "large"
// array of toolbar item id, "separator", "spring" and "spacer".
var currentSet = [
"new-tab-button",
"new-window-button",
"fullscreen-button",
"separator",
"bookmarks-button",
"history-button",
"downloads-button",
"spring",
"cut-button",
"copy-button",
"paste-button",
"separator",
"print-button",
];
var toolbox = document.createElement("toolbox");
document.getElementById("browser").insertBefore(
toolbox, document.getElementById("sidebar-box")
);
toolbox.palette = document.getElementById("navigator-toolbox").palette;
var toolbar = document.createElement("toolbar");
toolbox.appendChild(toolbar);
toolbar.id = "vertical-toolbar";
toolbar.className = "chromeclass-toolbar";
toolbar.setAttribute("mode", mode);
toolbar.setAttribute("iconsize", size);
toolbar.setAttribute("orient", "vertical");
toolbar.setAttribute("flex", "1");
currentSet.forEach(function(id){ toolbar.insertItem(id); });
if (currentSet.indexOf("spacer") < 0 && currentSet.indexOf("separator") < 0)
return;
var style = <![CDATA[
toolbar[orient="vertical"] > toolbarspacer { height: 15px; }
toolbar[orient="vertical"] > toolbarseparator {
-moz-appearance: none !important;
margin: 0.2em 2px;
border-bottom: 1px solid ThreeDHighlight;
border-top: 1px solid ThreeDShadow;
height: 2px;
border-left: none;
border-right: none;
}
]]>.toString();
var sspi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css,' + encodeURI(style) + '"'
);
document.insertBefore(sspi, document.documentElement);
sspi.getAttribute = function(name) {
return document.documentElement.getAttribute(name);
};
// -------------------- ここから -----------------------------------------------------------------------
var addonButton = document.createElement("toolbarbutton");
addonButton.id = "viewAdd-onsSidebar-Button"; // sidebarbotton アドオン の id
addonButton.setAttribute("tooltiptext", "Addons");
addonButton.setAttribute("type", "checkbox");
addonButton.setAttribute("observes", "viewAdd-onsSidebar"); // sidebarbotton アドオン の id
addonButton.setAttribute("autoCheck", "false");
addonButton.setAttribute("oncommand", "toggleSidebar('viewAdd-onsSidebar');"); // sidebarbotton アドオン の id
addonButton.setAttribute("style", "padding-left: 6px !important;padding-right: 0px !important;");
if (size == "small" ) {
addonButton.style.listStyleImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABZ0RVh0Q3JlYXRpb24gVGltZQAwOC8xMS8wNdiEE10AAAAldEVYdFNvZnR3YXJlAE1hY3JvbWVkaWEgRmlyZXdvcmtzIE1YIDIwMDSHdqzPAAADFElEQVR4nGWTy2tcZRjGn+8y58wl5yQzmZnMZC4poRvdqBFFEWxp6T6CtKi4FcGFm/bvMIjgRjdFwYVY3LkQLILdNFpTFZJo22RaO0mmc3Jmzpzbd3Uh0Vqf3W/x/Hh54SGtDR8nWW5333dLpQ1tLTIjAMASa4k2ahCFxxfyWbaLJ8Ifhxmyd893L8AvechNBqFzwuFg8+DH/g/jvTMe3P8J6ONQyMnl6/vfXacOAy0TeJ6HYT60u6PtT5e0f+3JMgDwhInnEP0NafhwWzTUtRdWXjq72uiDWoqd8e9BsB9+BIIllNBzOd9miqYnAtL5omXP989BaQFYgnKhjLVTz2JveheEACUyh1v3t8AIwx+TO7i3d/fFCpyb/1zQLDVxrv8qags1zESEg+QA9+MBNDQSmWBiQ/RaTbi0CGkE9uN7x5XFUvWQBa/5qvINF0bgp4OfcWPzRrC2vFabK5YAB1BGwRiFTGdIV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ymj453Dfh3Pfp86dX77tmw21sIc6T8Vhq9JmIqhiAEJqBsS+SCOcquSlfjWt6cOl+anZ54ZS47dfe2tTtSiHxAf3yHsKtnJ6Hofc8unPnKrtu3J1MNjYgopgpX+U9+lFx5OaeNMe3NqXRXKptY376OSEJQwkRhpsQPvIMrP1r+6nupsYNxFSceySg1IRRfBKq2Ql9mHTu7tzcuhPNoZxhZGDPD4xeGe8rtZ73fhIOVsbDY+4vk599rGxnIlfN3b+n+8G2+qrEdll31o//uODaVme6LcLcn/xL7eX1wrA8Q2CpXytPMlKcRoCvZy+tTb87rb8m+AnMVoAxU3zmYPwwcXTx09VC2OfO1bDaNIApwbx/JT3KE/UAqwHj1byIPESIbEtoALZbIaZaiRe5Ib2xb89uW7927vx9gGSgBpfW/z3y2szPdH08oiqaIen9mHDX5XgIWgRURsb4Vh0eMdU0bQNWU1ENxV0970z+UPvDi5qFR4NcALYeTa6u+eXxb19Z4e7IVY90HHKcu1+GqFH7VVDl++Rk8Veu91O8KcOIQTzqBJiDyfNVYiirxl6feQKFw4tAu4lahgEYgU3/eKDRQAIrUvLcZ6ACS1wqv852/kR8oIAYkuMEPQD1cHUSLiCil/Pr7sVUAlpqj/Z/5/xfXbFl2AEGvbwAAAABJRU5ErkJggg==)";
}
// ----------------------(history-button)-------------------------------------------
toolbar.insertBefore(addonButton, document.getElementById("history-button").nextSibling);
// toolbar.appendChild(addonButton);
}());
Alles anzeigen