Habe mich mal schamlos bedient.
Auch ich bedanke mich sehr dafür.
Mfg.
Endor
Habe mich mal schamlos bedient.
Auch ich bedanke mich sehr dafür.
Mfg.
Endor
Hallo Mira_Belle
Das Script heißt: expandsidebar.uc.js
// ==UserScript==
// @name expandsidebar_fx58.uc.js
// @description Automatisches Öffnen und Schließen der Seitenleiste
// @namespace http://forums.mozillazine.org/viewtopic.php?p=2592073#2592073
// @include main
// @compatibility Firefox 91
// @author Alice0775
// @Note Seitenleistenposition bei _SIDEBARPOSITION wählbar (links oder rechts)
// @Note Keyconfig und Mousegesten usw. SidebarUI.toggle (entsprechender Code);
// @Note
// @version 2021/11/14 13:00 no longer close when print preview
// @version 2021/09/30 22:00 change splitter color
// @version 2020/12/14 00:00 vtb
// @version 2020/07/14 00:00 style
// @version 2019/12/09 18:00 fix 72 Bug 1582530
// @version 2019/12/05 18:00 fix 72 Bug 1492582 - browser.xhtml: Migrate root xul:window element to an html:html element
// @version 2019/12/05 17:00 fix 71 Bug 1582530 - Turn on `layout.css.xul-box-display-values.survive-blockification.enabled` by default
// @version 2019/12/05 10:00 fix 70 Bug 1558914 - Disable Array generics in Nightly
// @version 2019/09/04 Fx69
// @version 2018/07/03 Fx61 fix regression from remove loadoverlay
// @version 2018/07/03 Fx61 remove loadoverlay
// @version 2018/06/25 Fx61 wip
// @version 2018/01/25 Fx58 wip
// @version 2017/11/18 Fx57
// @version 2017/11/18 nsIPrefBranch2 to nsIPrefBranch
// @version 2017/02/01 00:00 enable floating(overlay) sidebar
// @version 2017/01/19 00:00 change event phase,target
// @version 2015/08/29 00:00 fix lastused command
// @version 2015/05/13 19:00 fix lastused command
// @version 2015/02/20 22:00 fix due to Bug 1123517
// @version 2014/10/31 22:00 fix due to Bug 714675
// @version 2014/05/22 12:00 fix var
// @version 2013/03/03 00:00 fix It close too soon when it opened from a button or menu
// @version 2013/02/26 00:00 fix close delay
// @version 2012/12/08 22:30 Bug 788290 Bug 788293 Remove E4X
// ==/UserScript==
// @version 2012/08/04 09:00 private browsingを考慮
// @version 2012/08/04 09:00 hiddenではなくcollapsedを使うように
// @version 2012/02/08 14:00 splitter width in full screen
// @version 2011/05/26 12:00 5.0a2でマウスが要素上通過する時, 移動速度が速すぎるとmouseoverイベントが発火しない? 感度が落ちた?
// @version 2011/03/24 12:00 ドラッグオーバー遅延を別設定とした
// @version 2010/10/30 18:00 http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=84baf90b040c&tochange=16eac4b8b8e0
// @version 2010/10/09 18:00 Windows7 Aero
// @version 2009/06/06 20:00 ドラッグオーバーで閉じてしまうので
// @version 2009/05/24 18:00 chromeのチェック変更
// @version 2009/04/30 18:00 サイドバーを開閉したときは必ずタイマーをクリアするようにした。
// @version 2009/04/28 00:00 負荷軽減
// @version 2009/04/23 00:00 _KEEP_SIZESが動かなくなっていたので
// @version 2009/04/22 12:00 ドラッグオーバーで開かなくなっていたので
// @version 2009/04/15 21:00 マウスが通過したときは開かないが動かなくなっていたので
// @version 2009/04/15 19:00 細々bug修正
// @version 2009/04/15 02:00 _CLOSEWHENGOOUTが動かなくなっていたので
// @version 2009/04/14 22:00 fx2削除
var ucjs_expand_sidebar = {
// --- config ---
//Anfang Konfiguration
_OPEN_DELAY: 300, //Zeitverzögerung zum Öffnen bei Mouseover
_OPEN_DELAY_DRAGOVER: 400, //Zeitverzögerung zum Öffnen per Dragover
_CLOSE_DELAY: 800, //Zeitverzögerung beim Schließen
_SCROLLBAR_DELAY: 1000, //Zeitverzögerung der Bildlaufleiste beim Öffnen / Schließen
_DEFAULTCOMMAND: "viewBookmarksSidebar", // Standardseitenleiste
_TOLERANCE: 0, //Bereich, der als linke Kante des Fensters erkannt wird (0 kann bei Verwendung von TreeStyleTab usw. verwendet werden)
_DONOTCLOSE_XULELEMENT: true, //Wenn sich die Maus auf einem XUL-Element befindet, nicht schließen
//(Wird nicht geschlossen, selbst wenn XUL im Inhalt angezeigt wird)
_CLOSEWHENGOOUT: false, //Wenn sich die Maus aus dem Fenster bewegt: true: schließen, [false]: nicht schließen
_FLOATING_SIDEBAR: true, //Schwebende Seitenleiste (Überlagerung des Seiteninhalts) aktivieren,
//(bekanntes Problem: Seitenleiste kann nicht skaliert werden = mit Maus breiter oder schmaler ziehen)
_SIDEBARPOSITION: "L", //Seitenleistenposition Linke Seite: L Rechte Seite: R
//VerticalToolbar.uc.js von Gomita - vertikale Symbolleiste 0.1
//(http://www.xuldev.org /blog/?p=113) muss zuerst ausgeführt werden!
_KEEP_SIZES:true, //Breite für jeden Seitenleisten-Typ speichern
_defaultWidth: 234, //Standardbreite der Seitenleiste
_inFullscreen: true, //Bei Vollbild, Verhalten von Firefox 31 verwenden
//Ende Konfiguration
// --- config ---
_MOUSEMOVEINTERVAL: 10, //Intervall zum Überprüfen der Mausposition
_CHECKBOX_AT_STARUP:false, //Kontrollkästchen beim Start anzeigen
_CLOSE_AT_STARTUP:true, //Seitenleiste beim Start geschlossen
_lastcommand: null,
_backup_lastcommand:null,
_open_Timeout: null,
_close_Timeout: null,
_sidebar_box:null,
_sidebar:null,
_sidebar_splitter:null,
_checkbox:null,
_content:null,
_opend:false,
_mousedown:false,
_mouse_Timeout: null,
_resizeTimer: null,
_mtimer: false,
_startup:true,
sizes:[],
prefKeepItSizes: "userChrome.expandSidebar.keepItSizes",
jsonToDOM: function(jsonTemplate, doc, nodes) {
jsonToDOM.namespaces = {
html: "http://www.w3.org/1999/xhtml",
xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
};
jsonToDOM.defaultNamespace = jsonToDOM.namespaces.xul;
function jsonToDOM(jsonTemplate, doc, nodes) {
function namespace(name) {
var reElemNameParts = /^(?:(.*):)?(.*)$/.exec(name);
return { namespace: jsonToDOM.namespaces[reElemNameParts[1]], shortName: reElemNameParts[2] };
}
// Note that 'elemNameOrArray' is: either the full element name (eg. [html:]div) or an array of elements in JSON notation
function tag(elemNameOrArray, elemAttr) {
// Array of elements? Parse each one...
if (Array.isArray(elemNameOrArray)) {
var frag = doc.createDocumentFragment();
Array.prototype.forEach.call(arguments, function(thisElem) {
frag.appendChild(tag.apply(null, thisElem));
});
return frag;
}
// Single element? Parse element namespace prefix (if none exists, default to defaultNamespace), and create element
var elemNs = namespace(elemNameOrArray);
var elem = doc.createElementNS(elemNs.namespace || jsonToDOM.defaultNamespace, elemNs.shortName);
// Set element's attributes and/or callback functions (eg. onclick)
for (var key in elemAttr) {
var val = elemAttr[key];
if (nodes && key == "keyvalue") {
nodes[val] = elem;
continue;
}
var attrNs = namespace(key);
if (typeof val == "function") {
// Special case for function attributes; don't just add them as 'on...' attributes, but as events, using addEventListener
elem.addEventListener(key.replace(/^on/, ""), val, false);
} else {
// Note that the default namespace for XML attributes is, and should be, blank (ie. they're not in any namespace)
elem.setAttributeNS(attrNs.namespace || "", attrNs.shortName, val);
}
}
// Create and append this element's children
var childElems = Array.prototype.slice.call(arguments, 2);
childElems.forEach(function(childElem) {
if (childElem != null) {
elem.appendChild(
childElem instanceof doc.defaultView.Node ? childElem :
Array.isArray(childElem) ? tag.apply(null, childElem) :
doc.createTextNode(childElem));
}
});
return elem;
}
return tag.apply(null, jsonTemplate);
}
return jsonToDOM(jsonTemplate, doc, nodes);
},
init: function(){
if ("EzSidebarService" in window)
return;
this._sidebar_box = document.getElementById('sidebar-box');
var style = `
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#sidebar-splitter
{
-moz-box-align: center;
-moz-box-pack: center;
cursor: ew-resize;
border-width: 0 2px;
border-style: solid;
width: 2px;
max-width: 2px;
min-width: 0px;
background-color: var(--toolbar-bgcolor);
border-inline-start-color: var(--toolbar-bgcolor);
border-inline-end-color: var(--toolbar-bgcolor);
margin-left: 0px;
margin-inline-start: 0px;
}
#navigator-toolbox[inFullscreen="true"] #sidebar-box[hidden="true"] + #sidebar-splitter,
:root[inFullscreen="true"] #sidebar-box[hidden="true"] + #sidebar-splitter
{
width: 0px;
max-width: 1px;
min-width: 0px;
border-left-width: 0px;
border-right-width: 1px;
background-color: ThreeDFace;
}
`;
var sspi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"'
);
document.insertBefore(sspi, document.documentElement);
sspi.getAttribute = function(name) {
return document.documentElement.getAttribute(name);
};
if (this._FLOATING_SIDEBAR) {
// floating css
var floatingStyle = `
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#sidebar-box {
position: fixed ;
display: block;
z-index: 55555;
background-color: -moz-dialog;
left: 4px;
}
#sidebar-box #sidebar-header
{
width :100%;
}
#sidebar-box #sidebar
{
position: fixed ;
display: block;
height: calc(100vh - 210px);
border-left:3px solid -moz-dialog;
border-right:3px solid -moz-dialog;
border-bottom:3px solid -moz-dialog;
}
#sidebar-box #sidebar:-moz-lwtheme
{
border-left:3px solid var(--sidebar-background-color);
border-right:3px solid var(--sidebar-background-color);
border-bottom:3px solid var(--sidebar-background-color);
}
#sidebar-box {
border-right: 1px solid ThreeDShadow;
border-bottom: 1px solid ThreeDShadow;
}
#sidebar-box:-moz-locale-dir(rtl) {
border-left: 1px solid ThreeDHighlight;
}
#sidebar-box:-moz-lwtheme {
background-color: var(--sidebar-background-color);
}
#sidebar-box sidebarheader:-moz-lwtheme {
color: -moz-dialogtext;
text-shadow: none;
background-color: var(--sidebar-background-color);
-moz-appearance: toolbox;
border-bottom: 1px solid ThreeDShadow;
border-top: 1px solid ThreeDHighlight;
}
#sidebar-box #sidebarpopuppanel-bottom {
background-color: -moz-dialog;
width:100%;
}
#sidebar-box #sidebarpopuppanel-bottom:-moz-lwtheme {
background-color: var(--sidebar-background-color);
}`;
if (this._SIDEBARPOSITION="L") {
floatingStyle += ' #sidebar-box .PopupResizerGripper { \
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABG0lEQVQ4jZXT2ytEURTH8U8UIjNESh5kQq4zGIpci+LBg8vkMhgkl+RhMo0Uf7yHWWo8jDlzXvbZv32+a63fr31o7WnHEDaxj6VW4TTW8YgHbLUC92E2wDKKWEgCtyEVcAEfsc6gJwmcxgpKqGIPExhAd7OxUwFf4QknmMYadrD8H/zruRTwEbLI4za0g0Zj13uuRud5ZGKaL7xiNYnnXUyqJV7EN05D+5NBI8+ToZ2jEnAeI+ht5nk+Op/jDfexX8NGvDf1XIzOd1jEXIRYxgX0J/D8W3Aaz/iM72cFfBljH2MMufBaCTgbWgHvOIschmE7Dg6jcypGLeAa4xiMIjdROBd6Xl1QGXSho+5wCp2hj6ndvlG1XzqPlx+JJSwSgQwohgAAAABJRU5ErkJggg=="); \
cursor: se-resize; \
}';
} else {
floatingStyle += ' #sidebar-box:-moz-locale-dir(rtl) .PopupResizerGripper { \
list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABIUlEQVQ4jZXRwUsUYRzG8Q8Jthi6SiKEB1lZJdvWXUtBKW3BIA8dajfSUjdlMSU6RFII9cd7mGdBPM3MYYaZ9/0983y/L7TxBluYwwMVry4+4UtCZjBRJWAZ7/EdQ7QwWyWkhlV8xJ+0aaVJKZzJbG5gPyFDBU69TEgTG+ikST84x0o6eZnaA4XQNj6o4OQpTnCNrwqp7TQp5eRhMPr4n5BucEo5qWEe6wm5xmEGSjlpZLiT6mf4mZBSTno4Deua4kTO7zkZt7vrpD4OWVKcwG9c4nn+PIiTY8VJreEt/mKEV1iQWwefcYNv2MnQAP/ufFtJg1+4wK5sbOY5zOJrLEbij/D38BjPgjbCO7jK8JOwHQVhGlPYxgE28/4o63t4cQuE/SwSa1JPlgAAAABJRU5ErkJggg=="); \
cursor: sw-resize; \
}';
}
sspi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css,' + encodeURIComponent(floatingStyle) + '"'
);
document.insertBefore(sspi, document.documentElement);
sspi.getAttribute = function(name) {
return document.documentElement.getAttribute(name);
};
let template =
["hbox", {id: "sidebarpopuppanel-bottom"},
["spacer", {flex: "1"}],
["image", {class: "PopupResizerGripper",
onmousedown: "if (event.target == this) sidebarpopuppanelResize.start(event);"}]
];
document.getElementById('sidebar-box')
.appendChild(this.jsonToDOM(template, document, {}));
}
if (this._sidebar_box.hasAttribute('hidden') ||
this._CLOSE_AT_STARTUP) {
this._sidebar_box.collapsed = true;
}
this._sidebar_box.hidden = false;
this._sidebar = document.getElementById('sidebar');
this._sidebar_splitter = document.getElementById('sidebar-splitter');
if (this._sidebar_splitter.hasAttribute('hidden')) {
this._sidebar_splitter.removeAttribute('hidden');
}
this._sidebar_splitter.removeAttribute('state');
this._sidebar_splitter.removeAttribute('collapsed');
var checkbox = document.createXULElement('checkbox');
var item = document.getElementById('sidebar-throbber');
this._checkbox = item.parentNode.insertBefore(checkbox, item);
checkbox.setAttribute("id", "sidebar-checkbox");
checkbox.setAttribute("type", "checkbox");
checkbox.setAttribute("label", "");
checkbox.setAttribute('persist','checked');
checkbox.checked = this._CHECKBOX_AT_STARUP;
if(this._SIDEBARPOSITION == "R"){
(function(self){ //this code from http://pc11.2ch.net/test/read.cgi/software/1185343069/128
self._sidebar_splitter = self._sidebar_box.parentNode.appendChild(self._sidebar_splitter);
self._sidebar_box = self._sidebar_box.parentNode.appendChild(self._sidebar_box);
})(this);
}
window.PrintUtils.printPreview_org = PrintUtils.printPreview;
PrintUtils.printPreview = function(arg) {
if(document.getElementById("sidebar-box") &&
!!document.getElementById("sidebar-box").getAttribute("sidebarcommand")) {
if (window.ucjs_expand_sidebar._FLOATING_SIDEBAR)
SidebarUI.hide();
}
window.PrintUtils.printPreview_org(arg);
};
/**
* helper functions
*/
function accessorDescriptor(field, fun) {
var desc = { enumerable: true, configurable: true };
desc[field] = fun;
return desc;
}
function defineGetter(obj, prop, get) {
if (Object.defineProperty)
return Object.defineProperty(obj, prop, accessorDescriptor("get", get));
if (Object.prototype.__defineGetter__)
return obj.__defineGetter__(prop, get);
throw new Error("browser does not support getters");
}
function defineSetter(obj, prop, set) {
if (Object.defineProperty)
return Object.defineProperty(obj, prop, accessorDescriptor("set", set));
if (Object.prototype.__defineSetter__)
return obj.__defineSetter__(prop, set);
throw new Error("browser does not support setters");
}
/**
* hack
*/
defineGetter(SidebarUI, "isOpen", function isOpen(){return this._box && !this._box.collapsed;})
SidebarUI.show_org = SidebarUI.show;
SidebarUI.show = function show(commandID, triggerNode) {
//this._box.hidden = false;
this._box.collapsed = false;
this._splitter.hidden = false;
ucjs_expand_sidebar._loadKeepItSizes(commandID);
ucjs_expand_sidebar._lastcommand = commandID;
ucjs_expand_sidebar._opend = true;
if (ucjs_expand_sidebar._FLOATING_SIDEBAR) {
let x = document.getElementById("appcontent").getBoundingClientRect().x;
ucjs_expand_sidebar._sidebar_box.style.setProperty("left", x + "px", "");
}
SidebarUI.show_org(commandID, triggerNode);
}
SidebarUI.hide_org = SidebarUI.hide;
SidebarUI.hide =
function hide(triggerNode) {
if (!this.isOpen) {
return;
}
ucjs_expand_sidebar._saveKeepItSizes(ucjs_expand_sidebar._lastcommand);
this._box.collapsed = true;
if ("treeStyleTab" in gBrowser)
gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
gBrowser.selectedBrowser.focus();
//SidebarUI.hide(triggerNode);
}
//Fokussierte Aktion der Seitenleisten ausführen
//
if (typeof fireSidebarFocusedEvent == "function") {
window.fireSidebarFocusedEvent_org = fireSidebarFocusedEvent;
fireSidebarFocusedEvent = function () {
fireSidebarFocusedEvent_org();
ucjs_expand_sidebar._focused();
}
}
if (typeof SidebarUI._fireFocusedEvent == "function") {
SidebarUI._fireFocusedEvent_org = SidebarUI._fireFocusedEvent;
SidebarUI._fireFocusedEvent = function () {
SidebarUI._fireFocusedEvent_org();
ucjs_expand_sidebar._focused();
}
}
//Beim Start Seitenleiste geschlossen halten?
setTimeout(function(self) {
var command = self._sidebar_box.getAttribute("sidebarcommand");
if (command)
self._lastcommand = command;
var broadcasters = document.getElementsByAttribute("group", "sidebar");
if (self._CLOSE_AT_STARTUP) {
SidebarUI.hide();
//self._sidebar_box.setAttribute('collapsed',true);
for (var i = 0; i < broadcasters.length; ++i) {
if (broadcasters[i].localName != "broadcaster") {
continue;
}
broadcasters[i].removeAttribute("checked");
}
} else {
for (var i = 0; i < broadcasters.length; ++i) {
if (broadcasters[i].localName != "broadcaster") {
continue;
}
if (broadcasters[i].hasAttribute("checked")) {
self._loadKeepItSizes();
break;;
}
}
}
}, 500, this);
this._content = document.getElementById("content");
if (this._CLOSEWHENGOOUT)
window.addEventListener("mouseout", ucjs_expand_sidebar._mouseout, true);
else
this._sidebar_splitter.addEventListener("mouseout", ucjs_expand_sidebar._mouseout, true);
if (this._KEEP_SIZES)
window.addEventListener("resize", this, false);
if (this._SIDEBARPOSITION == "R"){
gBrowser.tabpanels.addEventListener("mouseup", this, true);
gBrowser.tabpanels.addEventListener("mousedown", this, true);
}
//this._content.addEventListener("mouseover", ucjs_expand_sidebar._mousemove, true);
document.getElementById("browser").addEventListener("mousemove", ucjs_expand_sidebar._mousemove, true);
this._sidebar_box.addEventListener("mouseover", ucjs_expand_sidebar._mouseover, true);
window.addEventListener("dblclick", this, true);
//window.addEventListener("click", this, true);
this._sidebar_splitter.addEventListener("dragover", this, true);
Services.obs.addObserver(this, "private-browsing", false);
},
uninit: function(){
if (this._CLOSEWHENGOOUT)
window.removeEventListener("mouseout", ucjs_expand_sidebar._mouseout, true);
else
this._sidebar_splitter.removeEventListener("mouseout", ucjs_expand_sidebar._mouseout, true);
if (this._KEEP_SIZES)
window.removeEventListener("resize", this, false);
if (this._SIDEBARPOSITION == "R"){
gBrowser.tabpanels.removeEventListener("mouseup", this, true);
gBrowser.tabpanels.removeEventListener("mousedown", this, true);
}
//this._content.removeEventListener("mouseover", ucjs_expand_sidebar._mousemove, true);
document.getElementById("browser").removeEventListener("mousemove", ucjs_expand_sidebar._mousemove, true);
this._sidebar_box.removeEventListener("mouseover", ucjs_expand_sidebar._mouseover, true);
window.removeEventListener("dblclick", this, true);
//window.removeEventListener("click", this, true);
this._sidebar_splitter.removeEventListener("dragover", this, true);
Services.obs.removeObserver(this, "private-browsing");
},
_back_url: null,
_back_cachedurl: null,
observe: function(aSubject, aTopic, aData) {
var self = ucjs_expand_sidebar;
if (aData == "enter") {
self._back_url = self._sidebar_box.getAttribute("src");
if (self._back_url == "chrome://browser/content/web-panels.xul") {
var b = self._sidebar.contentDocument.getElementById("web-panels-browser");
self._back_cachedurl = b.getAttribute("cachedurl");
}
self._sidebar_box.setAttribute("src", "about:blank");
self._sidebar.setAttribute("src", "about:blank");
self._backup_lastcommand = self._lastcommand;
} else if (aData == "exit") {
self._lastcommand = self._backup_lastcommand;
self._backup_lastcommand = null;
self._sidebar.setAttribute("src", "about:blank");
if (self._back_url == "chrome://browser/content/web-panels.xul") {
if (!!self._back_cachedurl) {
b = self._sidebar.contentDocument.getElementById("web-panels-browser");
b.setAttribute("cachedurl", self._back_cachedurl);
document.persist("web-panels-browser", "cachedurl");
self._back_cachedurl = null;
}
}
self._sidebar_box.setAttribute("src", self._back_url);
self._back_url = null;
}
},
handleEvent: function(event){
event = new XPCNativeWrapper(event);
switch (event.type){
case "mouseup":
if (this._mouse_Timeout)
clearTimeout(this._mouse_Timeout);
this._mouse_Timeout = setTimeout(function(self) {
self._mousedown = false;
self._checkWindowSideOrNot(event);
},this._SCROLLBAR_DELAY,this);
break;
case "mousedown":
if (event.screenX < this._sidebar_splitter.screenX - this._TOLERANCE)
break;
this._mousedown = true;
if (this._mouse_Timeout)
clearTimeout(this._mouse_Timeout);
this._mouse_Timeout = null;
this._clearOpenCloseTimer();
break;
case "click":
if (event.button != 2) {
//return;
}
event.preventDefault();
case "dblclick":
if(event.originalTarget != this._sidebar_splitter)
return;
event.preventDefault();
event.stopPropagation();
if (this._mouse_Timeout)
clearTimeout(this._mouse_Timeout);
this._mouse_Timeout = null;
SidebarUI.toggle(this._getDefaultCommandID());
this._openSidebar(this._getDefaultCommandID());
this._mousedown = false;
break;
case "dragover":
if (this._mouse_Timeout)
clearTimeout(this._mouse_Timeout);
this._mouse_Timeout = null;
this._mousedown = false;
if (this._close_Timeout)
clearTimeout(this._close_Timeout);
this._close_Timeout = null;
if(!this._open_Timeout){
this._open_Timeout = setTimeout(function(self){
var hidden = (self._sidebar_box.hasAttribute('hidden')?true:false) ||
self._sidebar_box.getAttribute('collapsed') == "true";
if (hidden) {
SidebarUI.toggle(self._getDefaultCommandID(), true);
self._openSidebar(self._getDefaultCommandID(), true);
}
}, this._OPEN_DELAY_DRAGOVER, this);
}
break;
case "resize":
if (this._FLOATING_SIDEBAR)
return;
if (this._resizeTimer)
clearTimeout(this._resizeTimer);
if (this._startup) {
this._startup = false;
return;
}
this._resizeTimer = setTimeout(function(self) {
//Wenn die Seitenleiste geöffnet ist, Größe speichern
var hidden = self._sidebar_box.hasAttribute('hidden') ? true : false;
if (!hidden && self._sidebar_box.getAttribute('collapsed') != "true" ) {
var size = self._sidebar_box.width;
//Aktuellen Befehl ermitteln.(get)
var _command = self.getCommandId();
if (!!_command){
self._saveKeepItSizes(_command, size);
}
}
}, 500, this);
break;
}
},
//Getrennt, um die Last zu reduzieren
_mouseover: function(event){
ucjs_expand_sidebar._checkWindowSideOrNot(event);
},
_mousemove: function(event){
var self = ucjs_expand_sidebar;
//self.debug(event);
if (self._mtimer)
return;
self._mtimer = true;
setTimeout(function(self){
self._mtimer = false;
}, self._MOUSEMOVEINTERVAL, self);
//self..debug("_mousemove " +event.originalTarget);
if (event.originalTarget == self._sidebar_splitter) {
self._checkWindowSideOrNot(event);
return;
}
//self.debug("_mousemove self._mousedown=" +self._mousedown);
if (self._mousedown) {
return;
}
self._checkWindowSideOrNot(event);
},
_mouseout: function(event){
var self = ucjs_expand_sidebar;
if (self._mouse_Timeout)
clearTimeout(self._mouse_Timeout);
self._mouse_Timeout = null;
//keine Aktion direkt nach dem öffnen
if (self._opend) return;
//Beim Überfahren des Fensterrandes Seitenleiste nicht öffnen
if(!self._CLOSEWHENGOOUT){
if (self._sidebar_splitter == event.originalTarget){
if (self._open_Timeout)
clearTimeout(self._open_Timeout);
self._open_Timeout = null;
}
return;
}
//Wenn diese Option aktiviert ist, Seitenleiste nicht schließen
if (self._checkbox.checked) return;
if (/^menu|browser|tooltip/.test(event.originalTarget.localName)) return;
if (self._sidebar.contentWindow.location.href == "chrome://browser/content/web-panels.xul") return;
if (!self._close_Timeout) {
//self.debug(event.type + " " + event.originalTarget.localName + " " + event.target.localName );
if (self._open_Timeout)
clearTimeout(self._open_Timeout);
self._open_Timeout = null;
self._close_Timeout = setTimeout(function(self){
self._mousedown = false;
self.toggleSidebar();
}, self._CLOSE_DELAY, self);
}
},
//Aktuellen Befehl ermitteln.(get)
getCommandId: function(){
var _command = "";
var broadcasters = document.getElementsByAttribute("group", "sidebar");
for (var i = 0; i < broadcasters.length; ++i) {
if (broadcasters[i].localName != "broadcaster") {
continue;
}
if (broadcasters[i].hasAttribute('checked')) {
_command = broadcasters[i].id;
break;;
}
}
return _command;
},
toggleSidebar: function expandsidebartoggleSidebar(commandID, forceOpen = false) {
if (this._FLOATING_SIDEBAR) {
let x = document.getElementById("appcontent").getBoundingClientRect().x;
this._sidebar_box.style.setProperty("left", x + "px", "");
}
if (forceOpen) {
SidebarUI.show(commandID);
} else {
SidebarUI.toggle(commandID);
}
},
_loadKeepItSizes: function(_command){
if (this._KEEP_SIZES) {
if (!_command)
_command = this.getCommandId();
if(!!_command) {
this.sizes = this.getPref(this.prefKeepItSizes, 'str', 'viewBookmarksSidebar|178|viewHistorySidebar|286|viewGrepSidebar|157|viewUpdateScanSidebar|230|viewWebPanelsSidebar|371|viewWebPageSidebar|371|viewScrapBookSidebar|182|viewAdd-onsSidebar|371|viewStylishSidebar|379|viewMozgestSidebar|234|viewConsole2Sidebar|234|viewGoogleTransitSidebar|371|viewGoogleDocSidebar|371|viewIGoogleSidebar|371|viewPasswordManagerSidebar|371').split('|');
var index = this.sizes.indexOf(_command);
if (index < 0 ){
this.sizes.push(_command);
index = this.sizes.length - 1;
this.sizes.push(this._defaultWidth);
}
if (this.sizes[index + 1] <= 0)
this.sizes[index + 1] = this._defaultWidth
if (this._FLOATING_SIDEBAR)
this._sidebar.style.setProperty('width', this.sizes[index + 1] + "px", "important");
else
this._sidebar_box.width = this.sizes[index + 1];
return;
}
}
if (this._sidebar_box.width == 0) {
if (this._FLOATING_SIDEBAR) {
this._sidebar.style.setProperty('width', this._defaultWidth + "px", "important");
} else {
this._sidebar_box.width = this._defaultWidth;
}
}
},
_saveKeepItSizes: function(_command, size){
if (!this._KEEP_SIZES)
return;
if (!!_command && size) {
//this.debug(_command + " "+ size);
var index = this.sizes.indexOf(_command);
if (index < 0 ){
this.sizes.push(_command);
this.sizes.push(size);
} else {
this.sizes[index + 1] = size;
}
var str = this.sizes.join('|');
this.setPref(this.prefKeepItSizes, 'str', str);
}
},
_openSidebar: function(_command, _forceOpen){
this._clearOpenCloseTimer();
//this.toggleSidebar(_command, _forceOpen);
//mouseoutを処理するかどうかのフラグオープン直後はtrue
this._opend = true;
if(this._mouseoutTimer)
clearTimeout(this._mouseoutTimer);
//open後200msec経過すればmouseoutを処理できるように falseにする
this._mouseoutTimer = setTimeout(function(that){that._opend = false;},300,this);
},
_focused: function(){
//Suchfeld fokussieren wenn vorhanden
var doc = this._sidebar.contentWindow.document;
if (doc) {
var elem = doc.getElementById("search-box");
if (elem) {
try {
setTimeout(function(doc, elem){
doc.defaultView.focus();
elem.focus();
}, 0, doc, elem)
} catch(e) {}
}
}
},
_getDefaultCommandID: function(_command){
if(!_command) _command = this._lastcommand;
if(!_command) _command = this._DEFAULTCOMMAND;
return _command;
},
_clearOpenCloseTimer: function() {
if (this._close_Timeout)
clearTimeout(this._close_Timeout);
this._close_Timeout = null;
if (this._open_Timeout)
clearTimeout(this._open_Timeout);
this._open_Timeout = null;
},
_checkMouseIsWindowEdge: function(x) {
var sw = this._sidebar_splitter.getBoundingClientRect().width;
if (this._SIDEBARPOSITION == "L") {
//Linker Rand des Fensters x Koordinaten
if ( 0 <= x && x <= sw + this._TOLERANCE)
return true;
}else if(this._SIDEBARPOSITION == "R") {
//Rechter Rand des Fensters x Koordinaten
if (-this._TOLERANCE <= x && x <= sw)
return true;
}
return false;
},
_checkMouseIsSidebarEdge: function(x){
var sw = this._sidebar_splitter.getBoundingClientRect().width;
//this.debug("_checkMouseIsSidebarEdge " +(sw + this._TOLERANCE+"px ") + (x+"px "));
if (this._SIDEBARPOSITION == "L") {
//Linker Rand des Fensters x Koordinaten
if(sw + this._TOLERANCE < x)
return true;
} else if(this._SIDEBARPOSITION == "R") {
//Rechter Rand des Fensters x Koordinaten
if (x < -this._TOLERANCE)
return true;
}
return false;
},
_checkWindowSideOrNot: function(event){
var sidebar_box = this._sidebar_box;
if (sidebar_box.width == 0)
sidebar_box.width = this._defaultWidth;//Standardbreite der Seitenleiste
//this.debug(event.target.localName);
/*
if(/tabbrowser/.test(event.target.localName)){
return
}
*/
//Ob es außerhalb des oberen und unteren Bereichs des Inhaltsbereichs liegt
var y = event.screenY - gBrowser.tabpanels.screenY;
if(y < 0 || y > gBrowser.tabpanels.getBoundingClientRect().height){
this._clearOpenCloseTimer();
return
}
//this.debug(event.type+"\n"+event.screenX+"\n"+this._sidebar_splitter.boxObject.screenX+"\n"+(event.target instanceof HTMLElement || /browser/.test(event.target.localName) ))
var hidden = (sidebar_box.hasAttribute('hidden')?true:false) ||
sidebar_box.getAttribute('collapsed') == "true";
var x = event.screenX - this._sidebar_splitter.screenX;
//Fensterrand ermitteln
if (hidden) {
if (event.originalTarget == this._sidebar_splitter ||
this._checkMouseIsWindowEdge(x)) {
if (this._close_Timeout)
clearTimeout(this._close_Timeout);
this._close_Timeout = null;
if (!this._open_Timeout) {
this._open_Timeout = setTimeout(function(self){
SidebarUI.toggle(self._getDefaultCommandID());
self._openSidebar(self._getDefaultCommandID());
}, this._OPEN_DELAY, this);
}
} else {
if (this._open_Timeout)
clearTimeout(this._open_Timeout);
this._open_Timeout = null;
}
return;
}
//X-Koordinate der Inhaltsseite der Seitenleiste
if (!this._checkbox.checked && !hidden) {
//this.debug("this.isChrome(event) "+ this.isChrome(event));
if (event.originalTarget != this._sidebar_splitter &&
this._checkMouseIsSidebarEdge(x) &&
!(this._DONOTCLOSE_XULELEMENT && this.isChrome(event)) /*||
(event.type == "mouseover" &&
(event.target instanceof HTMLElement || /browser/.test(event.target.localName)) )*/ ) {
if (this._open_Timeout)
clearTimeout(this._open_Timeout);
this._open_Timeout = null;
if (this._close_Timeout || this._opend)
return;
this._close_Timeout = setTimeout(function(self){
self.toggleSidebar();
}, this._CLOSE_DELAY, this);
} else {
if (this._close_Timeout)
clearTimeout(this._close_Timeout);
this._close_Timeout = null;
this._opend = false;
}
}
},
isChrome: function(aEvent) {
var x = aEvent.screenX;
var y = aEvent.screenY;
var sidebarBox = this._sidebar_box.getBoundingClientRect();
//userChrome_js.debug( this._sidebar_box.screenX <= x)
//userChrome_js.debug( x <= this._sidebar_box.screenX + sidebarBox.width )
if (this._sidebar_box.screenX <= x && x <= this._sidebar_box.screenX + sidebarBox.width &&
this._sidebar_box.screenY <= y && y <= this._sidebar_box.screenY + sidebarBox.height)
return true;
//if (aEvent.target instanceof HTMLElement)
// return false;
if (/^(splitter|grippy|menu|panel|notification)/.test(aEvent.target.localName))
return true;
var box = gBrowser.tabpanels.getBoundingClientRect();
var bx = gBrowser.tabpanels.screenX;
var by = gBrowser.tabpanels.screenY;
if (bx <= x && x <= bx + box.width &&
by <= y && y <= by + box.height)
return false;
else
return true;
},
//Einstellungen lesen
getPref: function(aPrefString, aPrefType, aDefault){
var xpPref = Components.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefBranch);
try{
switch (aPrefType){
case 'complex':
return xpPref.getComplexValue(aPrefString, Components.interfaces.nsILocalFile); break;
case 'str':
return xpPref.getCharPref(aPrefString).toString(); break;
case 'int':
return xpPref.getIntPref(aPrefString); break;
case 'bool':
default:
return xpPref.getBoolPref(aPrefString); break;
}
}catch(e){
}
return aDefault;
},
//Einstellungen speichern
setPref: function(aPrefString, aPrefType, aValue){
var xpPref = Components.classes['@mozilla.org/preferences-service;1']
.getService(Components.interfaces.nsIPrefBranch);
try{
switch (aPrefType){
case 'complex':
return xpPref.setComplexValue(aPrefString, Components.interfaces.nsIFile, aValue); break;
case 'str':
return xpPref.setCharPref(aPrefString, aValue); break;
case 'int':
aValue = parseInt(aValue);
return xpPref.setIntPref(aPrefString, aValue); break;
case 'bool':
default:
return xpPref.setBoolPref(aPrefString, aValue); break;
}
}catch(e){
}
return null;
},
debug: function(aMsg){
// return;
const Cc = Components.classes;
const Ci = Components.interfaces;
Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService)
.logStringMessage(aMsg);
}
};
// Einstiegspunkt
ucjs_expand_sidebar.init();
window.addEventListener("unload", function(){ ucjs_expand_sidebar.uninit(); }, false);
var sidebarpopuppanelResize = {
drag : false,
size : null,
offset : null,
PREF_SIZE : "extensions.sidebarpopuppanelResize.size.",
get isRTL() {
return document.defaultView
.getComputedStyle(document.getElementById("nav-bar"), "")
.direction == "rtl";
},
get sidebar() {
return document.getElementById("sidebar");;
},
get sidebarbox() {
return document.getElementById("sidebar-box");;
},
get sidebarcommand() {
return this.sidebarbox.getAttribute('sidebarcommand');
},
init: function(){
window.addEventListener("unload", this, false);
},
uninit: function(){
window.removeEventListener("unload", this, false);
window.removeEventListener("mouseup", this, true);
window.removeEventListener("mousemove", this, true);
},
handleEvent: function (event) {
switch (event.type) {
case "load":
this.init();
break;
case "unload":
this.uninit();
break;
case "mouseup":
this.mouseup(event);
break;
case "mousemove":
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setTimeout(function (event, self) {
self.mousemove(event);
}, 10, event, this);
break;
default:;
}
},
start: function(event){
this.drag = true;
this.size = {height:parseInt(this.sidebar.getBoundingClientRect().height),
width:parseInt(this.sidebar.getBoundingClientRect().width)};
this.offset = {x: event.screenX, y: event.screenY};
window.addEventListener("mouseup", this, true);
window.addEventListener("mousemove", this, true);
},
mouseup: function(event) {
this.drag = false;
window.removeEventListener("mousemove", this, true);
window.removeEventListener("mouseup", this, true);
ucjs_expand_sidebar._saveKeepItSizes(this.sidebarcommand, this.sidebar.getBoundingClientRect().width);
},
mousemove: function(event) {
if (this.drag) {
var newValue;
var h = this.sidebar.getBoundingClientRect().height;
newValue = this.size.height + event.screenY - this.offset.y;
if (newValue <= screen.height - 50 && newValue >= 10) {
h = newValue;
}
var w = this.sidebar.getBoundingClientRect().width;
if (this.isRTL)
newValue = this.size.width - (event.screenX - this.offset.x);
else
newValue = this.size.width + event.screenX - this.offset.x;
if (newValue <= screen.width && newValue >= 100) {
w = newValue;
}
this.setSize(h, w);
}
},
setSize: function(h, w){
if (h && h + this.sidebar.screenY <= screen.height - 50 && h >= 10) {
// this.sidebar.style.setProperty('height', h + "px", "important");
}
var x = this.sidebar.screenX;
var y = this.sidebar.screenY;
if (w && w <= screen.width && w >= 100) {
this.sidebar.style.setProperty('width', w + "px", "important");
//this.sidebarbox.width = w;
}
}
};
sidebarpopuppanelResize.init();
Alles anzeigen
Mfg.
Endor
Hallo zusammen.
Habe da mal was für Firefox View gebastelt.
Testet mal:
@-moz-document url("about:firefoxview"){
html{background: #ffffff !important; margin-top: 20px !important;}
/* Breite einstellen */
body{
background: #fffff0 !important;
margin-top: 15px !important;
margin-left: 110px !important;
max-width: 1200px !important;
min-height: 700px !important;
padding-left: 25px !important;
padding-right: 25px !important;
padding-bottom:25px !important;
border-left-color: lightblue!important;
border-top-color: lightblue!important;
border-right-color: dodgerblue!important;
border-bottom-color: dodgerblue!important;
border-radius: 20px !important;
border-width: 4px !important;
border-style: outset !important;}
.notice {
background-color: #ee7621 !important;
color: #ffffff !important;
padding-left: 20px !important;
margin-top: 30px !important;
border-radius: 24px !important;}
th {background-color: #ee7621 !important;}
.notice:hover,
th:hover {background-color: #b54f06 !important;}
td{background: #FFFFFF !important;}
td:hover{background: #ffeb99 !important;}
.brand-feature-name{color: red !important; font-size: 26px !important; font-weight: bold !important; }
.brand-logo {margin-top: 20px !important;}
h1{color: red !important; font-size: 22px !important; font-weight: bold !important; margin-top: 20px !important;}
h2{color: #3377ff !important; margin-left: 40px !important; margin-top: 20px !important;}
#colorways-collection-title {color: red !important; font-size: 19px !important; font-weight: bold !important; }
#colorways-button{
appearance:none!important;
background: #0060df url("..//icons/App-colors.png") no-repeat !important;
padding-left:35px!important;
border-left-color: lightblue!important;
border-top-color: lightblue!important;
border-right-color: dodgerblue!important;
border-bottom-color: dodgerblue!important;
border-width:2px !important;
border-style: outset !important;
background-position:10px 8px!important;
border-radius:30px!important;}
#colorways-button:hover{
appearance:none!important;
background: #003eaa url("..//icons/App-colors.png") no-repeat !important;
border-left-color: #bbddff !important;
border-top-color: #bbddff !important;
border-right-color: #11508d !important;
border-bottom-color: #11508d !important;
border-style: outset !important;
border-width:2px !important;
background-position:10px 8px!important;
border-radius:30px!important;}
#firefoxview-tabpickup-step-signin-primarybutton{
appearance:none!important;
background: #0060df url("..//icons/weiter1.png") no-repeat !important;
padding-left:35px!important;
border-left-color: lightblue!important;
border-top-color: lightblue!important;
border-right-color: dodgerblue!important;
border-bottom-color: dodgerblue!important;
border-width:2px !important;
border-style: outset !important;
background-position:10px 8px!important;
border-radius:30px!important;}
#firefoxview-tabpickup-step-signin-primarybutton:hover{
appearance:none!important;
background: #003eaa url("..//icons/weiter1.png") no-repeat !important;
border-left-color: #bbddff !important;
border-top-color: #bbddff !important;
border-right-color: #11508d !important;
border-bottom-color: #11508d !important;
border-style: outset !important;
border-width:2px !important;
background-position:10px 8px!important;
border-radius:30px!important;}
}
Alles anzeigen
Symbole:
![]()
Hoffe es passt.
Mfg.
Endor
Hallo Boersenfeger.
Das liegt an einem anderen CSS Code, der das Symbol vom CSS Loaderscript anzeigt.
Der sieht hier so aus:
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@-moz-document url(chrome://browser/content/browser.xhtml){
#usercssloader-menu {
-moz-appearance:none!important;
margin-right: -6px !important;
margin-left: -1px !important;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAADJklEQVR4Xi3Pb0yVdRjG8e%2Fze57ncDrAOWwRhDQ7xYAMlAgIBW2txaio5TvMzZa68oWtzRdKbXbIpWyOzcWLWqXkFjUtsIksW72wuTVx%2BEJHCxhkSCNoKLYDwuH8e66eNV98dr24t%2Fu%2BLwsAoKsucqg4tFS4kiTtge4PFAkRksADGdsyua4JXJ7ITH0yQw%2BABTB3sHGipGNjJX8MgzGw6oEBQi5kPYinQBYEbDDAX5PEulJXPhqn2bQE2Fayfa2S8THOfu%2FwzTkDzmOQV8nAkOHMoIFgmS9K3w%2Fi5DmP1fwqdrbRFIR6euqJ6btc2Y4jsGWM0emOWrU2FAtQRTSiid7n9EJtkQCVlebrUle9lnuLVA3v09%2FG8diLCFxp%2BDVprF2a2KHqsrACtqVbQy9L8T2qq4goaKOpz5uka22Kn1yn2gBHOPMSx9o3obJokbS8R%2Fp3txTfK918Q%2B2tjwrQYPcWaW6Xdj5fKkB9B2uks%2Bv1VICYSWXQjia4eWuB8z2%2F0%2F%2FpGMMD04yP3qFzfzXBoE3sszGmR27Tubuc3KDDsf4ZsME2iO4GjuqXQh1orxDwv1OxBsX2VQlQcWGObnzdog%2F3bhCg0uIHNPLFVqnf%2F8DlA2ctDSTgxNFnOHFgE7jAg7kQcjnS8TRgQcCiprGQzncrIZ0i%2Fu0so7lLODlgsh6QSMNCAix8BhJJNH6b5NwyFNhwLwWuB%2FNxEoemudi9wMT8Cq4LBrDwgLUULK%2FBPR9%2BjC4ytPUC17%2F8DR6CpYEplt%2BeJTX7OH9HbEL5NvKwjGvj4AHprC8DSZ%2B%2FzHJgI%2BuI%2BxdvbL9E%2BJRLJr%2BSr5LXKd8foqY8QjqN7fxzlzhaAy8LGYHnQTxJ3hNhFlptCi4XsP7PEoaD4mr4KlveeZjNG4qYvDbKyipJolCXOI70U630Y6uvRfrZzyuvSKOvavK9Kp2OFqv3zagWLzb7s21aubBZ519HFjzrg8NP8utbu2hWMIyyHpYBYwyOa2Hn2cwuJAiHAthp%2Be087s4n6e5LjwzeodECAKiAffk5PJLOkJKFACzLZ8B27jfMYgUM7mKSuzPwMcB%2F6Jh%2FV5xUni0AAAAASUVORK5CYII%3D") no-repeat !important;
background-position:1px 6px!important;
}
#usercssloader-menu:hover {
-moz-appearance:none !important;
margin-left: -5px !important;
margin-right: -3px !important;
padding-right: 1px !important;
background: #E3E3E3 url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAADJklEQVR4Xi3Pb0yVdRjG8e%2Fze57ncDrAOWwRhDQ7xYAMlAgIBW2txaio5TvMzZa68oWtzRdKbXbIpWyOzcWLWqXkFjUtsIksW72wuTVx%2BEJHCxhkSCNoKLYDwuH8e66eNV98dr24t%2Fu%2BLwsAoKsucqg4tFS4kiTtge4PFAkRksADGdsyua4JXJ7ITH0yQw%2BABTB3sHGipGNjJX8MgzGw6oEBQi5kPYinQBYEbDDAX5PEulJXPhqn2bQE2Fayfa2S8THOfu%2FwzTkDzmOQV8nAkOHMoIFgmS9K3w%2Fi5DmP1fwqdrbRFIR6euqJ6btc2Y4jsGWM0emOWrU2FAtQRTSiid7n9EJtkQCVlebrUle9lnuLVA3v09%2FG8diLCFxp%2BDVprF2a2KHqsrACtqVbQy9L8T2qq4goaKOpz5uka22Kn1yn2gBHOPMSx9o3obJokbS8R%2Fp3txTfK918Q%2B2tjwrQYPcWaW6Xdj5fKkB9B2uks%2Bv1VICYSWXQjia4eWuB8z2%2F0%2F%2FpGMMD04yP3qFzfzXBoE3sszGmR27Tubuc3KDDsf4ZsME2iO4GjuqXQh1orxDwv1OxBsX2VQlQcWGObnzdog%2F3bhCg0uIHNPLFVqnf%2F8DlA2ctDSTgxNFnOHFgE7jAg7kQcjnS8TRgQcCiprGQzncrIZ0i%2Fu0so7lLODlgsh6QSMNCAix8BhJJNH6b5NwyFNhwLwWuB%2FNxEoemudi9wMT8Cq4LBrDwgLUULK%2FBPR9%2BjC4ytPUC17%2F8DR6CpYEplt%2BeJTX7OH9HbEL5NvKwjGvj4AHprC8DSZ%2B%2FzHJgI%2BuI%2BxdvbL9E%2BJRLJr%2BSr5LXKd8foqY8QjqN7fxzlzhaAy8LGYHnQTxJ3hNhFlptCi4XsP7PEoaD4mr4KlveeZjNG4qYvDbKyipJolCXOI70U630Y6uvRfrZzyuvSKOvavK9Kp2OFqv3zagWLzb7s21aubBZ519HFjzrg8NP8utbu2hWMIyyHpYBYwyOa2Hn2cwuJAiHAthp%2Be087s4n6e5LjwzeodECAKiAffk5PJLOkJKFACzLZ8B27jfMYgUM7mKSuzPwMcB%2F6Jh%2FV5xUni0AAAAASUVORK5CYII%3D") no-repeat !important;
background-position:5px 6px!important;
}
#usercssloader-menu > .menu-text,
#usercssloader-menu > .menu-right {
display: none !important;
}
}
Alles anzeigen
Such Deinen mal raus und vergleiche.
Mfg.
Endor
ich bin seit einigen Tagen Opa;
Herzlichen Glückwunsch dazu.
Viel Freude wünsche ich Dir und Mutter und Kind
alles Gute vor allem viel Gesundheit. ![]()
Mfg.
Endor
Hallo edvoldi.
Auch von mir alles alles Gute zum Geburtstag.
Vor allem viel Gesundheit wünsche ich Dir.
Viele Grüße
Endor
Alles alles Gute zum Geburtstag bigpen !
Vor alles viel Gesundheit wünsche ich Dir.
Bleib Gesund.
Mfg.
Endor
Vielen Dank euch beiden AngelOfDarkness und BrokenHeart.
Ja leider so ist es.
Vielen Dank nochmals.
Mfg.
Endor
Vielen Dank euch allen.
Mfg.
Endor
Heute ist meine liebe Mutter leider gestorben.
Mutter ich werde Dich immer vermissen.
Ruhe in Frieden.
Mfg.
Endor
Dafür verwende ich ein Script, von aborix, damit ist er dann
über den Anpassen Dialog frei verschiebbar:
(function() {
if (location != 'chrome://browser/content/browser.xhtml')
return;
var menuButton = document.getElementById('PanelUI-menu-button');
if (!CustomizableUI.getPlacementOfWidget('ucjs_PanelUI-button')) {
try {
CustomizableUI.createWidget({
id: 'ucjs_PanelUI-button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbaritem');
toolbaritem.id = 'ucjs_PanelUI-button';
toolbaritem.className = 'chromeclass-toolbar-additional';
toolbaritem.setAttribute('label', 'Firefox Anpassen');
return toolbaritem;
}
});
if (!CustomizableUI.getPlacementOfWidget('ucjs_PanelUI-button')) {
menuButton.style.display = 'none';
return;
};
} catch(e) {
menuButton.style.display = 'none';
return;
};
};
setTimeout(function() {
document.getElementById('ucjs_PanelUI-button').appendChild(menuButton);
menuButton.setAttribute('consumeanchor', 'ucjs_PanelUI-button');
menuButton.setAttribute('label', 'Firefox Anpassen');
menuButton.setAttribute('tooltiptext', 'Firefox Anpassen + Panel');
}, 0);
}());
Alles anzeigen
Dieses Script macht dann die Schaltfläche für das Überhangmenü frei verschiebbar:
(function() {
if (location != 'chrome://browser/content/browser.xhtml')
return;
// Mehr-Werkzeuge-Schaltfläche verschiebbar
try {
CustomizableUI.createWidget({
id: 'ucjs_overflow-item',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbaritem');
toolbaritem.id = 'ucjs_overflow-item';
toolbaritem.className = 'chromeclass-toolbar-additional';
toolbaritem.setAttribute('label', 'Mehr Werkzeuge');
return toolbaritem;
}
});
} catch(e) { };
document.getElementById('ucjs_overflow-item').appendChild(document.getElementById('nav-bar-overflow-button'));
})();
Alles anzeigen
Mfg.
Endor
Ja könnte eventuell so sein.
Aber Deine Version die Du gemacht hast ist definitiv die bessere
Variante, da sie unabhängig von anderen Scripten funktioniert.
Übrigens klasse Arbeit!!!
![]()
Mfg.
Endor
Hallo Speravir.
Vom usercssloader.uc.js Script habe ich hier eine aktuellere Version,
vielleicht testet ihr die mal.
// ==UserScript==
// @name UserCSSLoader
// @description CSS Codes - Styles laden und verwalten
// @namespace http://d.hatena.ne.jp/Griever/
// @author Griever
// @include main
// @license MIT License
// @compatibility Firefox 4 - 102*
// @charset UTF-8
// @version 0.0.4K
// @note Fx92: getURLSpecFromFile() -> getURLSpecFromActualFile()
// @note AUTHOR_SHEET Verwendung hinzugefügt, wichtig: am Ende des Dateinamens .author.css
// @note Version 0.0.4.g ermoeglicht "Styles importieren" per Mittelklick und Verwendung
// @note eines anderen Dateimanager (s. vFileManager in Zeile 53)
// @note Frei verschiebbare Schaltfläche eingebaut von aborix
// @note 0.0.4 Remove E4X
// @note CSSEntry-Klasse erstellt
// @note Style-Test-Funktion überarbeitet
// @note Wenn die Datei gelöscht wurde, CSS beim Neu erstellen und Löschen des Menüs abbrechen
// @note uc einlesen .uc.css temporäre Korrespondenz zum erneuten Lesen
// ==/UserScript==
/****** Bedienungsanleitung ******
CSS-Ordner im Chrome-Ordner erstellen, CSS-Dateien dort ablegen - speichern.
Diejenigen, deren Dateiname mit "xul-" beginnen, diejenigen, die mit ".as.css" enden, sind AGENT_SHEET,
alle andere außer USER_SHEET werden gelesen. Da der Inhalt der Datei nicht überprüft wird,
darauf achten, @ Namespace Angabe nicht zu vergessen!
CSS-Menü wird zur Menüleiste hinzugefügt
Linksklick auf Stil, zum aktivieren/deaktivieren
Mittelklick auf Stil zum aktivieren/deaktivieren, ohne Menü zu schließen
Rechtsklick auf Stil zum Öffnen im Editor
Verwenden des in "view_source.editor.path" angegebenen Editors
Ordner kann geändert werden, indem ein Pfad in "UserCSSLoader.FOLDER" eingefügt wird
**** Anleitung Ende ****/
(function(){
let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
if (!window.Services)
Cu.import("resource://gre/modules/Services.jsm");
// Wenn beim Start ein anderes Fenster angezeigt wird (das zweite Fenster), wird es beendet
let list = Services.wm.getEnumerator("navigator:browser");
while(list.hasMoreElements()){ if(list.getNext() != window) return; }
if (window.UCL) {
window.UCL.destroy();
delete window.UCL;
}
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
window.UCL = {
// vFileManager: 'C:\\Programme\\totalcmd\\TOTALCMD.EXE',
vFileManager: '',
USE_UC: "UC" in window,
AGENT_SHEET: Ci.nsIStyleSheetService.AGENT_SHEET,
USER_SHEET : Ci.nsIStyleSheetService.USER_SHEET,
AUTHOR_SHEET: Ci.nsIStyleSheetService.AUTHOR_SHEET,
readCSS : {},
get disabled_list() {
let obj = [];
try {
obj = this.prefs.getCharPref("disabled_list").split("|");
} catch(e) {}
delete this.disabled_list;
return this.disabled_list = obj;
},
get prefs() {
delete this.prefs;
return this.prefs = Services.prefs.getBranch("UserCSSLoader.")
},
get styleSheetServices(){
delete this.styleSheetServices;
return this.styleSheetServices = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
},
get FOLDER() {
let aFolder;
try {
// UserCSSLoader.FOLDER verwenden
let folderPath = this.prefs.getCharPref("FOLDER");
aFolder = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile)
aFolder.initWithPath(folderPath);
} catch (e) {
aFolder = Services.dirsvc.get("UChrm", Ci.nsIFile);
aFolder.appendRelativePath("CSS");
}
if (!aFolder.exists() || !aFolder.isDirectory()) {
aFolder.create(Ci.nsIFile.DIRECTORY_TYPE, 0664);
}
delete this.FOLDER;
return this.FOLDER = aFolder;
},
getFocusedWindow: function() {
let win = document.commandDispatcher.focusedWindow;
if (!win || win == window) win = content;
return win;
},
init: function() {
const cssmenu = $C("menu", {
id: "usercssloader-menu",
label: "CSS",
accesskey: "C",
onclick: "if (event.button == 1) UCL.rebuild()"
});
const menupopup = $C("menupopup", {
id: "usercssloader-menupopup"
});
cssmenu.appendChild(menupopup);
let menu = $C("menu", {
label: "Style Loader Menü",
accesskey: "M"
});
menupopup.appendChild(menu);
let mp = $C("menupopup", { id: "usercssloader-submenupopup" });
menu.appendChild(mp);
mp.appendChild($C("menuitem", {
label: "Styles importieren",
accesskey: "R",
acceltext: "Alt + R",
oncommand: "UCL.rebuild();"
}));
mp.appendChild($C("menuseparator"));
mp.appendChild($C("menuitem", {
label: "CSS Datei erstellen",
accesskey: "D",
oncommand: "UCL.create();"
}));
mp.appendChild($C("menuitem", {
label: "CSS Ordner öffnen",
accesskey: "O",
oncommand: "UCL.openFolder();"
}));
mp.appendChild($C("menuitem", {
label: "userChrome.css bearbeiten",
hidden: false,
oncommand: "UCL.editUserCSS(\'userChrome.css\');"
}));
mp.appendChild($C("menuitem", {
label: "userContent.css bearbeiten",
hidden: false,
oncommand: "UCL.editUserCSS(\'userContent.css\');"
}));
mp.appendChild($C("menuseparator"));
mp.appendChild($C("menuitem", {
label: "Style Test (Chrome)",
id: "usercssloader-test-chrome",
hidden: true,
accesskey: "C",
oncommand: "UCL.styleTest(window);"
}));
mp.appendChild($C("menuitem", {
label: "Style Test (Web)",
id: "usercssloader-test-content",
hidden: true,
accesskey: "W",
oncommand: "UCL.styleTest();"
}));
mp.appendChild($C("menuitem", {
label: "Styles dieser Seite auf userstyles.org finden",
accesskey: "S",
oncommand: "UCL.searchStyle();"
}));
menu = $C("menu", {
label: ".uc.css",
accesskey: "U",
hidden: !UCL.USE_UC
});
menupopup.appendChild(menu);
mp = $C("menupopup", { id: "usercssloader-ucmenupopup" });
menu.appendChild(mp);
mp.appendChild($C("menuitem", {
label: "Importieren(.uc.js)",
oncommand: "UCL.UCrebuild();"
}));
mp.appendChild($C("menuseparator", { id: "usercssloader-ucseparator" }));
CustomizableUI.createWidget({
id: 'usercssloader-menu-item',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
let toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbaritem');
toolbaritem.id = 'usercssloader-menu-item';
toolbaritem.className = 'chromeclass-toolbar-additional';
return toolbaritem;
}
});
$('usercssloader-menu-item').appendChild(cssmenu);
let refNode = $('helpMenu');
refNode.parentNode.insertBefore(cssmenu, refNode.nextSibling);
$("mainKeyset").appendChild($C("key", {
id: "usercssloader-rebuild-key",
oncommand: "UCL.rebuild();",
key: "R",
modifiers: "alt",
}));
this.rebuild();
this.initialized = true;
if (UCL.USE_UC) {
setTimeout(function() {
UCL.UCcreateMenuitem();
}, 1000);
}
window.addEventListener("unload", this, false);
},
uninit: function() {
const dis = [];
for (let x of Object.keys(this.readCSS)) {
if (!this.readCSS[x].enabled)
dis.push(x);
}
this.prefs.setCharPref("disabled_list", dis.join("|"));
window.removeEventListener("unload", this, false);
},
destroy: function() {
var i = document.getElementById("usercssloader-menu");
if (i) i.parentNode.removeChild(i);
var i = document.getElementById("usercssloader-rebuild-key");
if (i) i.parentNode.removeChild(i);
this.uninit();
},
handleEvent: function(event) {
switch(event.type){
case "unload": this.uninit(); break;
}
},
rebuild: function() {
let ext = /\.css$/i;
let not = /\.uc\.css/i;
let files = this.FOLDER.directoryEntries.QueryInterface(Ci.nsISimpleEnumerator);
while (files.hasMoreElements()) {
let file = files.getNext().QueryInterface(Ci.nsIFile);
if (!ext.test(file.leafName) || not.test(file.leafName)) continue;
let CSS = this.loadCSS(file);
CSS.flag = true;
}
for (let leafName of Object.keys(this.readCSS)) {
const CSS = this.readCSS[leafName];
if (!CSS.flag) {
CSS.enabled = false;
delete this.readCSS[leafName];
}
delete CSS.flag;
this.rebuildMenu(leafName);
}
if (this.initialized) {
if (typeof(StatusPanel) !== "undefined")
StatusPanel._label = "Style importiert";
else
XULBrowserWindow.statusTextField.label = "Styles importieren";
}
},
loadCSS: function(aFile) {
var CSS = this.readCSS[aFile.leafName];
if (!CSS) {
CSS = this.readCSS[aFile.leafName] = new CSSEntry(aFile);
if (this.disabled_list.indexOf(CSS.leafName) === -1) {
CSS.enabled = true;
}
} else if (CSS.enabled) {
CSS.enabled = true;
}
return CSS;
},
rebuildMenu: function(aLeafName) {
var CSS = this.readCSS[aLeafName];
var menuitem = document.getElementById("usercssloader-" + aLeafName);
if (!CSS) {
if (menuitem)
menuitem.parentNode.removeChild(menuitem);
return;
}
if (!menuitem) {
menuitem = $C("menuitem", {
label : aLeafName,
id : "usercssloader-" + aLeafName,
class : "usercssloader-item " + (CSS.SHEET == this.AGENT_SHEET? "AGENT_SHEET" : CSS.SHEET == this.AUTHOR_SHEET? "AUTHOR_SHEET": "USER_SHEET"),
type : "checkbox",
autocheck : "false",
oncommand : "UCL.toggle('"+ aLeafName +"');",
onclick : "UCL.itemClick(event);"
});
document.getElementById("usercssloader-menupopup").appendChild(menuitem);
}
menuitem.setAttribute("checked", CSS.enabled);
},
toggle: function(aLeafName) {
var CSS = this.readCSS[aLeafName];
if (!CSS) return;
CSS.enabled = !CSS.enabled;
this.rebuildMenu(aLeafName);
},
itemClick: function(event) {
if (event.button == 0) return;
event.preventDefault();
event.stopPropagation();
let label = event.currentTarget.getAttribute("label");
if (event.button == 1) {
this.toggle(label);
}
else if (event.button == 2) {
closeMenus(event.target);
this.edit(this.getFileFromLeafName(label));
}
},
getFileFromLeafName: function(aLeafName) {
let f = this.FOLDER.clone();
f.QueryInterface(Ci.nsIFile); // use appendRelativePath
f.appendRelativePath(aLeafName);
return f;
},
styleTest: function(aWindow) {
aWindow || (aWindow = this.getFocusedWindow());
new CSSTester(aWindow, function(tester){
if (tester.saved)
UCL.rebuild();
});
},
searchStyle: function() {
let word;
try {
word = gBrowser.currentURI.host;
} catch {
word = gBrowser.currentURI.spec;
}
openWebLinkIn("https://userstyles.org/styles/search/" + word, "tab", {});
},
openFolder:function(){
if (this.vFileManager.length != 0) {
var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
var args=[this.FOLDER.path];
file.initWithPath(this.vFileManager);
process.init(file);
// Verzeichnis mit anderem Dateimanager öffnen
process.run(false, args, args.length);
} else {
// Verzeichnis mit Dateimanager des Systems öffnen
this.FOLDER.launch();
}
},
editUserCSS: function(aLeafName) {
let file = Services.dirsvc.get("UChrm", Ci.nsIFile);
file.appendRelativePath(aLeafName);
this.edit(file);
},
edit: function(aFile) {
var editor = Services.prefs.getCharPref("view_source.editor.path");
if (!editor) return alert("Unter about:config den vorhandenen Schalter:\n view_source.editor.path mit dem Editorpfad ergänzen");
try {
var UI = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
UI.charset = window.navigator.platform.toLowerCase().indexOf("win") >= 0? "Shift_JIS": "UTF-8";
var path = UI.ConvertFromUnicode(aFile.path);
var app = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);
app.initWithPath(editor);
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(app);
process.run(false, [path], 1);
} catch (e) {}
},
create: function(aLeafName) {
if (!aLeafName) aLeafName = prompt("Name des Styles", dateFormat(new Date(), "%Y_%m%d_%H%M%S"));
if (aLeafName) aLeafName = aLeafName.replace(/\s+/g, " ").replace(/[\\/:*?\"<>|]/g, "");
if (!aLeafName || !/\S/.test(aLeafName)) return;
if (!/\.css$/.test(aLeafName)) aLeafName += ".css";
let file = this.getFileFromLeafName(aLeafName);
this.edit(file);
},
UCrebuild: function() {
let re = /^file:.*\.uc\.css(?:\?\d+)?$/i;
let query = "?" + new Date().getTime();
Array.slice(document.styleSheets).forEach(function(css){
if (!re.test(css.href)) return;
if (css.ownerNode) {
css.ownerNode.parentNode.removeChild(css.ownerNode);
}
let pi = document.createProcessingInstruction('xml-stylesheet','type="text/css" href="'+ css.href.replace(/\?.*/, '') + query +'"');
document.insertBefore(pi, document.documentElement);
});
UCL.UCcreateMenuitem();
},
UCcreateMenuitem: function() {
let sep = $("usercssloader-ucseparator");
let popup = sep.parentNode;
if (sep.nextSibling) {
let range = document.createRange();
range.setStartAfter(sep);
range.setEndAfter(popup.lastChild);
range.deleteContents();
range.detach();
}
let re = /^file:.*\.uc\.css(?:\?\d+)?$/i;
Array.slice(document.styleSheets).forEach(function(css) {
if (!re.test(css.href)) return;
let fileURL = decodeURIComponent(css.href).split("?")[0];
let aLeafName = fileURL.split("/").pop();
let m = $C("menuitem", {
label : aLeafName,
tooltiptext : fileURL,
id : "usercssloader-" + aLeafName,
type : "checkbox",
autocheck : "false",
checked : "true",
oncommand : "this.setAttribute('checked', !(this.css.disabled = !this.css.disabled));",
onclick : "UCL.UCItemClick(event);"
});
m.css = css;
popup.appendChild(m);
});
},
UCItemClick: function(event) {
if (event.button == 0) return;
event.preventDefault();
event.stopPropagation();
if (event.button == 1) {
event.target.doCommand();
}
else if (event.button == 2) {
closeMenus(event.target);
let fileURL = event.currentTarget.getAttribute("tooltiptext");
let file = Services.io.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler).getFileFromURLSpec(fileURL);
this.edit(file);
}
},
};
function CSSEntry(aFile) {
this.path = aFile.path;
this.leafName = aFile.leafName;
this.lastModifiedTime = 1;
this.SHEET = /^xul-|\.as\.css$/i.test(this.leafName) ?
Ci.nsIStyleSheetService.AGENT_SHEET:
/\.author\.css$/i.test(this.leafName)?
Ci.nsIStyleSheetService.AUTHOR_SHEET:
Ci.nsIStyleSheetService.USER_SHEET;
}
CSSEntry.prototype = {
sss: Components.classes["@mozilla.org/content/style-sheet-service;1"]
.getService(Components.interfaces.nsIStyleSheetService),
_enabled: false,
get enabled() {
return this._enabled;
},
set enabled(isEnable) {
var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile)
aFile.initWithPath(this.path);
var isExists = aFile.exists(); // Wenn die Datei existiert true
var lastModifiedTime = isExists ? aFile.lastModifiedTime : 0;
var isForced = this.lastModifiedTime != lastModifiedTime; // Wenn es eine Änderung in der Datei gibt true
var fileURL = Services.io.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler).getURLSpecFromActualFile(aFile);
var uri = Services.io.newURI(fileURL, null, null);
if (this.sss.sheetRegistered(uri, this.SHEET)) {
// Wenn diese Datei bereits gelesen wurde
if (!isEnable || !isExists) {
this.sss.unregisterSheet(uri, this.SHEET);
}
else if (isForced) {
// Nach Stornierung erneut einlesen
this.sss.unregisterSheet(uri, this.SHEET);
this.sss.loadAndRegisterSheet(uri, this.SHEET);
}
} else {
// Datei wurde nicht gelesen
if (isEnable && isExists) {
this.sss.loadAndRegisterSheet(uri, this.SHEET);
}
}
if (this.lastModifiedTime !== 1 && isEnable && isForced) {
log(this.leafName + " wurde aktualisiert");
}
this.lastModifiedTime = lastModifiedTime;
return this._enabled = isEnable;
},
};
function CSSTester(aWindow, aCallback) {
this.win = aWindow || window;
this.doc = this.win.document;
this.callback = aCallback;
this.init();
}
CSSTester.prototype = {
sss: Components.classes["@mozilla.org/content/style-sheet-service;1"]
.getService(Components.interfaces.nsIStyleSheetService),
preview_code: "",
saved: false,
init: function() {
this.dialog = openDialog(
"data:text/html;charset=utf8,"+encodeURIComponent('<!DOCTYPE HTML><html lang="de"><head><title>CSSTester</title></head><body></body></html>'),
"",
"width=550,height=400,dialog=no");
this.dialog.addEventListener("load", this, false);
},
destroy: function() {
this.preview_end();
this.dialog.removeEventListener("unload", this, false);
this.previewButton.removeEventListener("click", this, false);
this.saveButton.removeEventListener("click", this, false);
this.closeButton.removeEventListener("click", this, false);
},
handleEvent: function(event) {
switch(event.type) {
case "click":
if (event.button != 0) return;
if (this.previewButton == event.currentTarget) {
this.preview();
}
else if (this.saveButton == event.currentTarget) {
this.save();
}
else if (this.closeButton == event.currentTarget) {
this.dialog.close();
}
break;
case "load":
var doc = this.dialog.document;
doc.body.innerHTML = '\
<style type="text/css">\
:not(input):not(select) { padding: 0px; margin: 0px; }\
table { border-spacing: 0px; }\
body, html, #main, #textarea { width: 100%; height: 100%; }\
#textarea { font-family: monospace; }\
</style>\
<table id="main">\
<tr height="100%">\
<td colspan="4"><textarea id="textarea"></textarea></td>\
</tr>\
<tr height="40">\
<td><input type="button" value="Vorschau" id="Vorschau"/></td>\
<td><input type="button" value="Speichern" id="Speichern"/></td>\
<td width="80%"><span class="log"></span></td>\
<td><input type="button" value="Schließen" id="Schliessen"/></td>\
</tr>\
</table>\
';
this.textbox = doc.querySelector("textarea");
this.previewButton = doc.querySelector('input[value="Vorschau"]');
this.saveButton = doc.querySelector('input[value="Speichern"]');
this.closeButton = doc.querySelector('input[value="Schließen"]');
this.logField = doc.querySelector('.log');
var code = "@namespace url(" + this.doc.documentElement.namespaceURI + ");\n";
code += this.win.location.protocol.indexOf("http") === 0?
"@-moz-document domain(" + this.win.location.host + ") {\n\n\n\n}":
"@-moz-document url(" + this.win.location.href + ") {\n\n\n\n}";
this.textbox.value = code;
this.dialog.addEventListener("unload", this, false);
this.previewButton.addEventListener("click", this, false);
this.saveButton.addEventListener("click", this, false);
this.closeButton.addEventListener("click", this, false);
this.textbox.focus();
let p = this.textbox.value.length - 3;
this.textbox.setSelectionRange(p, p);
break;
case "unload":
this.destroy();
this.callback(this);
break;
}
},
preview: function() {
var code = this.textbox.value;
if (!code || !/\:/.test(code))
return;
code = "data:text/css;charset=utf-8," + encodeURIComponent(this.textbox.value);
if (code == this.preview_code)
return;
this.preview_end();
var uri = Services.io.newURI(code, null, null);
this.sss.loadAndRegisterSheet(uri, Ci.nsIStyleSheetService.AGENT_SHEET);
this.preview_code = code;
this.log("Preview");
},
preview_end: function() {
if (this.preview_code) {
let uri = Services.io.newURI(this.preview_code, null, null);
this.sss.unregisterSheet(uri, Ci.nsIStyleSheetService.AGENT_SHEET);
this.preview_code = "";
}
},
save: function() {
var data = this.textbox.value;
if (!data) return;
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
fp.init(window, "", Ci.nsIFilePicker.modeSave);
fp.appendFilter("CSS Files","*.css");
fp.defaultExtension = "css";
if (window.UCL)
fp.displayDirectory = UCL.FOLDER;
var res = fp.show();
if (res != fp.returnOK && res != fp.returnReplace) return;
var suConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
suConverter.charset = "UTF-8";
data = suConverter.ConvertFromUnicode(data);
var foStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
foStream.init(fp.file, 0x02 | 0x08 | 0x20, 0664, 0);
foStream.write(data, data.length);
foStream.close();
this.saved = true;
},
log: function() {
this.logField.textContent = dateFormat(new Date(), "%H:%M:%S") + ": " + $A(arguments);
}
};
UCL.init();
function $(id) { return document.getElementById(id); }
function $A(arr) { return Array.slice(arr); }
function $C(name, attr) {
var el = document.createXULElement(name);
if (attr) Object.keys(attr).forEach(function(n) { el.setAttribute(n, attr[n]) });
return el;
}
function dateFormat(date, format) {
format = format.replace("%Y", ("000" + date.getFullYear()).substr(-4));
format = format.replace("%m", ("0" + (date.getMonth()+1)).substr(-2));
format = format.replace("%d", ("0" + date.getDay()).substr(-2));
format = format.replace("%H", ("0" + date.getHours()).substr(-2));
format = format.replace("%M", ("0" + date.getMinutes()).substr(-2));
format = format.replace("%S", ("0" + date.getSeconds()).substr(-2));
return format;
}
function log() { Application.console.log(Array.slice(arguments)); }
})();
Alles anzeigen
Wie man sieht unterstützt sie jetzt auch Author_Sheet:
AGENT_SHEET: Ci.nsIStyleSheetService.AGENT_SHEET,
USER_SHEET : Ci.nsIStyleSheetService.USER_SHEET,
AUTHOR_SHEET: Ci.nsIStyleSheetService.AUTHOR_SHEET,
Quelle kann ich keine Angeben, da das Original Script von Griever
nicht mehr geht. Aborix und andere Leute aus Asien haben es
dann wieder laufffähig gemacht. Die aktuelle Änderung habe ich in
einem Script aus den asiatischen Tiefen gefunden, und dann in unsere
Version übertragen.
Mfg.
Endor
Hallo Mira_Belle
Wenn überhaupt, dann kann Dir nur aborix, unser Script Genie, helfen.
Mal abwarten.
Mfg.
Endor
Nur als Info, von diesem Script gibt es eine neuere Version:
1.1
// ==UserScript==
// @name dav_LinkifiesLocationBar
// @version 1.1
// @description dav_LinkifiesLocationBar
// @shutdown dav_LinkifiesLocationBar.globalShutdown();
// ==/UserScript==
/*
Idea based on
https://addons.mozilla.org/en-US/firefox/addon/locationbar%C2%B2/
https://github.com/simonlindholm/locationbar2
*/
setTimeout(function() {
if (location.href != 'chrome://browser/content/browser.xhtml') return;
const colorizeExtensionFile = false,
selectUrlbarText = true,
pathnameArrow = true,
fontMonospace = true,
usePunycode = true;
//https://stackoverflow.com/questions/183485/converting-punycode-with-dash-character-to-unicode/301287#301287
var punycode=new function(){this.utf16={decode:function(r){for(var o,e,t=[],n=0,f=r.length;n<f;){if(55296==(63488&(o=r.charCodeAt(n++)))){if(e=r.charCodeAt(n++),55296!=(64512&o)||56320!=(64512&e))throw new RangeError("UTF-16(decode): Illegal UTF-16 sequence");o=((1023&o)<<10)+(1023&e)+65536}t.push(o)}return t},encode:function(r){for(var o,e=[],t=0,n=r.length;t<n;){if(55296==(63488&(o=r[t++])))throw new RangeError("UTF-16(encode): Illegal UTF-16 value");o>65535&&(o-=65536,e.push(String.fromCharCode(o>>>10&1023|55296)),o=56320|1023&o),e.push(String.fromCharCode(o))}return e.join("")}};var r=36,o=700,e=1,t=26,n=38,f=2147483647;function h(r,o){return r+22+75*(r<26)-((0!=o)<<5)}function a(f,h,a){var i;for(f=a?Math.floor(f/o):f>>1,f+=Math.floor(f/h),i=0;f>(r-e)*t>>1;i+=r)f=Math.floor(f/(r-e));return Math.floor(i+(r-e+1)*f/(f+n))}this.decode=function(o,n){var h,i,u,c,d,l,p,g,s,C,v,w,y,A,E=[],M=[],R=o.length;for(h=128,u=0,c=72,(d=o.lastIndexOf("-"))<0&&(d=0),l=0;l<d;++l){if(n&&(M[E.length]=o.charCodeAt(l)-65<26),o.charCodeAt(l)>=128)throw new RangeError("Illegal input >= 0x80");E.push(o.charCodeAt(l))}for(p=d>0?d+1:0;p<R;){for(g=u,s=1,C=r;;C+=r){if(p>=R)throw RangeError("punycode_bad_input(1)");if((v=(A=o.charCodeAt(p++))-48<10?A-22:A-65<26?A-65:A-97<26?A-97:r)>=r)throw RangeError("punycode_bad_input(2)");if(v>Math.floor((f-u)/s))throw RangeError("punycode_overflow(1)");if(u+=v*s,v<(w=C<=c?e:C>=c+t?t:C-c))break;if(s>Math.floor(f/(r-w)))throw RangeError("punycode_overflow(2)");s*=r-w}if(c=a(u-g,i=E.length+1,0===g),Math.floor(u/i)>f-h)throw RangeError("punycode_overflow(3)");h+=Math.floor(u/i),u%=i,n&&M.splice(u,0,o.charCodeAt(p-1)-65<26),E.splice(u,0,h),u++}if(n)for(u=0,y=E.length;u<y;u++)M[u]&&(E[u]=String.fromCharCode(E[u]).toUpperCase().charCodeAt(0));return this.utf16.encode(E)},this.encode=function(o,n){var i,u,c,d,l,p,g,s,C,v,w,y;n&&(y=this.utf16.decode(o));var A=(o=this.utf16.decode(o.toLowerCase())).length;if(n)for(p=0;p<A;p++)y[p]=o[p]!=y[p];var E,M,R=[];for(i=128,u=0,l=72,p=0;p<A;++p)o[p]<128&&R.push(String.fromCharCode(y?(E=o[p],M=y[p],(E-=(E-97<26)<<5)+((!M&&E-65<26)<<5)):o[p]));for(c=d=R.length,d>0&&R.push("-");c<A;){for(g=f,p=0;p<A;++p)(w=o[p])>=i&&w<g&&(g=w);if(g-i>Math.floor((f-u)/(c+1)))throw RangeError("punycode_overflow (1)");for(u+=(g-i)*(c+1),i=g,p=0;p<A;++p){if((w=o[p])<i&&++u>f)return Error("punycode_overflow(2)");if(w==i){for(s=u,C=r;!(s<(v=C<=l?e:C>=l+t?t:C-l));C+=r)R.push(String.fromCharCode(h(v+(s-v)%(r-v),0))),s=Math.floor((s-v)/(r-v));R.push(String.fromCharCode(h(s,n&&y[p]?1:0))),l=a(u,c+1,c==d),u=0,++c}}++u,++i}return R.join("")},this.ToASCII=function(r){for(var o=r.split("."),e=[],t=0;t<o.length;++t){var n=o[t];e.push(n.match(/[^A-Za-z0-9-]/)?"xn--"+punycode.encode(n):n)}return e.join(".")},this.toUnicode=function(r){for(var o=r.split("."),e=[],t=0;t<o.length;++t){var n=o[t];e.push(n.match(/^xn--/)?punycode.decode(n.slice(4)):n)}return e.join(".")}};
function getWindow(){
return window;
}
function getMostRecentWindow(){
var win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");
return win;
}
var localWindow = getWindow();
localWindow.dav_LinkifiesLocationBar = {};
var styleBase = `
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.claseLocationBar{
display: block;
position: absolute;
height: 24px;
width: 100%;
line-height: 24px;
white-space:nowrap;
overflow:hidden;
}
.claseLocationBar span{
position: relative;
margin: 0 1px;
display: inline-block;
}
.claseLocationBar span:hover{
text-decoration: underline;
cursor: pointer;
}
.claseLocationBar .label_pathname {
margin-inline: unset !important;
}
locationBarTag{
display: inline;
}
/*************************************
*************** COLORS ***************
*************************************/
.claseLocationBar span.protocol{
font-weight: normal;
color: #777777;
margin-right: -1px;
}
.claseLocationBar .subdomain {
font-weight: bold;
color: #C68007;
}
.claseLocationBar span.hostname{
font-weight: bold;
color: red;
}
.claseLocationBar span.port{
color: #5F58A3;
}
.claseLocationBar span.pathname{
color: black;
}
.claseLocationBar span.hash{
color: #1054C9;
margin-left: -1px;
}
.claseLocationBar span.search{
color: #03AA03;
margin-left: -1px;
}
.claseLocationBar .extension{
color: rgb(96,86,143);
}
`;
var style_fontMonospace = !fontMonospace?"":`
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.urlbar-input-box[dav_LinkifiesLocationBar]{
font-family: monospace ;
margin-top: 4px;
}
.claseLocationBar{
margin-top: -4px;
line-height: 28px;
}
.claseLocationBar .pathname:after{
top: 10px;
}
.claseLocationBar span.port{
margin-left: -1px;
}
.claseLocationBar .subdomain {
margin-right: -1px;
}
.claseLocationBar span.hostname{
margin-right: 1px;
}
`;
var style_pathnameArrow = !pathnameArrow?"":`
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
.claseLocationBar span.pathname{
padding-left:9px;
margin: 0 2px;
}
.claseLocationBar .pathname:before{
content:' ';
display: block;
position: absolute;
border-style: solid;
border-width: 4px 4px 4px 7px;
border-color: transparent transparent transparent #6fa880;
border-color: transparent transparent transparent #5ba8bf;
top: 10px;
left: 0px;
}
.claseLocationBar .label_pathname{
display: none;
}
`;
var stylexul = `
.urlbar-input-box[dav_LinkifiesLocationBar] #urlbar-input:focus ~ .claseLocationBar{
display: none !important;
}
.urlbar-input-box[dav_LinkifiesLocationBar] #urlbar-input:focus{
opacity: 1;
}
.urlbar-input-box[dav_LinkifiesLocationBar] #urlbar-input{
opacity: 0;
}
`;
/*
AGENT_SHEET: 0
USER_SHEET: 1
AUTHOR_SHEET: 2
*/
var CSS_Loader = {
sss: Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService),
load: function(cssCode) {
this.unload(cssCode);
var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent(cssCode), null, null);
this.sss.loadAndRegisterSheet(uri, this.sss.AGENT_SHEET);
},
unload: function(cssCode) {
var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent(cssCode), null, null);
if (this.sss.sheetRegistered(uri,this.sss.AGENT_SHEET))
{
this.sss.unregisterSheet(uri,this.sss.AGENT_SHEET);
}
}
}
const CLIKS = {
left: 0,
middle: 1,
right: 2
}
function extend() {
var copy, target = {};
for (var i = 0, l = arguments.length; i < l; i++) {
var options = arguments[i];
for (var name in options) {
copy = options[name];
if (copy !== undefined) {
target[name] = copy;
}
}
}
return target;
}
var styleString = (style) => {
return Object.keys(style).reduce((prev, curr) => {
return `${prev += curr.split(/(?=[A-Z])/).join('-').toLowerCase()}:${style[curr]};`
}, '');
};
function createElement(elto) {
elto = extend({
attrArray: {},
evtListener: [],
estilos: {}
}, elto);
var node = getWindow().document.createXULElement(elto.type);
Object.keys(elto.attrArray).forEach(key => {
if(key == "innerHTML"){
node.innerHTML = encodeHTML(elto.attrArray[key]);
}
else {
node.setAttribute(key, elto.attrArray[key]);
}
});
elto.evtListener.forEach(evt => {
node.addEventListener(evt.type, evt.funcion, false);
});
let estilo = styleString(elto.estilos);
if (estilo) {
node.setAttribute("style", estilo);
}
return node;
}
function encodeHTML(text) {
return decodeURI(text)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
function appendPart(text, clase) {
if (!text) return;
if(clase == "pathname")
{
let sp = createElement({
type: "label",
attrArray: {
class: "label_pathname",
innerHTML:"/"
}
});
divLocationBar.appendChild(sp);
}
let sp = createElement({
type: "span",
attrArray: {
class: clase,
innerHTML:text
},
evtListener: [{
type: "click",
funcion: clickPart
}]
});
divLocationBar.appendChild(sp);
sp.setAttribute("href", divLocationBar.textContent);
return sp;
}
function clickPart(evt) {
if (evt.button == CLIKS.right) return;
let target = evt.target;
if (target.className != "protocol") {
let href = target.getAttribute("href");
var where = evt.button == CLIKS.middle || evt.ctrlKey ? "tab" : "current";
evt.view.openLinkIn(href, where, {
allowThirdPartyFixup: true,
targetBrowser: gBrowser.selectedBrowser,
indicateErrorPageLoad: true,
allowPinnedTabHostChange: true,
disallowInheritPrincipal: true,
allowPopups: false,
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()
});
evt.stopPropagation();
}
}
function borraPrevio() {
var divPrevio = localWindow.document.querySelector(".claseLocationBar");
if (divPrevio) {
divPrevio.parentNode.removeChild(divPrevio)
}
}
var debounce = (fn, ms = 0) => {
let timeoutId;
return function(...args) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => fn.apply(this, args), ms);
};
};
var pintaLocation = debounce(pintaLocation_, 50);
function pintaLocation_() {
divLocationBar.innerHTML = '';
var urlBarInput = getWindow().document.querySelector("#urlbar-input").value;
var urlGBrowser = gBrowser.currentURI.displaySpec;
if(urlGBrowser.startsWith("about")){
divLocationBar.innerHTML = encodeHTML(urlBarInput);
return;
}
var url = urlGBrowser.indexOf(urlBarInput) != -1 ? urlGBrowser : urlBarInput;
try {
var { protocol, hostname, port, pathname, hash, search } = new URL(url);
} catch (e) {
divLocationBar.innerHTML = encodeHTML(urlBarInput);
return;
}
if(usePunycode){
hostname = punycode.toUnicode(hostname);
}
var partido = hostname.split(".");
var subdomain;
if(partido.length > 2 && !partido.every( v => v == v-0 ))//chequeamos que no sean todos numeros, porque entonces es una IP
{
subdomain = partido.splice(0, partido.length-2).join(".");
hostname= partido.join(".");
}
appendPart(protocol + "//", "protocol");
if (subdomain) {
appendPart(subdomain+".", "subdomain");
}
appendPart(hostname, "hostname");
if (port) {
appendPart(":" + port, "port");
}
var arrayPathname = pathname.split("/");
var arrayPathnameLength = arrayPathname.length;
arrayPathname.forEach((elto, index) => {
if (elto) {
let sp = appendPart(elto, "pathname");
if(colorizeExtensionFile && index == arrayPathnameLength-1)
{
let arrayDot = elto.split(".");
if(arrayDot.length > 1)
{
let extension = arrayDot.pop();
sp.innerHTML = "";
sp.appendChild(createElement({
type: "locationBarTag",
attrArray: {
href:sp.getAttribute("href"),
innerHTML: arrayDot.join(".")
}
}));
sp.appendChild(createElement({
type: "locationBarTag",
attrArray: {
class: "extension",
href:sp.getAttribute("href"),
innerHTML: "."+extension
}
}));
}
}
}
});
appendPart(search, "search");
appendPart(hash, "hash");
}
/******************* INIT ***************************/
var urlbarInput = getWindow().document.querySelector("#urlbar-input");
var timeMouseMove = -1;
function hideDivLocatonBar(){
urlbarInput.focus();
}
var divLocationBar = createElement({
type: "div",
attrArray: {
class: "claseLocationBar"
},
evtListener: [{
type: "click",
funcion: function(evt) {
hideDivLocatonBar()
if(selectUrlbarText){
urlbarInput.select();
}
}
},{
type: "mouseenter",
funcion: function(evt) {
//esto es el ratón entrando por encima
if(evt.screenY == divLocationBar.screenY)
{
timeMouseMove = setTimeout(hideDivLocatonBar, 500);
}
}
},{
type: "mouseleave",
funcion: function(evt) {
clearTimeout(timeMouseMove);
}
}]
});
borraPrevio();
urlbarInput.parentNode.appendChild(divLocationBar);
urlbarInput.parentNode.setAttribute("dav_LinkifiesLocationBar", true);
urlbarInput.addEventListener("blur", pintaLocation);
pintaLocation();
var last_displaySpec = "";
var intevalID = setInterval(function(){
//console.log("setInterval", intevalID, localWindow == window, localWindow == getMostRecentWindow());
let actual_displaySpec = gBrowser.currentURI.displaySpec;
if(last_displaySpec != actual_displaySpec){
last_displaySpec = actual_displaySpec;
pintaLocation();
}
}, 50);
CSS_Loader.load(styleBase);
CSS_Loader.load(style_pathnameArrow);
CSS_Loader.load(style_fontMonospace);
CSS_Loader.load(stylexul);
/******************* END INIT ***************************/
dav_LinkifiesLocationBar.shutdown = function(win){
borraPrevio();
clearTimeout(intevalID);
urlbarInput.parentNode.removeAttribute("dav_LinkifiesLocationBar");
CSS_Loader.unload(styleBase);
CSS_Loader.unload(style_pathnameArrow);
CSS_Loader.unload(style_fontMonospace);
CSS_Loader.unload(stylexul);
urlbarInput.removeEventListener("blur", pintaLocation);
}
dav_LinkifiesLocationBar.globalShutdown = function(){
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var ws = wm.getEnumerator(null);
while(ws.hasMoreElements()) {
var w = ws.getNext();
w.dav_LinkifiesLocationBar.shutdown(w);
}
}
}, 10);
Alles anzeigen
Mfg.
Endor