Christiane Hörbiger ist tot.
Schauspielerin Christiane Hörbiger ist tot
Die 84-Jährige ist am Mittwoch in Wien gestorben, wie ein Freund der Familie bestätigt.
www.sueddeutsche.de
R.I.P.
Mfg.
Endor
Christiane Hörbiger ist tot.
R.I.P.
Mfg.
Endor
Wenn mich nicht alles täuscht, verhindert der Browser aus Sicherheitsgründen, dass
sich bei einem klick gleich mehrere neue Tabs mit Links öffnen. Da das nach einem Virus aussieht.
Habe ich mal irgendwo gelesen. Finde die Seite im Moment leider nicht mehr.
Hätte eine Älternative:
Dieses Script hier öffnet je nach klick, also linksklick, rechtsklick, Mittelklick, usw.
bis zu 9 verschiedene Adressen. Jeweils in einem neuen Tab.
// Customhomebutton.uc.js
// Firefox 107 kompatibel
// https://www.reddit.com/r/FirefoxCSS/comments/9klrpp/bookmark_buttons/
// Linksklick: Camp-Firefox Forum, Mittelklick: Bild.de, Rechtsklick: Google News, Umschalt + Linksklick: Computerbase Forum,
// Strg + Linksklick: Thunderbird Mail Forum, Umschalttaste + Mitteklick: Stern.de, Strg + Mitteklick: Spiegel.de,
// Strg + Rechtsklick: ZDF.de, Umschalttaste + Rechtsklick: ARD.de
// In Zeile 31 kann der Tooltip-Text den eigenen Wünschen entsprechend geändert werden. (\n fügt einen Zeilenumbruch an der entsprechenden Stelle ein.)
// Text muss nur geändert werden, wenn man andere Internetadressen, URls, als die vorgegebenen, verwenden will.
(function()
{
if(location != 'chrome://browser/content/browser.xhtml')
return;
try
{
CustomizableUI.createWidget
(
{
id: 'click-button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument)
{
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
toolbaritem.onclick = event => onClick(event);
var props =
{
id: 'click-button',
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
label: 'Benutzerdefinierte Home-Schaltfläche',
tooltiptext: 'Linksklick: camp-firefox.de/Forum\nMittelklick: Bild.de\nRechtsklick: Google News\nStrg + Linksklick: Thunderbird Forum\nStrg + Mittelklick: Spiegel.de\nStrg + Rechtsklick: ZDF.de\nUmschalttaste + Linksklick: Computerbase Forum\nUmschalttaste + Mittelklick: Stern.de\nUmschalttaste + Rechtsklick: ARD.de',
style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAEHUlEQVR42mL8//8/Ay0AQAARja7OiPS4NDM2lFj1AAHEQkjBqlBtNgNfhx5Zq4B0BkYm5nsrRbzPrNmVFrb66q8TvcHBvDL6nCB1317f5TfNWTgVpg8ggBjxGXqsydJQRtdujqSBgxHjlydAc1kZGPhVGF5cPXL9w71LCZyqTiWKzsmhf//8ZHh9+cAbSSMPUZhegADC6eJLPY6FUgZ2Nbx8vEJ/H+5j+PHj779//xj+8wg9ZRaTltZk5+be9/bZ7es/Pr5k+P39M8Ovb+9QHAkQQBgG7yjUFpKXF5kvo23ow/j1JtOvL38ZPvzgYeDUDmdi5uBleHFhOYOI4AsGbjZebj5NNZO/D3Zc+8Emr/Xz81sUcwACCMWWi72OcQL87BP4OH8J/v/xjuHPfzaG74I2DMJ2+QzM7FxgNf/+/mZ4c3QOA/f3qwwcnKwMTHyyDIzcMm/u3bz3XTuqVw5mFkAAMUIiiIFZWUmkR0KSJ5f17wdmhv//GL6yKTPwWFUwCOr5YQ2qz/dPMnw9O5uBl/k1AyMrN8NfZqF/zx/eW3Ll8P6ksNUMfwECiHFfqpw2B/Of6QJsv22ZWf4wMLL8Z/in4Mwg7lXLwMYvhjfF/Pv9g+Hd0ekM7K/2MLCzswAt4GN48+7H+fdvP2QABBBjqYnMaVVeThMmlr8MMrJ8f3RiClmk7KNJSuPvr2xjuLW55ue3T6/YGZiZGS4//n8fIIBAQaEFxOC0OG/6xJmhoQHG5GSgWfOWnC4uq86Ecv8CBBAoVVyDSUrKKUlwC0oTNOT/729A/J3hPzAiGRmZGBiYWBjUVFXEgVJnYWoAAggluX3++Prh90+vUEy+evYYAxsHFyIZ/f3B8OvrJwZtAyOgDWBrgIIMDMz/fqFYDhBAKAZzcPIJsnMLoij48eUzg5wUciTyMNx48RgYlECt4ALsPzhxcXBy8iDrAwggFIN//vj2+fePr6gx//UVA+OTF6hh8e0bOEUgDGZiYGVm/oOsBCCAUAxmZGT8z8zKhhD4+4uB8etLBsYft1AN/inPwPj/LzTA/4PMZWBlY2dHVgIQQCgGs///JvrvwyNIvgFmEpDBDF9eMDB+PopqMA8PMOL+QF37H2gJCwMrKwszshKAAEIx+Nevn0ygGAdrgFYAP37/ZXjy8R+qg9n/gnIHwsVAI1lY2ZiQ1QAEEIrBXz99Yv//99c/aEQD9fxj/PyHheHNVzGUMoXjLwcDEwc/MJeyMTAyswNpDgbmN3dZt03K5fPKm/wJpAYggFAMvnH98pmV39+Jg5Lm//+gEGdkfPrksyArqwYTxCoI+PPs078vy5Z+QNb79v37359Ypb/A+AABhOKSzVNKgYmTQQJv+fCf4SOwvH+FLv7nF8O/wLzuuzA+QAAx0qoyBQgwAJQfbf9bqPxfAAAAAElFTkSuQmCC)'
};
for(var p in props)
toolbaritem.setAttribute(p, props[p]);
return toolbaritem;
}
}
);
}
catch(e) {};
function onClick(event)
{
window.oncontextmenu = function () /*context menu = right-click*/
{
if (event.shiftKey)
return true;
else
{
openTrustedLinkIn('https://www.camp-firefox.de/forum/',"tab");
return false;
}
}
if(event.button == 0) /*left click*/
{
if (event.shiftKey)
openTrustedLinkIn('https://www.computerbase.de/forum/',"tab");
else if (event.ctrlKey)
openTrustedLinkIn('https://www.camp-firefox.de/forum',"tab");
else
openTrustedLinkIn('https://www.thunderbird-mail.de/forum/',"tab");
}
else if(event.button == 1) /*middle click*/
{
if (event.shiftKey)
openTrustedLinkIn('https://www.stern.de/',"tab");
else if (event.ctrlKey)
openTrustedLinkIn('https://www.spiegel.de/',"tab");
else
openTrustedLinkIn('https://www.bild.de/',"tab");
}
else if(event.button == 2) /*right click*/
{
if (event.shiftKey)
openTrustedLinkIn('https://www.ard.de/',"tab");
else if (event.ctrlKey)
openTrustedLinkIn('https://www.zdf.de/',"tab");
else
openTrustedLinkIn('https://news.google.com/',"tab");
return false;
}
/*alert("Right mouse button")*/
}
}
)
();
Alles anzeigen
Vielleicht hilft Dir das weiter.
Mfg.
Endor
Hallo zusammen.
Ich kann das: Skript für Add-ons Update hier auch bestätigen.
Vielleicht kann aborix sich das mal anschauen.
Wenn dann kann nur er es wieder richtig zum Laufen bringen.
Mfg.
Endor
Hallo zusammen.
Nur als Info für Leute die das Script expandsidebar.uc.js verwenden.
Der Autor hat neue Versionen dafür veröffentlicht:
Für Firefox 106
// ==UserScript==
// @name expandsidebar_fx58.uc.js
// @description Seitenleiste automatisches Öffnen und Schließen
// @namespace http://forums.mozillazine.org/viewtopic.php?p=2592073#2592073
// @include main
// @compatibility Firefox 106
// @author Alice0775
// @Note Seitenleistenposition bei _SIDEBARPOSITION wählbar (links oder rechts)
// @Note Keyconfig und Mousegesten usw. SidebarUI.toggle (entsprechender Code);
// @Note
// @version 2022/09/14 11:00 box width:auto
// @version 2022/08/26 Bug 1695435 - Remove @@hasInstance for IDL interfaces in chrome context
// @version 2021/11/14 21:00 css
// @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(
doc.defaultView.Node.isInstance(childElem)
/*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-checkbox {
border: 1px solid currentColor !important;
width: 16px !important;
height: 16px !important;
overflow-x: hidden !important;
}
#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;
left: 4px;
}
:root:not([lwtheme-image]) #sidebar-box {
background-color: var(--toolbar-bgcolor);
}
:root[lwtheme-image] #sidebar-box {
background-color: var(--tabpanel-background-color);
}
#sidebar-box #sidebar-header
{
width :100%;
}
#sidebar-box #sidebar
{
height: calc(100vh - 230px);
border-left:3px solid var(--toolbar-bgcolor);
border-right:3px solid var(--toolbar-bgcolor);
border-bottom:3px solid var(--toolbar-bgcolor);
}
#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 var(--sidebar-border-color);
border-bottom: 1px solid var(--sidebar-border-color);
}
#sidebar-box:-moz-locale-dir(rtl) {
border-left: 1px solid var(--sidebar-border-color);
}
#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 var(--sidebar-border-color);
border-top: 1px solid var(--sidebar-border-color);
}
#sidebar-box #sidebarpopuppanel-bottom {
background-color: var(--toolbar-bgcolor);
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._sidebar.style.removeProperty('max-width');
this._sidebar.style.removeProperty('min-width');
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) {
/* this._loadKeepItSizes();
if (this._resizeTimer)
clearTimeout(this._resizeTimer);
this._resizeTimer = setTimeout(() => {this._loadKeepItSizes();},250)
*/
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.getBoundingClientRect().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(){
return SidebarUI._box.getAttribute("sidebarcommand");
},
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", "");
this._sidebar.style.setProperty("left", x - 1 + "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_box.style.setProperty('width', this.sizes[index + 1] + "px", "");
this._sidebar.style.setProperty('width', this.sizes[index + 1] - 1 + "px", "");
} else
this._sidebar_box.style.setProperty('width', this.sizes[index + 1] + "px", "");
return;
}
}
if (this._sidebar_box.getBoundingClientRect().width == 0) {
if (this._FLOATING_SIDEBAR) {
this._sidebar_box.style.setProperty('width', this._defaultWidth + "px", "");
this._sidebar.style.setProperty('width', this._defaultWidth - 1 + "px", "");
} else {
this._sidebar_box.style.setProperty('width', this._defaultWidth + "px", "");
}
}
},
_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);
//Flag, ob mouseout sofort nach dem Öffnen als true verarbeitet werden soll oder nicht
this._opend = true;
if(this._mouseoutTimer)
clearTimeout(this._mouseoutTimer);
//Auf „false“ setzen, damit mouseout nach 200 ms nach dem Öffnen verarbeitet werden kann
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.getBoundingClientRect().width == 0) {
sidebar_box.style.setProperty('width', this._defaultWidth + "px", "");//Seitenleiste Standardbreite
this._sidebar.style.setProperty('width', this._defaultWidth - 1 + "px", "");//Seitenleiste Standardbreite
}
//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);
this.SM_Observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
switch (mutation.attributeName) {
case "style":
let style = this.sidebarbox.getAttribute("style");
if (style.includes("width: 0px")) {
ucjs_expand_sidebar._loadKeepItSizes();
}
break;
}
}.bind(this));
}.bind(this));
// pass in the target node, as well as the observer options
this.SM_Observer.observe(document.getElementById("sidebar-box"),
{attribute: true, attributeFilter: ["style"]});
},
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.sidebarbox.getBoundingClientRect().height),
width:parseInt(this.sidebarbox.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.sidebarbox.getBoundingClientRect().width);
},
mousemove: function(event) {
if (this.drag) {
var newValue;
var h = this.sidebarbox.getBoundingClientRect().height;
newValue = this.size.height + event.screenY - this.offset.y;
if (newValue <= screen.height - 50 && newValue >= 10) {
h = newValue;
}
var w = this.sidebarbox.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.sidebarbox.screenY <= screen.height - 50 && h >= 10) {
// this.sidebar.style.setProperty('height', h + "px", "");
}
if (w && 0<=w ) {
this.sidebar.style.setProperty('width', w - 1 + "px", "");
this.sidebarbox.style.setProperty('width', w + "px", "");
}
}
};
sidebarpopuppanelResize.init();
Alles anzeigen
Für Firefox 107+
// ==UserScript==
// @name expandsidebar_fx58.uc.js
// @description Seitenleiste automatisches Öffnen und Schließen
// @namespace http://forums.mozillazine.org/viewtopic.php?p=2592073#2592073
// @include main
// @compatibility Firefox 107
// @author Alice0775
// @Note Seitenleistenposition bei _SIDEBARPOSITION wählbar (links oder rechts)
// @Note Keyconfig und Mousegesten usw. SidebarUI.toggle (entsprechender Code);
// @Note
// @version 2022/10/14 20:00 sidebar width:100%
// @version 2022/09/30 20:00 Bug 1792748
// @version 2022/09/14 11:00 box width:auto
// @version 2022/08/26 Bug 1695435 - Remove @@hasInstance for IDL interfaces in chrome context
// @version 2021/11/14 21:00 css
// @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(
doc.defaultView.Node.isInstance(childElem)
/*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-checkbox {
border: 1px solid currentColor !important;
width: 16px !important;
height: 16px !important;
overflow-x: hidden !important;
}
#sidebar-splitter
{
-moz-box-align: center;
-moz-box-pack: center;
cursor: ew-resize;
border-width: 0;
border-style: solid;
width: 2px;
max-width: 2px;
min-width: 0px;
background-color: transparent;
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;
left: 4px;
min-width: unset;
max-width: unset;
}
:root:not([lwtheme-image]) #sidebar-box {
background-color: var(--toolbar-bgcolor);
}
:root[lwtheme-image] #sidebar-box {
background-color: var(--tabpanel-background-color);
}
#sidebar-box #sidebar-header
{
width :100%;
}
#sidebar-box #sidebar
{
height: calc(100vh - 230px);
border-left:3px solid var(--toolbar-bgcolor);
border-right:3px solid var(--toolbar-bgcolor);
border-bottom:3px solid var(--toolbar-bgcolor);
}
#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 var(--sidebar-border-color);
border-bottom: 1px solid var(--sidebar-border-color);
}
#sidebar-box:-moz-locale-dir(rtl) {
border-left: 1px solid var(--sidebar-border-color);
}
#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 var(--sidebar-border-color);
border-top: 1px solid var(--sidebar-border-color);
}
#sidebar-box #sidebarpopuppanel-bottom {
background-color: var(--toolbar-bgcolor);
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._sidebar.style.removeProperty('max-width');
this._sidebar.style.removeProperty('min-width');
this._sidebar.style.setProperty('width', '100%', '');
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) {
/* this._loadKeepItSizes();
if (this._resizeTimer)
clearTimeout(this._resizeTimer);
this._resizeTimer = setTimeout(() => {this._loadKeepItSizes();},250)
*/
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.getBoundingClientRect().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(){
return SidebarUI._box.getAttribute("sidebarcommand");
},
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", "");
this._sidebar.style.setProperty("left", x - 1 + "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_box.style.setProperty('width', this.sizes[index + 1] + "px", "");
//this._sidebar.style.setProperty('width', this.sizes[index + 1] - 1 + "px", "");
} else
this._sidebar_box.style.setProperty('width', this.sizes[index + 1] + "px", "");
return;
}
}
if (this._sidebar_box.getBoundingClientRect().width == 0) {
if (this._FLOATING_SIDEBAR) {
this._sidebar_box.style.setProperty('width', this._defaultWidth + "px", "");
//this._sidebar.style.setProperty('width', this._defaultWidth - 1 + "px", "");
} else {
this._sidebar_box.style.setProperty('width', this._defaultWidth + "px", "");
}
}
},
_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);
//Flag, ob mouseout sofort nach dem Öffnen als true verarbeitet werden soll oder nicht
this._opend = true;
if(this._mouseoutTimer)
clearTimeout(this._mouseoutTimer);
//Auf „false“ setzen, damit mouseout nach 200 ms nach dem Öffnen verarbeitet werden kann
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.getBoundingClientRect().width == 0) {
sidebar_box.style.setProperty('width', this._defaultWidth + "px", "");//Seitenleiste Standardbreite
//this._sidebar.style.setProperty('width', this._defaultWidth - 1 + "px", "");//Seitenleiste Standardbreite
}
//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-Koordinaten 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);
this.SM_Observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
switch (mutation.attributeName) {
case "style":
let style = this.sidebarbox.getAttribute("style");
if (style.includes("width: 0px")) {
ucjs_expand_sidebar._loadKeepItSizes();
}
break;
}
}.bind(this));
}.bind(this));
// pass in the target node, as well as the observer options
this.SM_Observer.observe(document.getElementById("sidebar-box"),
{attribute: true, attributeFilter: ["style"]});
},
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.checked = ucjs_expand_sidebar._checkbox.checked;
ucjs_expand_sidebar._checkbox.checked = true;
this.drag = true;
this.size = {height:parseInt(this.sidebarbox.getBoundingClientRect().height),
width:parseInt(this.sidebarbox.getBoundingClientRect().width)};
this.offset = {x: event.screenX, y: event.screenY};
window.addEventListener("mouseup", this, true);
window.addEventListener("mousemove", this, true);
},
mouseup: function(event) {
ucjs_expand_sidebar._checkbox.checked = this.checked;
this.drag = false;
window.removeEventListener("mousemove", this, true);
window.removeEventListener("mouseup", this, true);
ucjs_expand_sidebar._saveKeepItSizes(this.sidebarcommand, this.sidebarbox.getBoundingClientRect().width);
},
mousemove: function(event) {
if (this.drag) {
var newValue;
var h = this.size.height;
newValue = h + event.screenY - this.offset.y;
if (newValue <= h - 50) {
h = newValue;
}
var w = this.size.width;
if (this.isRTL)
newValue = w - (event.screenX - this.offset.x);
else
newValue = w + event.screenX - this.offset.x;
if (newValue <= screen.width) {
w = newValue;
}
this.setSize(h, w);
}
},
setSize: function(h, w){
if (h && h + this.sidebarbox.screenY <= screen.height - 50 && h >= 10) {
// this.sidebar.style.setProperty('height', h + "px", "");
}
if (w && 0<=w ) {
this.sidebar.style.setProperty('width', w - 1 + "px", "");
this.sidebarbox.style.setProperty('width', w + "px", "");
}
}
};
sidebarpopuppanelResize.init();
Alles anzeigen
Mfg.
Endor
Wenn ich mich nicht irre, hast Du gesagt beim hovern wird der ausgewählte Tab
breiter.
Das liegt daran:
/* Aktiver Tab breiter */
.tabbrowser-tab:not([pinned]):not([selected]) {
min-width: 200px !important;
max-width: 200px !important;
}
.tabbrowser-tab:not([pinned])[selected] {
min-width: 256px !important;
max-width: 256px !important;
}
Du hast im unteren Absatz diesbezüglich eine größere Breite
vergeben als sonst. Oben 200px unten 256px. Daher wird er breiter.
Wenn das nicht erwünscht sein sollte, dann bei allen den gleichen Wert verwenden.
Mfg.
Endor
Hallo Boersenfeger.
Für Tabs mittig teste bitte mal:
ersetzte in deinem CSS Code
/* Tabs in Tableiste mittig */
scrollbox:not(#PlacesToolbarItems) {
-moz-box-pack: center !important;
}
durch:
/* Tabs in Tableiste mittig */
.scrollbox-clip > scrollbox:not(#PlacesToolbarItems){
-moz-box-pack: center !important;
}
Dann schauen wir mal weiter.
Mfg.
Endor
Umbenennung in Multirowtabs erledigt.
Vorhandene Links auf diese Dateien hier im Forum
müssen nun aber angepasst werden.
Links von hier: RE: userChrome.js Scripte für den Fuchs (Diskussion)
geht jetzt nicht mehr, muss jetzt so sein:
Mfg.
Endor
Soll ich die Änderung in Zeile 37
.tabbrowser-tab,#tabs-newtab-button
übernehmen? Was meinst Du?
Mfg.
Endor
Also etwas hätte ich da noch.
Ist noch nicht die ganze Lösung, aber ein Anfang.
Dieses Script fügt eine Vertikale Symbolleiste ein, die mit Schaltfläche ein
und ausgeblendet werden kann. Inhalt, also Schaltflächen usw.
müssen über den Symbolleiste anpassen Dialog eingefügt werden.
Ich habe versucht den Inhalt der Lesezeichenleiste auch rein zu schieben,
das geht, wird aber nicht untereinander dargestellt. Da müsste man dann
mit CSS arbeiten.
Hier das Script ist glaube ich auch von Aborix:
(function() {
/*******************************************************************************/
if (location != 'chrome://browser/content/browser.xhtml') {
return;
}
/*******************************************************************************/
// Background Color
var vb_bg_color = '#f6f6f6';
// Border Color
var vb_border_color = 'rgb(0,128,0)';
// Number of columns
var vb_cols = 1;
// Visibility on Start
var vb_visibilityOnStart = 1;
// Button Icon, if Toolbar is visible
vb_isVisibleImage = 'url("data:image/x-icon;base64,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")';
// Button Icon, if Toolbar is hidden
vb_isHiddenImage = 'url("data:image/x-icon;base64,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")';
/*******************************************************************************/
var vb_h = window.outerHeight;
var vb_minH = vb_h/20;
var vb_maxH = vb_h/2;
var vb_width = 40;
var vb_totalwidth = vb_cols * vb_width;
var vb_style = '\
box-sizing: content-box !important; \
background-color: ' + vb_bg_color + ' !important; \
min-width: ' + vb_totalwidth + 'px !important; \
max-width: ' + vb_totalwidth + 'px !important; \
min-height: ' + vb_minH + 'px !important; \
max-height: ' + vb_maxH + 'px !important; \
position: absolute !important; \
right: 17px !important; \
padding: 5px 0 !important; \
border: 2px ridge ' + vb_border_color + '; \
border-radius: 10px !important; \
z-index: 1 !important; \
';
var vb_element = document.getElementById('navigator-toolbox');
var vb_toolbar = document.createElement('toolbar');
vb_toolbar.id = 'fp-toolbar';
vb_toolbar.setAttribute('customizable', true);
vb_toolbar.setAttribute('mode', 'icons');
vb_toolbar.setAttribute('style', vb_style);
vb_element.appendChild( vb_toolbar );
vb_toolbar.setAttribute('collapsed', false);
CustomizableUI.registerArea( 'fp-toolbar' , { legacy: true } );
CustomizableUI.registerToolbarNode(vb_toolbar);
setTimeout(function(){
var tmp_positionInfo = vb_toolbar.getBoundingClientRect();
var tmp_height = tmp_positionInfo.height;
var vb_ptop = ( vb_h - tmp_height ) / 2;
vb_toolbar.style.top = vb_ptop + 'px';
if( vb_visibilityOnStart == 0 ) {
vb_toolbar.setAttribute('collapsed', true);
}
}, 500);
/*******************************************************************************/
try {
Components.utils.import("resource:///modules/CustomizableUI.jsm");
CustomizableUI.createWidget({
id: "fp-toggle-toolbar",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Vertical Toolbar",
tooltiptext: "Vertical Toolbar",
onClick: function() {
var node = document.getElementById('fp-toolbar');
var isCollapsed = node.getAttribute('collapsed');
if( isCollapsed == 'false' ) {
node.setAttribute( 'collapsed' , 'true' );
node.style.visibility = 'collapse';
document.getElementById(this.id).style.listStyleImage = vb_isHiddenImage;
} else {
node.setAttribute( 'collapsed' , 'false' );
node.style.visibility = 'visible';
document.getElementById(this.id).style.listStyleImage = vb_isVisibleImage;
}
},
onCreated: function(aNode) {
if( vb_visibilityOnStart == 1 ) {
aNode.style.listStyleImage = vb_isVisibleImage;
} else {
aNode.style.listStyleImage = vb_isHiddenImage;
}
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
};
/*******************************************************************************/
})();
Alles anzeigen
Hoffe das hilft weiter.
Mfg.
Endor
Ja das Teil ist komplexer.
Ich muss es die Tage mal in Ruhe testen.
Mfg.
Endor
Hallo zusammen.
expandsidebar.uc.js funktioniert hier gut.
Wenn Ihr lust habe es gäbe da noch eine Alternative vom selben Autor
und etwas aktueller:
SidebarModoki.uc.js
// ==UserScript==
// @name SidebarModoki
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description TST
// @include main
// @compatibility Firefox 106
// @author Alice0775
// @note Tree Style Tab がある場合にブックマークと履歴等を別途"サイドバーもどき"で表示
// @note SidebarModoki.uc.js.css をuserChrome.cssに読み込ませる必要あり
// @version 2022/09/29 fix Bug 1689816
// @version 2022/09/28 ordinal position
// @version 2022/09/14 fix Bug 1790299
// @version 2022/09/14 use toolbarspring instead of spacer
// @version 2022/08/26 Bug 1695435 - Remove @@hasInstance for IDL interfaces in chrome context
// @version 2022/04/01 23:00 Convert Components.utils.import to ChromeUtils.import
// @version 2022/03/26 23:00 Bug 1760342 - Remove :-moz-lwtheme-{brighttext,darktext}
// @version 2021/11/21 18:00 Bug 1742111 - Rename internal accentcolor and textcolor properties to be more consistent with the webext theme API
// @version 2021/11/14 13:00 wip change css(Bug 1740230 - moz-lwtheme* pseudo-classes don't get invalidated correctly)
// @version 2021/09/30 22:00 change splitter color
// @version 2021/05/18 20:00 fix margin of tabpanels
// @version 2021/02/09 20:00 Rewrite `X.setAttribute("hidden", Y)` to `X.hidden = Y`
// @version 2020/06/18 fix SidebarModoki position(Bug 1603830 - Remove support for XULElement.ordinal)
// @version 2019/12/11 fix for 73 Bug 1601094 - Rename remaining .xul files to .xhtml in browser
// @version 2019/11/14 03:00 workarround Ctrl+tab/Ctrl+pageUP/Down
// @version 2019/10/20 22:00 fix surplus loading
// @version 2019/10/20 12:30 workaround Bug 1497200: Apply Meta CSP to about:downloads, Bug 1513325 - Remove textbox binding
// @version 2019/09/05 13:00 fix listitem
// @version 2019/08/07 15:00 fix adding key(renamde from key to keyvalue in jsonToDOM)
// @version 2019/07/13 13:00 fix wrong commit
// @version 2019/07/10 10:00 fix 70 Bug 1558914 - Disable Array generics in Nightly
// @version 2019/05/29 16:00 Bug 1519514 - Convert tab bindings
// @version 2018/12/23 14:00 Adjust margin
// @version 2018/12/23 00:00 Add option of SidebarModoki posiotion SM_RIGHT
// @version 2018/05/10 00:00 for 61 wip Bug 1448810 - Rename the Places sidebar files
// @version 2018/05/08 21:00 use jsonToDOM(https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Overlay_Extensions/XUL_School/DOM_Building_and_HTML_Insertion)
// @version 2018/05/08 19:00 get rid loadoverlay
// @version 2017/11/24 19:50 do nothing if window is popup(window.open)
// @version 2017/11/24 19:20 change close button icon style to 57
// @version 2017/11/24 19:10 add key(accel(ctrl)+alt+s) and close button
// @version 2017/11/24 19:00 hack for DL manager
// @version 2017/11/24 15:00 remove unused variable
// @version 2017/11/23 13:10 restore initial tab index/width and more unique id
// @version 2017/11/23 12:30 try catch. download manager
// @version 2017/11/23 00:30 Make button icon
// @version 2017/11/23 00:00 Make button customizable
// @version 2017/11/22 23:00 fullscreen
// @version 2017/11/22 23:00 DOM fullscreen
// @version 2017/11/22 22:00 F11 fullscreen
// @version 2017/11/15 09:00
// ==/UserScript==
var SidebarModoki = {
// -- config --
SM_RIGHT: false, // SidebarModoki position
SM_WIDTH : 130,
SM_AUTOHIDE : false, //F11 Fullscreen
TAB_SRC : ["chrome://browser/content/places/bookmarksSidebar.xhtml",
"chrome://browser/content/places/historySidebar.xhtml",
"chrome://browser/content/downloads/contentAreaDownloadsView.xhtml?SM"],
TAB_LABEL : ["Bookmarks", "History", "DL"],
// -- config --
kSM_Open : "userChrome.SidebarModoki.Open",
kSM_lastSelectedTabIndex : "userChrome.SidebarModoki.lastSelectedTabIndex",
kSM_lastSelectedTabWidth : "userChrome.SidebarModoki.lastSelectedTabWidth",
ToolBox: null,
Button: null,
get prefs(){
delete this.prefs;
return this.prefs = Services.prefs;
},
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") { //for later convenient JavaScript access) by giving them a 'keyvalue' attribute; |nodes|.|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(
doc.defaultView.Node.isInstance(childElem)
/*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() {
let chromehidden = document.getElementById("main-window").hasAttribute("chromehidden");
if (chromehidden &&
document.getElementById("main-window").getAttribute("chromehidden").includes("extrachrome")) {
return; // do nothing
}
let MARGINHACK = this.SM_RIGHT ? "0 0 0 0" : "0 -2px 0 0";
let style = `
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#SM_toolbox
{
width: {SM_WIDTH}px;
background-color: var(--toolbar-bgcolor);
color: -moz-dialogtext;
text-shadow: none;
}
#SM_toolbox:-moz-lwtheme {
/*background-color: var(--lwt-accent-color);*/
background-color: var(--toolbar-bgcolor);
color: var(--lwt-text-color);
}
.SM_toolbarspring {
max-width: unset !important;
}
/*visibility*/
#SM_toolbox[collapsed],
#SM_splitter[collapsed],
/*フルスクリーン*/
#SM_toolbox[moz-collapsed="true"],
#SM_splitter[moz-collapsed="true"]
{
visibility:collapse;
}
#SM_splitter {
background-color: var(--toolbar-bgcolor) !important;
border-inline-start-color: var(--toolbar-bgcolor) !important;
border-inline-end-color: var(--toolbar-bgcolor) !important;
}
/*ポップアップの時*/
#main-window[chromehidden~="extrachrome"] #SM_toolbox,
#main-window[chromehidden~="extrachrome"] #SM_splitter
{
visibility: collapse;
}
#SM_tabpanels
{
appearance: none !important;
padding: 0 !important;
margin: {MARGINHACK}; /*hack*/
appearance: unset;
color-scheme: unset !important;
}
toolbar[brighttext]:-moz-lwtheme #SM_tabbox {
background-color: var(--toolbar-bgcolor);
}
#SM_tabs {
overflow-x: hidden;
}
#SM_tabs tab {
appearance: none !important;
}
#SM_tabs tab:not([selected]) {
opacity: 0.6 !important;
}
#SM_tabs tab {
color: unset !important;
}
#SM_Button
{
list-style-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQ0lEQVQ4jWNgoAL4z8DA8N/AwAArTQRGFSBBI4YBDHhonC6n3AA1NTUMZ6F5gyQXYFNEsheweWnUBfRyAbmYcgMoAgBFX4a/wlDliwAAAABJRU5ErkJggg==');
}
toolbar[brighttext]:-moz-lwtheme #SM_Button
{
list-style-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAANklEQVQ4jWP4TyFg+P///38GBgayMHUNwEdjdTrVDcDnTKJdgEsRSV5ACaBRF9DZBQObFygBAMeIxVdCQIJTAAAAAElFTkSuQmCC');
}
`;
var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
var uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(style.replace(/\s+/g, " ").replace(/\{SM_WIDTH\}/g, this.SM_WIDTH).replace(/\{MARGINHACK\}/g, MARGINHACK)));
if(!sss.sheetRegistered(uri, sss.AGENT_SHEET))
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
/*
style = style.replace(/\s+/g, " ").replace(/\{SM_WIDTH\}/g, this.SM_WIDTH).replace(/\{MARGINHACK\}/g, MARGINHACK);
let 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);
};
*/
ChromeUtils.import("resource:///modules/CustomizableUI.jsm");
// xxxx try-catch may need for 2nd window
try {
CustomizableUI.createWidget({ //must run createWidget before windowListener.register because the register function needs the button added first
id: 'SM_Button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
var props = {
id: "SM_Button",
class: "toolbarbutton-1 chromeclass-toolbar-additional",
tooltiptext: "Sidebar Modoki",
oncommand: "SidebarModoki.toggle();",
type: "button",
label: "Sidebar Modoki",
removable: "true"
};
for (var p in props) {
toolbaritem.setAttribute(p, props[p]);
}
return toolbaritem;
}
});
}catch(e){}
// to do, replace with MozXULElement.parseXULToFragment();
let template = ["command", {id: "cmd_SidebarModoki", oncommand: "SidebarModoki.toggle()"}];
document.getElementById("mainCommandSet").appendChild(this.jsonToDOM(template, document, {}));
template = ["key", {id: "key_SidebarModoki", key: "B", modifiers: "accel,alt", command: "cmd_SidebarModoki",}];
document.getElementById("mainKeyset").appendChild(this.jsonToDOM(template, document, {}));
//to do xxx ordinal=xx shoud be replaced with style="-moz-box-ordinal-group: xx;"
template =
["vbox", {id: "SM_toolbox", style: this.SM_RIGHT ? "-moz-box-ordinal-group:10" : "-moz-box-ordinal-group:0"},
["hbox", {id: "SM_header", align: "center"},
["label", {}, "SidebarModoki"],
["toolbarspring", {class: "SM_toolbarspring", flex: "1000"}],
["toolbarbutton", {id: "SM_closeButton", class: "close-icon tabbable", tooltiptext: "Close SidebarModoki", oncommand: "SidebarModoki.close();"}]
],
["tabbox", {id:"SM_tabbox", flex: "1", handleCtrlPageUpDown: false, handleCtrlTab: false},
["tabs", {id: "SM_tabs"},
["tab", {id: "SM_tab0", label: this.TAB_LABEL[0]}],
["tab", {id: "SM_tab1", label: this.TAB_LABEL[1]}],
["tab", {id: "SM_tab2", label: this.TAB_LABEL[2]}]
],
["tabpanels", {id: "SM_tabpanels", flex: "1", style: "border: none;"},
["tabpanel", {id: "SM_tab0-container", orient: "vertical", flex: "1"},
["browser", {id: "SM_tab0-browser", flex: "1", autoscroll: "false", src: ""}]
],
["tabpanel", {id: "SM_tab1-container", orient: "vertical", flex: "1"},
["browser", {id: "SM_tab1-browser", flex: "1", autoscroll: "false", src: ""}]
],
["tabpanel", {id: "SM_tab2-container", orient: "vertical", flex: "1"},
["browser", {id: "SM_tab2-browser", flex: "1", autoscroll: "false", src: ""}]
]
]
]
];
let sidebar = document.getElementById("sidebar-box");
sidebar.parentNode.insertBefore(this.jsonToDOM(template, document, {}), sidebar);
template =
["splitter", {id: "SM_splitter", style: this.SM_RIGHT ? "-moz-box-ordinal-group:9" : "-moz-box-ordinal-group:0", state: "open", collapse: this.SM_RIGHT ? "after" :"before", resizebefore: "closest", resizeafter: "farthest"},
["grippy", {}]
];
sidebar.parentNode.insertBefore(this.jsonToDOM(template, document, {}), sidebar);
//xxx 69 hack
let tabbox = document.getElementById("SM_tabbox");
tabbox.handleEvent = function handleEvent(event) {
if (!event.isTrusted) {
// Don't let untrusted events mess with tabs.
return;
}
// Skip this only if something has explicitly cancelled it.
if (event.defaultCancelled) {
return;
}
// Don't check if the event was already consumed because tab
// navigation should always work for better user experience.
let imports = {};
ChromeUtils.defineModuleGetter(
imports,
"ShortcutUtils",
"resource://gre/modules/ShortcutUtils.jsm"
);
const { ShortcutUtils } = imports;
switch (ShortcutUtils.getSystemActionForEvent(event)) {
case ShortcutUtils.CYCLE_TABS:
if (this.tabs && this.handleCtrlTab) {
this.tabs.advanceSelectedTab(event.shiftKey ? -1 : 1, true);
event.preventDefault();
}
break;
case ShortcutUtils.PREVIOUS_TAB:
if (this.tabs && this.handleCtrlPageUpDown) {
this.tabs.advanceSelectedTab(-1, true);
event.preventDefault();
}
break;
case ShortcutUtils.NEXT_TAB:
if (this.tabs && this.handleCtrlPageUpDown) {
this.tabs.advanceSelectedTab(1, true);
event.preventDefault();
}
break;
}
};
let index = document.getElementById("SM_tabpanels").selectedIndex;
let tb0 = document.getElementById("SM_tab0");
let tb1 = document.getElementById("SM_tab1");
let tb2 = document.getElementById("SM_tab2");
tb0.parentNode.insertBefore(tb0, tb1);
tb0.parentNode.insertBefore(tb1, tb2);
document.getElementById("SM_tabs").selectedIndex = index;
setTimeout(function(){this.observe();}.bind(this), 0);
//F11 fullscreen
FullScreen.showNavToolbox_org = FullScreen.showNavToolbox;
FullScreen.showNavToolbox = function(trackMouse = true) {
FullScreen.showNavToolbox_org(trackMouse);
if (!!SidebarModoki.ToolBox) {
SidebarModoki.ToolBox.removeAttribute("moz-collapsed");
SidebarModoki.Splitter.removeAttribute("moz-collapsed");
}
}
FullScreen.hideNavToolbox_org = FullScreen.hideNavToolbox;
FullScreen.hideNavToolbox = function(aAnimate = false) {
FullScreen.hideNavToolbox_org(aAnimate);
if (SidebarModoki.SM_AUTOHIDE && !!SidebarModoki.ToolBox) {
SidebarModoki.ToolBox.setAttribute("moz-collapsed", "true");
SidebarModoki.Splitter.setAttribute("moz-collapsed", "true");
}
}
//DOM fullscreen
window.addEventListener("MozDOMFullscreen:Entered", this,
/* useCapture */ true,
/* wantsUntrusted */ false);
window.addEventListener("MozDOMFullscreen:Exited", this,
/* useCapture */ true,
/* wantsUntrusted */ false);
/*
SidebarUI.setPosition_org = SidebarUI.setPosition;
SidebarUI.setPosition = function() {
SidebarUI.setPosition_org();
if (SidebarModoki && SidebarModoki.ToolBox)
SidebarModoki.ToolBox.style.setProperty("-moz-box-ordinal-group", SidebarModoki.SM_RIGHT ? "10" : "0", "");
if (SidebarModoki && SidebarModoki.Splitter)
SidebarModoki.Splitter.style.setProperty("-moz-box-ordinal-group", SidebarModoki.SM_RIGHT ? "9" : "0", "");
};
*/
},
observe: function() {
this.ToolBox = document.getElementById("SM_toolbox");
this.Splitter = document.getElementById("SM_splitter");
this.ToolBox.style.setProperty("-moz-box-ordinal-group", this.SM_RIGHT ? "10" : "0", "");
this.Splitter.style.setProperty("-moz-box-ordinal-group", this.SM_RIGHT ? "9" : "0", "");
if (this.getPref(this.kSM_Open, "bool", true)) {
this.toggle(true);
} else {
this.close();
}
document.getElementById("SM_tabs").addEventListener("focus", this, true);
window.addEventListener("aftercustomization", this, false);
// xxxx native sidebar changes ordinal when change position of the native sidebar and open/close
this.SM_Observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
switch (mutation.attributeName) {
case "collapsed":
case "hidden":
case "positionend":
setTimeout(() => {
this.ToolBox.style.setProperty("-moz-box-ordinal-group", this.SM_RIGHT ? "10" : "0", "");
this.Splitter.style.setProperty("-moz-box-ordinal-group", this.SM_RIGHT ? "9" : "0", "");
}, 0);
break;
}
}.bind(this));
}.bind(this));
// pass in the target node, as well as the observer options
this.SM_Observer.observe(document.getElementById("sidebar-box"),
{attribute: true, attributeFilter: ["collapsed", "hidden", "positionend"]});
},
onSelect: function(event) {
let aIndex = document.getElementById("SM_tabpanels").selectedIndex;
this.prefs.setIntPref(this.kSM_lastSelectedTabIndex, aIndex);
width = this.getPref(this.kSM_lastSelectedTabWidth + aIndex, "int", this.SM_WIDTH);
if (document.getElementById("SM_tab" + aIndex +"-browser").src == "" ) {
document.getElementById("SM_tab" + aIndex +"-browser").src = this.TAB_SRC[aIndex];
}
document.getElementById("SM_toolbox").style.setProperty("width", width + "px", "");
},
toggle: function(forceopen) {
this.Button = document.getElementById("SM_Button");
if (!this.Button.hasAttribute("checked") || forceopen) {
this.Button.setAttribute("checked", true);
this.ToolBox.collapsed= false;
this.Splitter.collapsed= false;
let index = this.getPref(this.kSM_lastSelectedTabIndex, "int", 0);
document.getElementById("SM_tabs").selectedIndex = index;
width = this.getPref(this.kSM_lastSelectedTabWidth + index, "int", this.SM_WIDTH);
document.getElementById("SM_toolbox").style.setProperty("width", width + "px", "");
this.prefs.setBoolPref(this.kSM_Open, true)
this.onSelect({});
addEventListener("resize", this, false);
} else {
this.close();
}
},
close: function() {
removeEventListener("resize", this, false);
this.Button = document.getElementById("SM_Button");
this.Button.removeAttribute("checked");
this.ToolBox.collapsed = true;
this.Splitter.collapsed = true;
this.prefs.setBoolPref(this.kSM_Open, false)
},
//ここからは, 大きさの調整
onResize: function(event) {
let width = this.ToolBox.getBoundingClientRect().width;
let aIndex = document.getElementById("SM_tabs").selectedIndex;
this.prefs.setIntPref(this.kSM_lastSelectedTabWidth + aIndex, width);
},
handleEvent: function(event) {
switch(event.type) {
case 'focus':
this.onSelect(event);
break;
case 'resize':
this.onResize(event);
break;
case 'MozDOMFullscreen:Entered':
if (!!this.ToolBox) {
this.ToolBox.setAttribute("moz-collapsed", "true");
this.Splitter.setAttribute("moz-collapsed", "true");
}
break;
case 'MozDOMFullscreen:Exited':
if (!!this.ToolBox) {
this.ToolBox.removeAttribute("moz-collapsed");
this.Splitter.removeAttribute("moz-collapsed");
}
break;
case 'aftercustomization':
if (this.getPref(this.kSM_Open, "bool", true)) {
this.Button.setAttribute("checked", true);
}
break;
}
},
//pref読み込み
getPref: function(aPrefString, aPrefType, aDefault) {
try{
switch (aPrefType){
case "str":
return this.prefs.getCharPref(aPrefString).toString(); break;
case "int":
return this.prefs.getIntPref(aPrefString); break;
case "bool":
default:
return this.prefs.getBoolPref(aPrefString); break;
}
}catch(e){
}
return aDefault;
}
}
SidebarModoki.init();
Alles anzeigen
Dieser CSS Code muss dazu verwendet werden, bzw. über userchrome.css geladen werden:
SidebarModoki.uc.js.css
@charset "utf-8";
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/*@version 2020/03/13 17:00 use xhtml instead xul*/
/*@version 2019/10/20 12:30*/
@-moz-document url("chrome://browser/content/downloads/contentAreaDownloadsView.xhtml?SM") {
*|*:root
{
--downloads-item-height: 3.5em;
}
richlistitem {
height: 3.5em !important;
}
#contentAreaDownloadsView
{
padding: 0 !important;
}
.downloadTypeIcon,
.downloadBlockedBadge
{
margin-left:0 !important;
margin-right:1px !important;
}
.downloadButton {
padding-left:0 !important;
padding-right:0 !important;
}
}
Alles anzeigen
Verwende ich hier nicht.
Vielleicht passt das ja auch.
Mfg.
Endor
Hier funktioniert er auch in allen drei Versionen.
106, 107 Beta und 108 Nightly.
Mfg.
Endor
Da fürchte ich, funkt die ein anderer CSS Code dazwischen.
Du wirst wohl jeden deaktivieren und nach Kontrolle wieder aktivieren müssen
um raus zu finden welcher da stört.
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