Ich nutze dieses Skript:
Auch ein Skript.
Ich nutze dieses Skript:
Auch ein Skript.
Auch ein Skript.
Du meinst, ich hätte dann schreiben können zu deinem Beitrag Nr: 6.
Ich klicke einfach das V an...ok
Ich klicke einfach das V an...ok
Ich weiß jetzt nicht, welches V du meinst (noch ein Skript? ), ich habe das nicht in deinem Skript gefunden, aber ja.
welches V du meinst
Rechts das rote Icon in dem Screenshot. Klick drauf, und der Code ist aktiv.
Rechts das rote Icon in dem Screenshot. Klick drauf, und der Code ist aktiv.
Ach da ganz unten steht das. Ich habe mehrmals vergeblich den Code durchgesehen. Ich bin offenbar auf Code-Kästen geeicht.
Ach da ganz unten steht das.
Das Skript etwas verändert habe ich dann auch für die userContent.css.
Ja, in der Tat, ich hätte drauf hinweisen müssen und habe dies noch oben eingefügt.
werde dies noch oben einfügen.
Ich nutze dieses Skript:
Der zweite Teil des Skripts (V-Button) funktioniert nicht, es startet userChrome nicht neu. Überprüft in v138, v137.
es startet userChrome nicht neu.
Hallo lenny2 ..
du brauchst dafür eine extra Datei, und nicht die userChrome.css.
Oder du musst das Skript anpassen.
Hier ist das im Skript eingetragen:
Die Datei Test.css befindet sich hier im Unterordner CSS im Ordner chrome.
So müsste das dann für die userChrome.css aussehen:
// cssLive.uc.js
(function() {
if (location != 'chrome://browser/content/browser.xhtml') {
return;
}
/*** OPTIONEN START *******************************************************/
var cssLiveOptions = {
/* Falls sich die Testdatei in einem Unterverzeichnis von "chrome"
befindet, bitte hier zwischen Anführungszeichen eintragen, ansonsten
nur die Anführungszeichen */
subdir: '',
/* Name der Testdatei */
file: 'userChrome.css'
};
/*** OPTIONEN ENDE ********************************************************/
var buttonPath = '';
var testFile = Services.dirsvc.get('UChrm', Ci.nsIFile);
if( cssLiveOptions.subdir != '' ) {
testFile.append( cssLiveOptions.subdir );
buttonPath += cssLiveOptions.subdir + "/";
}
testFile.append( cssLiveOptions.file );
buttonPath += cssLiveOptions.file;
var buttonTxt_1 = buttonPath + " aufrufen";
var buttonTxt_2 = buttonPath + " Code ausführen";
var errorTxt = "Die Datei \n" + testFile.path + "\n existiert nicht.";
ChromeUtils.importESModule("resource:///modules/CustomizableUI.sys.mjs");
try {
CustomizableUI.createWidget({
id: "fp-get-css-file",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: buttonTxt_1,
tooltiptext: buttonTxt_1,
onClick: function(event) {
if (event.button != 0){
return;
}
if( testFile.exists() ) {
testFile.launch();
} else {
alert( errorTxt );
}
},
onCreated: function(aNode) {
aNode.style.listStyleImage = 'url("file:///C:/Users/weiss/AppData/Roaming/Mozilla/Firefox/Profiles/7hfpu74u.Test Fx/chrome/Icons/css1.png")';
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
};
try {
CustomizableUI.createWidget({
id: "fp-register-css-file",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: buttonTxt_2,
tooltiptext: buttonTxt_2,
onClick: function() {
if( testFile.exists() ) {
var CI = Components.interfaces;
var CC = Components.classes;
let sss = CC["@mozilla.org/content/style-sheet-service;1"].getService( CI.nsIStyleSheetService );
let ios = CC["@mozilla.org/network/io-service;1"].getService( CI.nsIIOService );
let fileURL = Services.io.getProtocolHandler( 'file' ).QueryInterface( Ci.nsIFileProtocolHandler ).getURLSpecFromActualFile( testFile );
let uri = ios.newURI( fileURL , null , null );
sss.loadAndRegisterSheet( uri , sss.AGENT_SHEET );
} else {
alert( errorTxt );
}
},
onCreated: function(aNode) {
aNode.style.listStyleImage = 'url("file:///C:/Users/weiss/AppData/Roaming/Mozilla/Firefox/Profiles/7hfpu74u.Test Fx/chrome/Icons/v1.png")';
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
}
})();
Alles anzeigen
Und so, wenn du es für die userContent.css nutzen möchtest:
// cssLive.uc.js
(function() {
if (location != 'chrome://browser/content/browser.xhtml') {
return;
}
/*** OPTIONEN START *******************************************************/
var cssLiveOptions = {
/* Falls sich die Testdatei in einem Unterverzeichnis von "chrome"
befindet, bitte hier zwischen Anführungszeichen eintragen, ansonsten
nur die Anführungszeichen */
subdir: '',
/* Name der Testdatei */
file: 'userContent.css'
};
/*** OPTIONEN ENDE ********************************************************/
var buttonPath = '';
var testFile = Services.dirsvc.get('UChrm', Ci.nsIFile);
if( cssLiveOptions.subdir != '' ) {
testFile.append( cssLiveOptions.subdir );
buttonPath += cssLiveOptions.subdir + "/";
}
testFile.append( cssLiveOptions.file );
buttonPath += cssLiveOptions.file;
var buttonTxt_1 = buttonPath + " aufrufen";
var buttonTxt_2 = buttonPath + " Vorschau Webseite";
var errorTxt = "Die Datei \n" + testFile.path + "\n existiert nicht.";
ChromeUtils.importESModule("resource:///modules/CustomizableUI.sys.mjs");
try {
CustomizableUI.createWidget({
id: "aw-get-css-file",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: buttonTxt_1,
tooltiptext: buttonTxt_1,
onClick: function(event) {
if (event.button != 0){
return;
}
if( testFile.exists() ) {
testFile.launch();
} else {
alert( errorTxt );
}
},
onCreated: function(aNode) {
aNode.style.listStyleImage = 'url("file:///C:/Users/weiss/AppData/Roaming/Mozilla/Firefox/Profiles/7hfpu74u.Test Fx/chrome/Icons/web.png")';
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
};
try {
CustomizableUI.createWidget({
id: "aw-register-css-file",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: buttonTxt_2,
tooltiptext: buttonTxt_2,
onClick: function() {
if( testFile.exists() ) {
var CI = Components.interfaces;
var CC = Components.classes;
let sss = CC["@mozilla.org/content/style-sheet-service;1"].getService( CI.nsIStyleSheetService );
let ios = CC["@mozilla.org/network/io-service;1"].getService( CI.nsIIOService );
let fileURL = Services.io.getProtocolHandler( 'file' ).QueryInterface( Ci.nsIFileProtocolHandler ).getURLSpecFromActualFile( testFile );
let uri = ios.newURI( fileURL , null , null );
sss.loadAndRegisterSheet( uri , sss.AGENT_SHEET );
} else {
alert( errorTxt );
}
},
onCreated: function(aNode) {
aNode.style.listStyleImage = 'url("file:///C:/Users/weiss/AppData/Roaming/Mozilla/Firefox/Profiles/7hfpu74u.Test Fx/chrome/Icons/V-icon.png")';
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
}
})();
Alles anzeigen
Und hier die Icons wer möchte:
du brauchst dafür eine extra Datei, und nicht die userChrome.css.
Die Datei Test.css befindet sich hier im Unterordner CSS im Ordner chrome.
Ich verstehe das. Ich mache alles richtig, aber die V-Schaltfläche wendet den neuen Code, der zu Test.css hinzugefügt wurde, nicht an. Ebenso wendet das Skript im letzten Beitrag nicht den Code an, der in userContent.css hinzugefügt wurde.
Es bleibt zu prüfen, ob ein Skriptkonflikt vorliegt.
Vielen Dank für Ihre Hilfe!
aber die V-Schaltfläche wendet den neuen Code, der zu Test.css hinzugefügt wurde, nicht an.
der in userContent.css hinzugefügt wurde.