wie kann ich Font Farbe zu rot ändern
userChrome.css
Moin lenny2,
danke aber deone Code ist für Tab Font Farbe und nicht für Titlebar Font FFarbe.
Mfg
wie kann ich Font Farbe zu rot ändern
userChrome.css
Moin lenny2,
danke aber deone Code ist für Tab Font Farbe und nicht für Titlebar Font FFarbe.
Mfg
Moin Zusammen,
wie kann ich Font Farbe zu rot ändern und Mozilla Icon (neben Beschreibung) mit meine Icon ändern?
Mfg
Hallo Sören,
vielen Dank für Erklärung.
Mfg
Hallo Andreas,
wie soll ich Titelleiste aktivieren?
Mfg
nein, habe nicht gemacht.
Bei mir ist so:
Z.b. Wenn ich diese Skript benutze, sieht so aus:
(function() {
var cssFontFamily = 'Arial'; // Font Name
var cssColor = '#EE0000'; // Font Farbe
var css = 'font-family: ' + cssFontFamily + '; text-align: center; min-height: 20px; max-height: 20px; border-left: 1px solid #B2B2B2; padding-top: 3px; padding-right: 3px; padding-bottom: 0px; padding-left: 3px; color: ' + cssColor + '; font-weight: 500; text-shadow: none; width: 220px; margin-right: 1px; margin-bottom: 0px; margin-left: 0px;';
var cssA = 'font-family: ' + cssFontFamily + '; text-align: right; background-position: 5px 2px !important; min-height: 20px; max-height: 20px; padding-right: 3px; padding-bottom: 0px; padding-left: 24px !important; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; width: 148px;';
var position = document.getElementsByClassName('titlebar-close')[0];
var FILabel = document.createXULElement('label');
FILabel.setAttribute('id', 'statusbar-FI-display');
FILabel.setAttribute('class', 'statusbarpanel-text');
FILabel.setAttribute('style', css + cssA);
var text = "Firefox " + AppConstants.MOZ_APP_VERSION_DISPLAY;
FILabel.setAttribute('value', text);
position.parentNode.insertBefore(FILabel, position.nextSibling);
})();
Alles anzeigen
Mfg
ich habe von 1000 bis 15000 geprüft, funktioniert nicht.
Alle meine UserScripte funktionieren aber!!
Kannst du bitte eine Screenshot anhängen dass ich sehen kann, wo muss angezeigt werden?
Danke
ja, auch nicht Funktioniert.
Hallo Zusammen,
diese UserScript funktioniert nicht mit Firefox 115.3.1 ESR.
Kann jemand sagen, wieso oder wo das Fehler ist:
setCurrentProfileNameToTitlebar.uc.js
// ==UserScript==
// @name setCurrentProfileNameToTitlebar
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description Aktuellen Profilnamen in der Titelleiste anzeigen
// @include main
// @compatibility Firefox 117
// @author Alice0775
// @version 2022/06/03 00:00
// @version 2012/12/31 00:00 Bug 818800 Remove the global private browsing service
// ==/UserScript==
// @version 2023/07/17 00:00 use ES module imports
// @version 2015/06/06 fix
// @version 2012/08/06 08:00 remove hack privatebrowsingUI
// @version 2010/09/25 23:00 Bug 598221 - Page Title not shown in Title Bar on Session Restore
// @version 2009/07/25 18:00 Bug 506437 - The titlebar of a tear off window is not updated correctly after having detached a tab
// @version 2008/03/06 15:00
// @Note Ich kenne nichts anderes als die offizielle Win32-Version und die, die den Pfad mit der Startoption -profile ändert
(function(){
// Aktuellen Profilnamen abrufen
// Unterstützung auch bei Namensänderung
// Ich wünschte, ich könnte einen intelligenteren Weg verwenden (nsIToolkitProfileService)...orz, aber das funktioniert
// Ich kenne nichts anderes als die offizielle Win32-Version und der Pfad wird durch die Startoption -profile geändert
function getCurrentProfileName(){
function readFile(aFile){
let stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream); stream.init(aFile, 0x01, 0, 0);
let cvstream = Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(Ci.nsIConverterInputStream);
cvstream.init(stream, "UTF-8", 1024, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
let content = "", data = {};
while (cvstream.readString(4096, data)) {
content += data.value;
}
cvstream.close();
return content.replace(/\r\n?/g, "\n");
}
let PrefD = Services.dirsvc.get("PrefD", Ci.nsIFile);
let ini = Services.dirsvc.get("AppRegD", Ci.nsIFile);
ini.append("profiles.ini");
ini = readFile(ini);
let profiles = ini.match(/Name=.+/g);
let profilesD = ini.match(/Path=.+/g);
for ( let i = 0; i < profiles.length;i++) {
if ((profilesD[i]+"$").indexOf(PrefD.leafName+"$") >= 0) {
profiles[i].match(/Name=(.+)$/);
return RegExp.$1;
}
}
return null;
}
window.setCurrentProfileNameToTitlebar = function(){
let profile = getCurrentProfileName();
if (!profile) return;
// Set the title modifer to include the build ID.
let appBuildID = Services.appinfo.appBuildID;
let version = Services.appinfo.version;
let mainWindow = document.getElementById("main-window");
let { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
let versionAttributes = {
version: AppConstants.MOZ_APP_VERSION_DISPLAY,
bits: Services.appinfo.is64Bit ? 64 : 32,
};
["data-title-default", "data-title-private", "data-content-title-default", "data-content-title-private"].forEach(callback);
function callback(attrname){
let originalName = mainWindow.getAttribute(attrname);
let titlemodifier = originalName + " " + versionAttributes.version + "-[" + profile+ "] ";// + " - " + appBuildID;
// Set the new title modifier
mainWindow.setAttribute(attrname, titlemodifier);
}
}
setTimeout(function(){
setCurrentProfileNameToTitlebar();
//xxx Bug 598221
gBrowser.updateTitlebar()
}, 500);
})();
Alles anzeigen
Vielen Dank
Mfg
Hallo,
vielen Dank. Jetzt funktioniert wieder.
Herzlichen Dank
Hallo zusammen,
diese Skript funktioniert mit Firefox 115.1.0 ESR aber nicht mit Firefox Nightly 118.0a1, kann jemand bitte mir sagen warum?
bookmarks_backup_restore_buttons.uc.js
// Bookmarks Backup/Restore button script for Firefox 60+ by Aris
(function() {
try {
Components.utils.import("resource:///modules/CustomizableUI.jsm");
ChromeUtils.importESModule("resource:///modules/CustomizableUI.sys.mjs");
var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
var RESTORE_FILEPICKER_FILTER_EXT = "*.json;*.jsonlz4";
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "MigrationUtils", "resource:///modules/MigrationUtils.jsm");
ChromeUtils.defineModuleGetter(this, "BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PlacesBackups", "resource://gre/modules/PlacesBackups.jsm");
CustomizableUI.createWidget({
id: "uc-bookmarks_backup", // button id
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Bookmarks Backup", // button title
tooltiptext: "Bookmarks Backup", // tooltip title
onClick: function(event) {
if(event.button=='0') {
let backupsDir = Services.dirsvc.get("Desk", Ci.nsIFile);
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
let fpCallback = function fpCallback_done(aResult) {
if (aResult != Ci.nsIFilePicker.returnCancel) {
// There is no OS.File version of the filepicker yet (Bug 937812).
PlacesBackups.saveBookmarksToJSONFile(fp.file.path)
.catch(Cu.reportError);
}
};
fp.init(window, "json",
Ci.nsIFilePicker.modeSave);
fp.appendFilter("json",
RESTORE_FILEPICKER_FILTER_EXT);
fp.defaultString = PlacesBackups.getFilenameForDate();
fp.defaultExtension = "json";
fp.displayDirectory = backupsDir;
fp.open(fpCallback);
}
},
onCreated: function(button) {
return button;
}
});
CustomizableUI.createWidget({
id: "uc-bookmarks_restore", // button id
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Bookmarks Restore", // button title
tooltiptext: "Bookmarks Restore", // tooltip title
onClick: function(event) {
if(event.button=='0') {
let backupsDir = Services.dirsvc.get("Desk", Ci.nsIFile);
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
let fpCallback = aResult => {
if (aResult != Ci.nsIFilePicker.returnCancel) {
// check file extension
if (!fp.file.path.toLowerCase().endsWith("json") &&
!fp.file.path.toLowerCase().endsWith("jsonlz4")) {
this._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreFormatError"));
return;
}
// confirm ok to delete existing bookmarks
if (!Services.prompt.confirm(null,
PlacesUIUtils.getString("bookmarksRestoreAlertTitle"),
PlacesUIUtils.getString("bookmarksRestoreAlert")))
return;
(async function() {
try {
await BookmarkJSONUtils.importFromFile(fp.file.path, {
replace: true,
});
} catch (ex) {
PlacesOrganizer._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreParseError"));
}
})();
}
};
fp.init(window, "json",
Ci.nsIFilePicker.modeOpen);
fp.appendFilter("json",
RESTORE_FILEPICKER_FILTER_EXT);
fp.appendFilters(Ci.nsIFilePicker.filterAll);
fp.displayDirectory = backupsDir;
fp.open(fpCallback);
}
},
onCreated: function(button) {
return button;
}
});
// style button icon
var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent('\
\
#uc-bookmarks_backup .toolbarbutton-icon {\
list-style-image: url("chrome://browser/skin/bookmark.svg"); /* icon / path to icon */ \
fill: red; /* icon color name/code */\
}\
#uc-bookmarks_restore .toolbarbutton-icon {\
list-style-image: url("chrome://browser/skin/bookmark.svg"); /* icon / path to icon */ \
fill: green; /* icon color name/code */\
}\
\
'), null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch (e) {
Components.utils.reportError(e);
};
})();
Alles anzeigen
Herzlichen Dank
Moin 2002Andreas,
teste bitte mit diese Parameter:
Textbox caret stops blinking after a few seconds
Mfg
Moin milupo,
mit diese Code funktioniert nicht:
ChromeUtils.defineESModuleGetters(this, "PlacesBackups", "resource://gre/modules/PlacesBackups.sys.mjs");
ChromeUtils.defineESModuleGetters(this, "MigrationUtils", "resource:///modules/MigrationUtils.sys.mjs");ChromeUtils.defineESModuleGetters(this, "BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.sys.mjs");
Hier ist mein Code:
const Cu = Components.utils;
Cu.importGlobalProperties(['PathUtils']);
Cu.importGlobalProperties(['IOUtils']);
//**** Config.js für User Skripts ****
try {
if (!Services.appinfo.inSafeMode) {
let path = PathUtils.parent(PathUtils.xulLibraryPath);
if (Services.appinfo.OS == 'Darwin') { // macOS
path = PathUtils.join(PathUtils.parent(path), 'Resources');
}
var ucjsDirPath = PathUtils.join(path, 'userChromeJS');
path = PathUtils.join(ucjsDirPath, 'main.js');
const mainFileURI = PathUtils.toFileURI(path);
Services.scriptloader.loadSubScript(mainFileURI, this, 'UTF-8');
}
}
catch(e) {
Cu.reportError(e);
}
//**** Diesen Teil erstellt chrome Ordner in Benutzer Firefox Profile und kopiert alle Dateien ****
try {
Services.obs.addObserver(
{ observe: () =>
IOUtils.makeDirectory(PathUtils.join(PathUtils.profileDir + "\\chrome\\"))
},
"profile-do-change",
false
);
Services.obs.addObserver(
{ observe: () =>
IOUtils.copy("C:\\Program Files (x86)\\Mozilla Firefox\\UserChromeDIR\\userChrome.css", PathUtils.join(PathUtils.profileDir + "\\chrome\\userChrome.css"))
},
"profile-do-change",
false
);
Services.obs.addObserver(
{ observe: () =>
IOUtils.copy("C:\\Program Files (x86)\\Mozilla Firefox\\UserChromeDIR\\userContent.css", PathUtils.join(PathUtils.profileDir + "\\chrome\\userContent.css"))
},
"profile-do-change",
false
);
Services.obs.addObserver(
{ observe: () =>
IOUtils.copy("C:\\Program Files (x86)\\Mozilla Firefox\\UserChromeDIR\\userChrome.js", PathUtils.join(PathUtils.profileDir + "\\chrome\\userChrome.js"))
},
"profile-do-change",
false
);
Services.obs.addObserver(
{ observe: () =>
IOUtils.copy("C:\\Program Files (x86)\\Mozilla Firefox\\UserChromeDIR\\printpreview.uc.js", PathUtils.join(PathUtils.profileDir + "\\chrome\\printpreview.uc.js"))
},
"profile-do-change",
false
);
} catch(e) {
Cu.reportError(e);
};
//**** Diesen Teil löscht in Benutzer Firefox Profile, Ordner storage\default ****
try {
Services.obs.addObserver(
{ observe: () =>
IOUtils.remove(PathUtils.join(PathUtils.profileDir + "\\storage\\default"), { recursive: true }) },
"quit-application",
false
);
} catch(e) {
Cu.reportError(e);
};
//**** Automatik Benutzer Favoriten Sicherung (als .json format) in User Home==>Firefox_Favoriten_BAK Ordner und Datei Name ist bookmarks.json ****
//**** Wenn Firefox beendet, wird Benutzer bookmarks.json automatisch in Pfad U:\Firefox_Favoriten_BAK\ gespeichert ****
try {
ChromeUtils.defineModuleGetter(this, "MigrationUtils", "resource:///modules/MigrationUtils.jsm");
ChromeUtils.defineModuleGetter(this, "BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PlacesBackups", "resource://gre/modules/PlacesBackups.jsm");
ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
ChromeUtils.importESModule("resource://gre/modules/PlacesUtils.sys.mjs");
Services.obs.addObserver(
{ observe: () =>
IOUtils.makeDirectory("U:\\Firefox_Favoriten_BAK")
},
"quit-application-requested",
false
);
const path = PathUtils.join("U:\\Firefox_Favoriten_BAK\\bookmarks.json");
let importExportBookmarks = {
modalWindow: null,
init: async function() {
Services.obs.addObserver(this, "final-ui-startup", false);
},
observe: function(aSubject, aTopic, aData) {
switch (aTopic) {
case "final-ui-startup":
BookmarkJSONUtils.importFromFile(path, {replace: false})
.then(
() => this.modalWindow.open(),
(e) =>
{
IOUtils.remove(path),
this.modalWindow.open();
let window = Services.wm.getMostRecentWindow('navigator:browser');
}
);
Services.obs.removeObserver(this, "final-ui-startup");
Services.obs.addObserver(this, "quit-application-requested", false);
break;
case "quit-application-requested":
let window = Services.wm.getMostRecentWindow('navigator:browser');
BookmarkJSONUtils.exportToFile(path, {replace: false})
.then(
() => this.modalWindow.close(),
(e) => {
this.modalWindow.close();
}
);
Services.obs.addObserver(this, "domwindowopened", false);
window.open('', 'modalWindow', 'chrome,modal');
break;
case "domwindowopened":
Services.obs.removeObserver(this, "domwindowopened");
this.modalWindow = aSubject;
};
}
};
importExportBookmarks.init();
} catch(e) {
Cu.reportError(e);
};
// Java JNLP Start in MIME-Type
Services.obs.addObserver(function observer(subject, topic, data) {
var handlerSvc = Components.classes["@mozilla.org/uriloader/handler-service;1"]
.getService(Components.interfaces.nsIHandlerService);
var mimeService = Components.classes["@mozilla.org/mime;1"]
.getService(Components.interfaces.nsIMIMEService);
var realMIMEInfo = mimeService.getFromTypeAndExtension("application/x-java-jnlp-file", "");
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);
file.initWithPath(getenv('itw_home')+"\\bin\\javaws.exe");
var localHandlerApp = Components.classes["@mozilla.org/uriloader/local-handler-app;1"].createInstance(Components.interfaces.nsILocalHandlerApp);
localHandlerApp.executable = file;
localHandlerApp.name = "javaws.exe";
realMIMEInfo.preferredApplicationHandler = localHandlerApp;
realMIMEInfo.preferredAction = 2;
realMIMEInfo.alwaysAskBeforeHandling = false;
handlerSvc.store(realMIMEInfo);
Services.obs.removeObserver(observer, topic);
}, "final-ui-startup");
Alles anzeigen
Mfg
Hallo Zusammen,
ich habe geschafft, mit diese Code funktioniert:
ChromeUtils.defineModuleGetter(this, "MigrationUtils", "resource:///modules/MigrationUtils.jsm");
ChromeUtils.defineModuleGetter(this, "BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PlacesBackups", "resource://gre/modules/PlacesBackups.jsm");
ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
ChromeUtils.importESModule("resource://gre/modules/PlacesUtils.sys.mjs");
Vielen Dank für Hilfe
Mfg
ich habe mit diese auch geprüft, leider funktioniert nicht:
Chrome.importESModule("resource://gre/modules/BookmarkJSONUtils.sys.mjs");
Chrome.importESModule("resource://gre/modules/Timer.sys.mjs");
Chrome.importESModule("resource://gre/modules/PlacesBackups.sys.mjs");
Chrome.importESModule("resource://modules/MigrationUtils.sys.mjs");
Mfg
wenn ich diese Teil lösche und Firefox starte und beende, wird Favoriten-Ordner angelegt:
Chrome.importESModule("resource://gre/modules/BookmarkJSONUtils.sys.mjs");
Chrome.importESModule("resource://gre/modules/Timer.sys.mjs");
Chrome.importESModule("resource://gre/modules/PlacesBackups.sys.mjs");
Chrome.importESModule("resource:///modules/MigrationUtils.sys.mjs");
Aber wenn diese teil da ist, passiert gar nicht.
Moin milupo,
herzlichen Dank. Deine Code Teilweise funktioniert.
Das Teil für Favoriten funktioniert leider nicht (diese Teil):
try {
//Cu.import("resource://gre/modules/Services.jsm");
//Cu.import("resource://gre/modules/osfile.jsm");
Chrome.importESModule("resource://gre/modules/BookmarkJSONUtils.sys.mjs");
Chrome.importESModule("resource://gre/modules/Timer.sys.mjs");
Chrome.importESModule("resource://gre/modules/PlacesBackups.sys.mjs");
Chrome.importESModule("resource:///modules/MigrationUtils.sys.mjs");
//**** Diesen Teil erstellt in Benutzer U:\ Laufwerk, Firefox_Favoriten_BAK Ordner ****
Services.obs.addObserver(
{ observe: () =>
IOUtils.makeDirectory("U:\\Firefox_Favoriten_BAK")
}, "quit-application-requested",
false
);
const path = PathUtils.join("U:\\Firefox_Favoriten_BAK\\bookmarks.json");
let importExportBookmarks = {
modalWindow: null,
init: async function() {
Services.obs.addObserver(this, "final-ui-startup", false);
},
observe: function(aSubject, aTopic, aData) {
switch (aTopic) {
case "final-ui-startup":
BookmarkJSONUtils.importFromFile(path, {replace: false})
.then(
() => this.modalWindow.open(),
(e) =>
{
IOUtils.remove(path),
this.modalWindow.open();
let window = Services.wm.getMostRecentWindow('navigator:browser');
}
);
Services.obs.removeObserver(this, "final-ui-startup");
Services.obs.addObserver(this, "quit-application-requested", false);
break;
case "quit-application-requested":
let window = Services.wm.getMostRecentWindow('navigator:browser');
BookmarkJSONUtils.exportToFile(path, {replace: false})
.then(
() => this.modalWindow.close(),
(e) => {
this.modalWindow.close();
}
);
Services.obs.addObserver(this, "domwindowopened", false);
window.open('', 'modalWindow', 'chrome,modal');
break;
case "domwindowopened":
Services.obs.removeObserver(this, "domwindowopened");
this.modalWindow = aSubject;
};
}
};
importExportBookmarks.init();
} catch(e) {
Cu.reportError(e);
};
Alles anzeigen
Mfg
Hallo Andreas,
vielen Dank, leider hat nicht funktioniert
Ich glaube osfile.jsm ist nicht mehr da und muss man ioutil.jsm benutzen, weil hier steht, dass osfile.jsm von services entfernt wurde.
Remove osfile.jsm from services
Mfg