Da gibt es den Ordner Firefox. Dort sind alle Firefox-Dateien drinnnen, wie beim Desktop-Firefox. Dort kommen der Ordner userChromeJS und die Datei config.js rein. Im Unterordner defaults --> pref kommt dann die Datei config-prefs.js rein.
![](https://www.camp-firefox.de/images/avatars/1d/473-1d012cab6cd637851863438c5353dc76110dee28.webp)
Restart Button funktioniert nicht?
-
Spiderman-21 -
24. März 2019 um 11:27 -
Erledigt
-
-
Lege dir am besten ein Lesezeichen auf folgende Seite an:
https://github.com/Endor8/userChrome.js
Dort ganz unten wird die Einrichtung für die Skriptnutzung ausführlich beschrieben.
-
Lege dir am besten ein Lesezeichen auf folgende Seite an:https://github.com/Endor8/userChrome.js
Dort ganz unten wird die Einrichtung für die Skriptnutzung ausführlich beschrieben.
Danke Dir! :klasse: Auf der Seite war ich bereits.
Habe jetzt mal alles nach Anleitung gemacht, geht aber noch immer nicht. Werde mal weiter probieren...(ein echter Sch***)
-
Sind folg. Inhalte richtig?
config.js
Code
Alles anzeigen// /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the userChrome.js component. * * The Initial Developer of the Original Code is * Simon Bünzli <zeniko@gmail.com> * * Portions created by the Initial Developer are Copyright (C) 2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): * alta88 <alta88@gmail.com> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ try { /*Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); */ Components.utils.import("resource://gre/modules/osfile.jsm"); function UserChrome_js() { var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.addObserver(this, "final-ui-startup", false); }; UserChrome_js.prototype = { /*// Properties required for XPCOM registration: classDescription: "userChromeJS Loading Component", classID : Components.ID("{8DEB3B5E-7585-4029-B6D0-4733CE8DED50}"), contractID : "@userChromeJS;1", _xpcom_categories: [{ category: "app-startup", service: true }], */ /* ........ QueryInterface .................................................. */ /* QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISupports, Components.interfaces.nsIObserver, Components.interfaces.nsIModule, Components.interfaces.nsIFactory, Components.interfaces.nsIDOMEventListener]), */ /* ........ nsIObserver ..................................................... */ observe: function(aSubject, aTopic, aData) { var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); switch (aTopic) { /* case "app-startup": case "profile-after-change": os.addObserver(this, "final-ui-startup", false); break; */ case "final-ui-startup": var file = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties) .get("UChrm", Components.interfaces.nsIFile); file.append("userChrome.js"); /* if (!file.exists()) { var componentFile = __LOCATION__; var componentsDir = componentFile.parent; var extensionDir = componentsDir.parent; extensionDir.append("README.txt"); if (extensionDir.exists()) extensionDir.copyTo(file.parent, "userChrome.js"); } */ if (file.exists() && file.isFile() && !Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULRuntime) .inSafeMode) { this.mFileURL = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService) .getProtocolHandler("file") .QueryInterface(Components.interfaces.nsIFileProtocolHandler) .getURLSpecFromFile(file); var path = OS.Constants.Path.libDir; path = OS.Path.join(path, "userChromeJS.js"); this.uCFileURI = OS.Path.toFileURI(path); os.addObserver(this, "domwindowopened", false); } break; case "domwindowopened": aSubject.addEventListener("load", this, true); break; } }, /* ........ nsIDOMEventListener ............................................. */ handleEvent: function(aEvent) { var document = aEvent.originalTarget; if (document.location && document.location.protocol == "chrome:") { try { let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); /* loader.loadSubScript("chrome://userChromeJS/content/userChromeJS.js", document.defaultView, "UTF-8"); */ loader.loadSubScript(this.uCFileURI, document.defaultView, "UTF-8"); loader.loadSubScript(this.mFileURL, document.defaultView, "UTF-8"); } catch (ex) { // script execution can be stopped with |throw "stop";| if (ex !== "stop") { Components.utils.reportError(ex); } } } } }; /** * The following line is what XPCOM uses to create components. Each component * prototype must have a .classID which is used to create it. * * XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4). */ /*var NSGetFactory = XPCOMUtils.generateNSGetFactory([UserChrome_js]); */ new UserChrome_js(); } catch(ex) { Components.utils.reportError(ex); };
config-prefs.js
userChromeJS.js
Code
Alles anzeigen/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the userChromeJS utilities. * * The Initial Developer of the Original Code is * alta88 <alta88@gmail.com> * * Portions created by the Initial Developer are Copyright (C) 2014 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ var EXPORTED_SYMBOLS = ["userChrome"]; /* ........ Utility functions ............................................... */ var userChrome = { path: null, dirToken: null, get loadOverlayDelay () { if (!this._loadOverlayDelay) this._loadOverlayDelay = 500; return this._loadOverlayDelay; }, set loadOverlayDelay(delay) { this._loadOverlayDelay = delay; }, get loadOverlayDelayIncr() { if (!this._loadOverlayDelayIncr) this._loadOverlayDelayIncr = 1600; return this._loadOverlayDelayIncr; }, set loadOverlayDelayIncr(delay) { this._loadOverlayDelayIncr = delay; }, import: function(aPath, aRelDirToken) { let file; this.path = aPath; this.dirToken = aRelDirToken; if (aRelDirToken) { // Relative file let absDir = this.getAbsoluteFile(aRelDirToken); if (!absDir) return; let pathSep = absDir.path.match(/[\/\\]/)[0]; file = absDir.path + (aPath == "*" ? "" : pathSep + aPath.replace(/[\/\\]/g, pathSep)); } else // Absolute file file = aPath; file = this.getFile(file); if (!file) return; if (file.isFile()) { if (/\.js$/i.test(file.leafName)) this.loadScript(file, aRelDirToken, null); else if (/\.xul$/i.test(file.leafName)) { let xul_files = []; xul_files.push(file); this.loadOverlay(xul_files, this.dirToken, null, this.loadOverlayDelay); // this.loadOverlayDelay = this.loadOverlayDelay + this.loadOverlayDelayIncr; } else this.log("File '" + this.path + "' does not have a valid .js or .xul extension.", "userChrome.import"); } else if (file.isDirectory()) this.importFolder(file); else this.log("File '" + this.path + "' is neither a file nor a directory.", "userChrome.import"); }, loadScript: function(aFile, aFolder, aRelDirToken) { setTimeout(function() { Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader) .loadSubScript(userChrome.getURLSpecFromFile(aFile), null, // defaults to the global object of the caller. userChrome.charSet); // log it userChrome.log(aRelDirToken ? ("[" + aRelDirToken + "]/" + (aFolder && aFolder != "*" ? aFolder + "/" : "") + aFile.leafName) : aFile.path, "userChrome.loadScript"); }, 0); }, // XXX: Due to bug 330458, an overlay must finish before another can be // called, otherwise neither are successful. Implementing an observer to // serialize is better left as a fix in the core bug. Here, settimout values // are set to minimize but there is no quarantee; overlay cdata (if any) // needs to consider overlay completions and logging does not strictly mean // an overlay has completed, rather that the overlay file has been invoked. loadOverlay: function(aFiles, aRelDirToken, aFolder, aDelay) { //userChrome.log(aDelay+" multiple import delay", userChrome.loadOverlay); // Increment multiple import delay this.loadOverlayDelay = this.loadOverlayDelay + this.loadOverlayDelayIncr; setTimeout(function() { if (aFiles.length > 0) { //userChrome.log(userChrome.loadOverlayDelay+" inter folder delay", userChrome.loadOverlay); // log it userChrome.log(aRelDirToken ? ("[" + aRelDirToken + "]/" + (aFolder && aFolder != "*" ? aFolder + "/" : "") + aFiles[0].leafName) : aFiles[0].path, "userChrome.loadOverlay"); document.loadOverlay(userChrome.getURLSpecFromFile(aFiles.shift()), null); setTimeout(arguments.callee, userChrome.loadOverlayDelay); } }, aDelay); }, // Include all files ending in .js and .xul from passed folder importFolder: function(aFolder) { let files = aFolder.directoryEntries .QueryInterface(Components.interfaces.nsISimpleEnumerator); let xul_files = []; while (files.hasMoreElements()) { let file = files.getNext().QueryInterface(Components.interfaces.nsIFile); if (/\.js$/i.test(file.leafName) && file.leafName != "userChrome.js") this.loadScript(file, this.path, this.dirToken); else if (/\.xul$/i.test(file.leafName)) { xul_files.push(file); } } if (xul_files.length > 0) this.loadOverlay(xul_files, this.dirToken, this.path); }, getFile: function(aPath, aRelDirToken) { try { let file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsIFile); file.initWithPath(aPath); // Bad file doesn't throw on initWithPath, need to test if (file.exists()) return file; this.log("Invalid file '" + this.path + (this.dirToken ? ("' or file not found in directory with token '" + this.dirToken) : "") + "' or other access error.", "userChrome.getFile"); } catch (e) { // Bad folder throws on initWithPath this.log("Invalid folder '" + this.path + (this.dirToken ? ("' or folder not found in directory with token '" + this.dirToken) : "") + "' or other access error.", "userChrome.getFile"); } return null; }, getAbsoluteFile: function(aRelDirToken) { try { let absDir = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties) .get(aRelDirToken, Components.interfaces.nsIFile); return absDir; } catch (e) { this.log("Invalid directory name token '" + this.dirToken + "' or directory cannot be accessed.", "userChrome.getAbsoluteFile"); return null; } }, getURLSpecFromFile: Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService) .getProtocolHandler("file") .QueryInterface(Components.interfaces.nsIFileProtocolHandler) .getURLSpecFromFile, /* Console logger */ log: function(aMsg, aCaller) { Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService) .logStringMessage(this.date + " userChromeJS " + (aCaller ? aCaller +": " : "") + aMsg); }, get dateFormat() { if (!this._dateFormat) this._dateFormat = "%Y-%m-%d %H:%M:%S"; return this._dateFormat; }, set dateFormat(format) { this._dateFormat = format; }, get date() { let date = new Date(); return date.toLocaleFormat(this.dateFormat); }, set charSet(val) { this._charSet = val; }, get charSet() { if (!this._charSet) this._charSet = "UTF-8"; // use "UTF-8". defaults to ascii if null. return this._charSet; } };
userChrome.js
-
Danke Dir! :klasse: Auf der Seite war ich bereits.Habe jetzt mal alles nach Anleitung gemacht, geht aber noch immer nicht. Werde mal weiter probieren...(ein echter Sch***)
Im Profil hast du auch alles eingerichtet? Beim Portable heißt der Profilordner einfach nur Profilordner. Dort müssen dann deine Skripte rein und die Datei userChrome.js. Für CSS muss dann noch die userChrome.css rein.Die userChrome.js muss so aussehen:
Die erforderlichen Dateien bzw. Ordner userChromJS, config.js und config-pref.js nimm am besten von der Seite hinter dem Link aus Beitrag #62. Der Link im Forumsbeitrag ist manchmal nicht gleich aktuell, wenn sich etwas ändert.
-
die userChrome.js ist doch richtig, denn die erste Zeile ist doch auskommentiert mit // also nicht relevant.
Aber config-prefs.js da fehlt ne Zeile, es muss so aussehen:
Code// config-prefs.js pref("general.config.obscure_value", 0); pref("general.config.filename", "config.js"); pref("general.config.sandbox_enabled", false);
Ergänzung: die userChromeJS.js brauchts meiner Meinung gar nicht mehr.
-
Die Scripte müssen abe nicht direkt in den Profilordner, sondern in den Unterordner chrome?
-
Sind folg. Inhalte richtig?
So genau kann ich dir das nicht sagen. Hole dir die Dateien, wie schon geschrieben, von Endors Seite aus Beitrag #62. Was ich auf jeden Fall schon gesehen habe:In der config-prefs.js fehlt folgende Zeile:
Die Datei main.js im Ordner userChromeJS sollte mindestens von 26.03.2018 sein.
-
die userChrome.js ist doch richtig, denn die erste Zeile ist doch auskommentiert mit // also nicht relevant.
Mein Beitrag hat sich mit dem von generic überschnitten. Als ich meinen Beitrag angefangen habe zu schreiben, kannte ich den von generic noch gar nicht. -
Die Scripte müssen abe nicht direkt in den Profilordner, sondern in den Unterordner chrome?
Ja, wie beim Desktop-Firefox auch. Und natürlich auch die Datei userChrome.js. (und für CSS die Datei userChrome.css) -
So genau kann ich dir das nicht sagen. Hole dir die Dateien, wie schon geschrieben, von Endors Seite aus Beitrag #62. Was ich auf jeden Fall schon gesehen habe:In der config-prefs.js fehlt folgende Zeile:
Die Datei main.js im Ordner userChromeJS sollte mindestens von 26.03.2018 sein.
Die Zeile habe ich ergänzt!
Ordnerstruktur: Da checkt doch kein normaler Mensch (mehr) durch. Ordner userChromeJS wo soll der sein? Gibt's keine aktuelle und TRANSPARENTE Beschreibung bzgl. der Ordnerstruktur?
Diese hier, ist uralt und passt nicht mehr, weil man keine ZIP mehr runter laden kann.
https://www.camp-firefox.de/forum/viewtopic.php?f=16&t=122538
-
Ergänzung: die userChromeJS.js brauchts meiner Meinung gar nicht mehr.
So ist es. -
Diese hier, ist uralt und passt nicht mehr, weil man keine ZIP mehr runter laden kann.https://www.camp-firefox.de/forum/viewtopic.php?f=16&t=122538
[/quote]
Diese ist aktuell! Das, was du verwenden wolltest, ist uralt. Das habe ich auch erst gemerkt, als Zitronella darauf hinwies, dass es die Datei userChromJs.js nicht mehr gibt.Edit: Siehe Beitrag #76.
-
Ich hab mal hier was hochgeladen, wo man sieht was wohin gehört
https://workupload.com/file/gths2tny -
Da gibt es aber nirgendwo mehr die datein für den Download!
-
Diese hier, ist uralt und passt nicht mehr, weil man keine ZIP mehr runter laden kann.https://www.camp-firefox.de/forum/viewtopic.php?f=16&t=122538
Die Beschreibung dort ist aktuell. Das, was du verwenden wolltest, ist uralt. Dass du die angegeben hast, habe ich auch erst gemerkt, als Zitronella darauf hinwies, dass es die Datei userChromeJS.js nicht mehr gibt.Aber ich habe ja schon geschrieben, dass der Download-Lin im Forumsbeitrag veraltet sein kann. Lade dir also die Dateien hinter dem Link aus Beitrag #62 herunter. Das habe ich jetzt zum dritten Mal geschrieben.
-
Ich hab mal hier was hochgeladen, wo man sieht was wohin gehört
https://workupload.com/file/gths2tny1.000 Dank! :klasse:
Hat auf Anhieb, astrein geklappt.
Noch eine Frage zum Script mit dem Restart-Button: Wo/wie ändere ich da die Farbe des Eintrags?
-
Da gibt es aber nirgendwo mehr die datein für den Download!
Ah, das habe ich noch nicht gewusst:Zitat[Die Dateierweiterung zip wurde deaktiviert und kann nicht länger angezeigt werden.]
Gut. Also noch einmal Beitrag #62.
-
Noch eine Frage zum Script mit dem Restart-Button: Wo/wie ändere ich da die Farbe des Eintrags?
Du redest jetzt von welchem Skript? Das Skript, was du ursprünglich angeführt hast, ist das, was einen Menü-Eintrag im Hamburger-Menü einrichtet. Das hat aber keinen Button. Das, was ich dir zum Testen angegeben habe, hat nur einen Button und keinen Eintrag. -
Ja, dieses Script:
Code
Alles anzeigen(function() { var menuitem = document.createElement('toolbarbutton'); menuitem.id = 'uc_menu_Restart_H'; menuitem.classList.add('subviewbutton', 'subviewbutton-iconic'); menuitem.setAttribute('label' , 'Neustart'); menuitem.setAttribute('tooltiptext' , 'Neustart'); menuitem.style.listStyleImage= 'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="context-fill" fill-opacity="context-fill-opacity" d="M15,1a1,1,0,0,0-1,1V4.418A6.995,6.995,0,1,0,8,15a6.954,6.954,0,0,0,4.95-2.05,1,1,0,0,0-1.414-1.414A5.019,5.019,0,1,1,12.549,6H10a1,1,0,0,0,0,2h5a1,1,0,0,0,1-1V2A1,1,0,0,0,15,1Z"/></svg>\')'; menuitem.setAttribute('oncommand' , "Services.appinfo.invalidateCachesOnRestart() || BrowserUtils.restartApplication();"); var refItem = document.getElementById('appMenu-quit-button'); refItem.parentNode.insertBefore(menuitem, refItem); })();
Es hat vorne ein Symbol, gefolgt vom Text "Neustart"...das Ganze soll in Farbe #00437A sein.
-