1. Nachrichten
  2. Forum
    1. Unerledigte Themen
    2. Forenregeln
  3. Spenden
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. camp-firefox.de
  2. Endor

Beiträge von Endor

  • Speicherort von Dateien und Ordnern für den schnellen Zugriff über die zusätzliche Symbolleiste

    • Endor
    • 8. September 2019 um 20:53

    Bitte testen:

    Code
    // ==UserScript==
    // @name External-Aplication.uc.js
    // @namespace ithinc#mozine.cn
    // @description External Applications
    // @include main
    // @compatibility Firefox 3.5.x
    // @author ithinc
    // @version 20091212.0.0.1 Initial release
    // @version 20170911.0.0.2 Fix by aborix
    // ==/UserScript==
    //
    // Herkunft:
    // https://www.camp-firefox.de/forum/thema/126871-speicherort-von-dateien-und-ordnern-f%C3%BCr-den-schnellen-zugriff-%C3%BCber-die-zus%C3%A4tzlic/?pageNo=1
    
    
    /* :::: External Applications :::: */
    
    
    var gExternalApplications = {
    type: 'menu', //'menu' or 'button'
    insertafter: 'menubar-items',
    
    
    apps: [
    {name: 'EmEditor', path: 'C:\\Program Files (x86)\\EmEditor\\EmEditor.exe'},
    {name: 'Notepad++', path: 'D:\\___Stickware\\office\\NPP\\Notepad++Portable.exe'},
    {name: 'Calculator', path: 'C:\\WINDOWS\\system32\\calc.exe'},
    {name: 'Command Prompt', path: 'C:\\WINDOWS\\system32\\cmd.exe'},
    {name: 'separator'},
    {name: 'EDF-Reviews', path: 'D:\\05_E-Smoke\\0B_Foren\\EDF\\Reviews'},
    {name: 'EDF-Tabellen', path: 'D:\\05_E-Smoke\\0B_Foren\\EDF\\Tabellen'},
    {name: 'separator'},
    {name: 'Shops', path: 'D:\\05_E-Smoke\\08_Shops'},
    {name: 'separator'},
    {name: 'FF-Chrome', path: 'D:\\___Stickware\\comm\\FirefoxPortable\\Data\\profile\\chrome'},
    ],
    
    
    init: function() {
    for (var i=0; i<this.apps.length; i++) {
    if (!this.apps[i].path) continue;
    if (!this.apps[i].args) this.apps[i].args = [];
    
    
    this.apps[i].path = this.apps[i].path.replace(/\//g, '\\');
    
    
    var ffdir = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('CurProcD', Ci.nsIFile).path;
    if (/^(\\)/.test(this.apps[i].path)) {
    this.apps[i].path = ffdir.substr(0,2) + this.apps[i].path;
    }
    else if (/^(\.)/.test(this.apps[i].path)) {
    this.apps[i].path = ffdir + '\\' + this.apps[i].path;
    }
    }
    
    
    if (this.type == 'menu') {
    var mainmenu = document.getElementById('main-menubar'); // das war das Original
    var menu = mainmenu.appendChild(document.createXULElement('menu'));
    menu.setAttribute('label', 'Start'); // Menu = "Start"
    menu.setAttribute('accesskey', 'a');
    
    
    var menupopup = menu.appendChild(document.createXULElement('menupopup'));
    for (var i=0; i<this.apps.length; i++) {
    menupopup.appendChild(this.createMenuitem(this.apps[i]));
    }
    }
    else {
    var menubarItems = document.getElementById(this.insertafter);
    var toolbaritem = menubarItems.parentNode.insertBefore(document.createXULElement('toolbaritem'), menubarItems.nextSibling);
    toolbaritem.id = 'ExtAppButtons';
    toolbaritem.setAttribute("class", "chromeclass-toolbar-additional");
    toolbaritem.setAttribute("orient", "horizontal");
    for (var i=0; i<this.apps.length; i++) {
    toolbaritem.appendChild(this.createButton(this.apps[i]));
    }
    }
    },
    
    
    exec: function(path, args) {
    for (var i=0; i<args.length; i++) {
    args[i] = args[i].replace(/%u/g, gBrowser.currentURI.spec);
    }
    
    
    var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
    file.initWithPath(path);
    if (!file.exists()) {
    throw 'File Not Found: ' + path;
    }
    
    
    if (!file.isExecutable() || args.length==0) {
    file.launch();
    }
    else {
    var process = Cc['@mozilla.org/process/util;1'].getService(Ci.nsIProcess);
    process.init(file);
    process.run(false, args, args.length);
    }
    },
    
    
    createButton: function(app) {
    if (app.name == 'separator')
    return document.createXULElement('toolbarseparator');
    
    
    var item = document.createXULElement('toolbarbutton');
    item.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional');
    item.setAttribute('label', app.name);
    item.setAttribute('image', 'moz-icon:file:///' + app.path + '?size=16');
    item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);');
    // item.setAttribute('tooltiptext', app.name);
    item.path = app.path;
    item.args = app.args;
    return item;
    },
    
    
    createMenuitem: function(app) {
    if (app.name == 'separator')
    return document.createXULElement('menuseparator');
    
    
    var item = document.createXULElement('menuitem');
    item.setAttribute('class', 'menuitem-iconic');
    item.setAttribute('label', app.name);
    item.setAttribute('image', 'moz-icon:file:///' + app.path + '?size=16');
    item.setAttribute('oncommand', 'gExternalApplications.exec(this.path, this.args);');
    item.path = app.path;
    item.args = app.args;
    return item;
    }
    };
    gExternalApplications.init();
    Alles anzeigen

    Mfg.
    Endor

  • Download Scripts funktionieren nicht richtig bzw. gar nicht.

    • Endor
    • 8. September 2019 um 17:16

    Nur zur Info: es gibt eine neue Version vom Script

    und da werden wieder alle Downloads angezeigt:

    CSS
    // ==UserScript==
    // @name ucjsDownloadsStatusModoki.uc.js
    // @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
    // @description Downloads Status Modoki
    // @include main
    // @compatibility Firefox 69+
    // @author Alice0775
    // @version 2019/09/08 19:30 fix scrollbox
    // @version 2019/05/21 08:30 fix 69.0a1 Bug 1551320 - Replace all createElement calls in XUL documents with createXULElement
    // @version 2018/10/27 12:00 fix for 64+
    // @version 2018/06/12 21:00 fix for private window mode
    // @version 2018/06/07 12:00 fix file name for history
    // @version 2018/02/10 12:00 try catch error when DO_NOT_DELETE_HISTORY = true
    // @version 2017/12/10 12:00 fix error when DO_NOT_DELETE_HISTORY = true
    // @version 2017/12/10 12:00 remove workaround Bug 1279329. Disable btn while clear list is doing, close button styling for 57.
    // @version 2016/06/10 12:00 modify style independent of font-family
    // @version 2016/06/10 07:00 modify style of close button, fix typo
    // @version 2016/06/10 00:00 Workaround Bug 1279329. adjust some padding
    // @version 2015/05/08 00:00 remove padding due to Bug 1160734
    // @version 2014/03/31 00:00 fix for browser.download.manager.showWhenStarting
    // @version 2013/12/22 13:00 chromehidden
    // @version 2013/12/19 17:10 rename REMEMBERHISTOTY to DO_NOT_DELETE_HISTORY
    // @version 2013/12/16 23:28 fixed initialize numDls
    // @version 2013/12/16 23:24 open only download added
    // @version 2013/12/16 23:10 open only download started
    // @version 2013/12/16 21:20 modify css Windows7 Aero
    // @version 2013/12/16 21:00 modify css
    // @version 2013/12/16 19:30 add autocheck false
    // @version 2013/12/16 18:31 fix pref name
    // @version 2013/12/16 18:30
    // @note
    // ==/UserScript==
    var ucjsDownloadsStatusModoki = {
    _summary: null,
    _list: null,
    
    
    get downloadsStatusModokiBar() {
    delete downloadsStatusModokiBar;
    return this.downloadsStatusModokiBar = document.getElementById("downloadsStatusModokiBar");
    },
    
    
    get toggleMenuitem() {
    delete toggleMenuitem;
    return this.toggleMenuitem = document.getElementById("toggle_downloadsStatusModokiBar");
    },
    
    
    init: function() {
    if (document.documentElement.getAttribute("chromehidden") !="" )
    return;
    
    
    XPCOMUtils.defineLazyModuleGetter(window, "Downloads",
    "resource://gre/modules/Downloads.jsm");
    
    
    var style = `
    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
    #ucjsDownloadsStatusModoki {
    width: 100%;
    max-height: 100px;
    height: 39px;
    }
    `.replace(/\s+/g, " ");
    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);
    };
    
    
    
    
    var toolbar = document.createXULElement("vbox");
    toolbar.setAttribute("id", "downloadsStatusModokiBar");
    toolbar.setAttribute("collapsed", true);
    
    
    var bottombox = document.getElementById("browser-bottombox");
    bottombox.appendChild(toolbar);
    var browser = toolbar.appendChild(document.createXULElement("browser"));
    browser.setAttribute("disablehistory", true);
    browser.setAttribute("remote", false);
    browser.setAttribute("id", "ucjsDownloadsStatusModoki");
    browser.addEventListener("load", function(event){ucjsDownloadsStatusModoki.onload(event)}, true);
    browser.setAttribute("src", "chrome://browser/content/downloads/contentAreaDownloadsView.xul");
    
    
    var menuitem = document.createXULElement("menuitem");
    menuitem.setAttribute("id", "toggle_downloadsStatusModokiBar");
    menuitem.setAttribute("type", "checkbox");
    menuitem.setAttribute("autocheck", false);
    menuitem.setAttribute("label", "Download Leiste");
    menuitem.setAttribute("checked", false);
    menuitem.setAttribute("accesskey", "D");
    menuitem.setAttribute("oncommand", "ucjsDownloadsStatusModoki.toggleDownloadsStatusModokiBar()");
    var ref = document.getElementById("menu_customizeToolbars");
    ref.parentNode.insertBefore(menuitem, ref.previousSibling);
    
    
    // Ensure that the DownloadSummary object will be created asynchronously.
    if (!this._summary) {
    Downloads.getSummary(Downloads.ALL).then(summary => {
    this._summary = summary;
    return this._summary.addView(this);
    }).then(null, Cu.reportError);
    }
    if (!this._list) {
    Downloads.getList(Downloads.ALL).then(list => {
    this._list = list;
    return this._list.addView(this);
    }).then(null, Cu.reportError);
    }
    
    
    window.addEventListener("unload", this, false);
    },
    
    
    uninit: function() {
    window.removeEventListener("unload", this, false);
    if (this._summary) {
    this._summary.removeView(this);
    }
    if (this._list) {
    this._list.removeView(this);
    }
    },
    
    
    handleEvent: function(event) {
    switch (event.type) {
    case "unload":
    this.uninit();
    break;
    }
    },
    
    
    toggleDownloadsStatusModokiBar: function() {
    var collapsed = this.downloadsStatusModokiBar.collapsed;
    this.downloadsStatusModokiBar.collapsed = !collapsed;
    this.toggleMenuitem.setAttribute("checked", collapsed);
    },
    
    
    openDownloadsStatusModoki: function() {
    this.downloadsStatusModokiBar.collapsed = false;
    this.toggleMenuitem.setAttribute("checked", true);
    },
    
    
    hideDownloadsStatusModoki: function() {
    this.downloadsStatusModokiBar.collapsed = true;
    this.toggleMenuitem.setAttribute("checked", false);
    },
    
    
    onDownloadAdded: function (aDownload) {
    Cu.import("resource://gre/modules/Services.jsm");
    var showWhenStarting = true;
    try {
    showWhenStarting = Services.prefs.getBoolPref("userChrome.downloadsStatusModoki.showWhenStarting");
    } catch(e) {}
    this.numDls = 0;
    if (showWhenStarting) {
    if (this._list) {
    this._list.getAll().then(downloads => {
    for (let download of downloads) {
    if (!download.stopped)
    this.numDls++;
    }
    if (this.numDls > 0)
    this.openDownloadsStatusModoki(false);
    }).then(null, Cu.reportError);
    }
    }
    },
    
    
    onSummaryChanged: function () {
    Cu.import("resource://gre/modules/Services.jsm");
    if (!this._summary)
    return;
    if (this._summary.allHaveStopped || this._summary.progressTotalBytes == 0) {
    var closeWhenDone = false;
    try {
    closeWhenDone = Services.prefs.getBoolPref("userChrome.downloadsStatusModoki.closeWhenDone");
    } catch(e) {}
    if (closeWhenDone) {
    this.hideDownloadsStatusModoki();
    }
    }
    },
    
    
    
    
    
    
    // chrome://browser/content/downloads/contentAreaDownloadsView.xul
    onload: function(event) {
    var doc = event.originalTarget;
    var win = doc.defaultView;
    
    
    var style = `
    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
    #contentAreaDownloadsView {
    -moz-box-orient: horizontal;
    background-color: -moz-dialog;
    padding: 0;
    }
    
    
    #contentAreaDownloadsView > stack:first-child {
    }
    
    
    #downloadsRichListBox {
    background-color: -moz-dialog;
    display:inline-block !important;
    overflow-y: auto;
    scrollbar-width: thin;
    border: none;
    }
    
    
    :root
    {
    --downloads-item-height: 38px;
    }
    richlistitem {
    min-width:200px;
    max-width:200px;
    font-size: 13px;
    border-width: 0 1px 0 0;
    border-style: solid;
    border-color: black;
    }
    
    
    richlistitem vbox {
    }
    
    
    .downloadTypeIcon {
    height:16px;
    width: 16px;
    -moz-margin-end: 0px;
    -moz-margin-start: 1px;
    padding-right: 0;
    padding-left: 1px;
    }
    
    
    .downloadTarget {
    margin-top:1px;
    padding-bottom:16px;
    max-width: calc(100% - 50px) !important;
    min-width: calc(100% - 50px) !important;
    }
    
    
    .download-state[state="0"] * .downloadTarget,
    .download-state[state="4"] * .downloadTarget {
    padding-bottom:0px;
    }
    
    
    .downloadTarget:-moz-system-metric(windows-default-theme) {
    margin-top:2px;
    /*padding-bottom:10px; windows7 ?*/
    }
    
    
    .downloadProgress {
    margin-top:-16px;
    margin-bottom: -1px;
    height:12px;
    margin-inline-end: 0 !important;
    }
    
    
    .progress-bar {
    -moz-appearance:none !important;
    background-color: lime !important;
    }
    
    
    .progress-remainder {
    }
    
    
    .downloadDetails {
    margin-top:-12px;
    }
    
    
    .download-state:not(:-moz-any([state="-1"], [state="5"], [state="0"], [state="4"], [state="7"])) .downloadDetails {
    margin-top:-17px;
    }
    
    
    richlistitem[selected] .downloadDetails {
    opacity: 1;
    }
    
    
    .downloadButton {
    padding: 0;
    margin: 0;
    }
    
    
    button > .button-box {
    -moz-padding-start: 0px;
    -moz-padding-end: 1px;
    padding-right: 0 !important;
    padding-left: 0 !important;
    }
    
    
    #downloadFilter {
    width: 150px;
    }
    
    
    `.replace(/\s+/g, " ");
    var sspi = doc.createProcessingInstruction(
    'xml-stylesheet',
    'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"'
    );
    doc.insertBefore(sspi, doc.documentElement);
    sspi.getAttribute = function(name) {
    return doc.documentElement.getAttribute(name);
    };
    
    
    var button = doc.createXULElement("button");
    button.setAttribute("label", "Löschen");
    button.setAttribute("id", "ucjs_clearListButton");
    button.setAttribute("accesskey", "L");
    button.setAttribute("oncommand", "ucjsDownloadsStatusModoki_clearDownloads();");
    var ref = doc.getElementById("downloadCommands");
    var vbox = doc.createXULElement("vbox");
    var box = vbox.appendChild(doc.createXULElement("hbox"));
    box.appendChild(button);
    box.appendChild(doc.createXULElement("spacer")).setAttribute("flex", 1);
    var textbox = doc.createXULElement("textbox");
    textbox.setAttribute("id", "downloadFilter");
    textbox.setAttribute("clickSelectsAll", true);
    textbox.setAttribute("type", "search");
    textbox.setAttribute("placeholder", "Suchen...");
    textbox.setAttribute("oncommand", "ucjsDownloadsStatusModoki_doSearch(this.value);");
    box.appendChild(textbox);
    var closebtn = doc.createXULElement("toolbarbutton");
    closebtn.setAttribute("id", "ucjsDownloadsStatusModoki-closebutton");
    closebtn.setAttribute("class", "close-icon");
    closebtn.setAttribute("tooltiptext", "Download-Leiste schließen");
    closebtn.setAttribute("oncommand", "ucjsDownloadsStatusModoki_doClose();");
    box.appendChild(closebtn);
    ref.parentNode.insertBefore(vbox, ref);
    
    
    /*
    // xxx Bug 1279329 "Copy Download Link" of context menu in Library is grayed out
    var listBox = doc.getElementById("downloadsRichListBox");
    var placesView = listBox._placesView;
    if (placesView) {
    var place = placesView.place;
    placesView.place= null;
    placesView.place = place;
    }
    */
    win.ucjsDownloadsStatusModoki_clearDownloads = function ucjs_clearDownloads() {
    var DO_NOT_DELETE_HISTORY = true; /* custmizable true or false */
    var richListBox = doc.getElementById("downloadsRichListBox");
    
    
    Cu.import("resource://gre/modules/Services.jsm");
    var places = [];
    function addPlace(aURI, aTitle, aVisitDate) {
    places.push({
    uri: aURI,
    title: aTitle,
    visits: [{
    visitDate: (aVisitDate || Date.now()) * 1000,
    transitionType: Ci.nsINavHistoryService.TRANSITION_LINK
    }]
    });
    }
    function moveDownloads2History() {
    if (DO_NOT_DELETE_HISTORY &&
    !PrivateBrowsingUtils.isWindowPrivate(window)) {
    try {
    for (let element of richListBox.childNodes) {
    let download = element._shell.download;
    let aURI = makeURI(download.source.url);
    // let aTitle = document.getAnonymousElementByAttribute(element, "class", "downloadTarget").value
    let aTitle = download.target.path;
    aTitle = aTitle.match( /[^\\]+$/i )[0];
    aTitle = aTitle.match( /[^/]+$/i )[0];
    
    
    let aVisitDate = download.endTime || download.startTime;
    addPlace(aURI, aTitle, aVisitDate)
    }
    } catch(ex) {}
    }
    
    
    // Clear List
    richListBox._placesView.doCommand('downloadsCmd_clearDownloads');
    
    
    if (DO_NOT_DELETE_HISTORY &&
    !PrivateBrowsingUtils.isWindowPrivate(window)) {
    try {
    if (places.length > 0) {
    var asyncHistory = Components.classes["@mozilla.org/browser/history;1"]
    .getService(Components.interfaces.mozIAsyncHistory);
    asyncHistory.updatePlaces(places);
    }
    } catch(ex) {}
    }
    }
    var btn = doc.getElementById("ucjs_clearListButton");
    btn.setAttribute("disabled", true);
    moveDownloads2History();
    btn.removeAttribute("disabled");
    
    
    // close toolbar
    var closeWhenDone = false;
    try {
    closeWhenDone = Services.prefs.getBoolPref("userChrome.downloadsStatusModoki.closeWhenDone");
    } catch(e) {}
    if (closeWhenDone) {
    top.ucjsDownloadsStatusModoki.hideDownloadsStatusModoki();
    }
    };
    
    
    win.ucjsDownloadsStatusModoki_doSearch = function ucjs_doSearch(filterString) {
    var richListBox = doc.getElementById("downloadsRichListBox");
    richListBox._placesView.searchTerm = filterString;
    };
    
    
    win.ucjsDownloadsStatusModoki_doClose = function ucjs_doClose() {
    top.ucjsDownloadsStatusModoki.hideDownloadsStatusModoki();
    };
    
    
    }
    
    
    }
    ucjsDownloadsStatusModoki.init();
    Alles anzeigen

    Mfg.
    Endor

  • Firefox 61 TABs sperren ?

    • Endor
    • 8. September 2019 um 09:17

    Prima, freut mich.

    Wie immer gern geschehen.

    Mfg.
    Endor

  • FF 57 Mehrzeilige Tab-Leiste

    • Endor
    • 8. September 2019 um 09:15

    Verschieben der Tabs geht nur mit dem Script:

    MultiRowTabLiteforFx.uc.js

    Alles weitere siehe hier:

    https://github.com/Endor8/userChr…ter/Mutirowtabs

    Mfg.
    Endor

  • Firefox 61 TABs sperren ?

    • Endor
    • 7. September 2019 um 20:37

    Bitte mal diese Version testen, die ist mit deutscher Übersetzung:

    Code
    // ==UserScript==
    // @name           tabProtect_mod2.uc.js
    // @namespace      http://space.geocities.yahoo.co.jp/gl/alice0775
    // @description    tabProtect
    // @include        main
    // @exclude        about:*
    // @author         Alice0775
    // @Note           Tab-Ablösung wird nicht unterstützt
    // @Note           Beim Aufrufen des privaten Browsermodus über die Taskleiste ist der Tabstatus (geschützt - nicht geschützt) 
    // @Note           und das Speichern der Tabsitzung nach der Wiederherstellung auf Standard Einstellung
    // @compatibility  69
    // @version        2019/05/29 16:00 Bug 1519514 - Convert tab bindings
    // @version        2019/05/21 08:30 fix 69.0a1 Bug 1551320 - Replace all createElement calls in XUL documents with createXULElement
    // @version        2018/09/27 10:30 fix  tab detach
    // @version        2018/09/26 07:30 support tab detach
    // @version        2018/09/25 21:30 working with tab multi selection
    // @version        2018/06/21 19:50 workaround regression
    // @version        2018/06/21 19:40 fix restore session if *.restore_on_demand is enabled
    // @version        2018/06/10 00:00 workaround restore session
    // @version        2018/05/23 00:00 Fixed typo(status is undeled when unprotect)
    // @version        2018/05/12 15:30 workaround restore session for all window
    // @version        2018/05/06 14:00 workaround for tab move
    // @version        2018/05/04 12:00 cleanup for 60
    // @version        2018/05/04 23:00 for 60
    // ==/UserScript==
    
    var tabProtect = {
      debug: function(aMsg){
              Cc["@mozilla.org/consoleservice;1"]
                .getService(Ci.nsIConsoleService)
                .logStringMessage(aMsg.toString());
      },
    
      sessionStore: {
        get ss() {
          try { 
            return Components.classes["@mozilla.org/browser/sessionstore;1"].
                                   getService(Components.interfaces.nsISessionStore)
          } catch(e) {
            return;
          }
        },
    
        getTabValue : function(aTab, aKey) {
          if (typeof SessionStore.getCustomTabValue == "function")
            return SessionStore.getCustomTabValue(aTab, aKey);
          else
            return this.ss.getTabValue(aTab, aKey);
        },
    
        setTabValue : function(aTab, aKey, aValue) {
          if (typeof SessionStore.setCustomTabValue == "function")
            return SessionStore.setCustomTabValue(aTab, aKey, aValue);
          else
            return this.ss.setTabValue(aTab, aKey, aValue);
    
        },
        deleteTabValue : function(aTab, aKey) {
          if (typeof SessionStore.deleteCustomTabValue == "function")
            return SessionStore.deleteCustomTabValue(aTab, aKey);
          else
            return this.ss.deleteTabValue(aTab, aKey);
        }
      },
    
      get tabContext() {
        return document.getElementById("tabContextMenu");
      },
    
      init: function(){
        console.log("init");
        this.tabContextMenu();
    
        // tabbrowser.xml ersetzen
        gBrowser.removeTab_org = gBrowser.removeTab;
        gBrowser.removeTab = function(aTab, aParams) {
          if (aTab.localName != "tab")
            aTab = this.selectedTab;
          if (aTab.hasAttribute("tabProtect"))
            return;
          gBrowser.removeTab_org(aTab, aParams);
        }
    
        gBrowser.isProtectTab = function (aTab){
          return aTab.hasAttribute("tabProtect");
        }
    
        gBrowser.protectTab = function (aTab, state) {
          let isProtected;
          if (typeof state == "undefined") {
            if ( aTab.hasAttribute("tabProtect") ){
              state = false;
            } else {
              state = true;
            }
          }
          if (state) {
            aTab.setAttribute("tabProtect", "true");
            tabProtect.sessionStore.setTabValue(aTab, "tabProtect", "true");
            isProtected = true;
          } else {
            aTab.removeAttribute("tabProtect");
            try {
              tabProtect.sessionStore.deleteTabValue(aTab, "tabProtect");
            } catch(e) {}
            isProtected = false;
          }
          this.protectTabIcon(aTab);
          return isProtected;
        }
    
        gBrowser.protectTabIcon = function (aTab){
          const kXULNS =
                   "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
          var image = document.getAnonymousElementByAttribute(
                                   aTab, "class", "tab-icon-protect");
          if ( aTab.hasAttribute("tabProtect") ) {
            if(!image){
              var stack = aTab.querySelector(".tab-stack");
              var image = document.createElementNS(kXULNS,'image');
              image.setAttribute('class','tab-icon-protect');
              image.setAttribute('left',0);
              image.setAttribute('top',0);
              if(stack) stack.appendChild(image);
            }
          }
        }
    
        // CSS Übernehmen
          var style = `
          tab[tabProtect] .tab-close-button {
            display: none;
          }
          tab[tabProtect] .tab-icon-protect{
            margin-top: 0px; /*Notwendige Anpassung*/
            margin-left: 0px; /*Notwendige Anpassung*/
            list-style-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQUlEQVQ4jWNgGAXDADASUvDvOsN/fPJMlLqAhRhFTJqo/H/XKXQBsoFEuQDDVnIMQPcGXJxYA3C5hiwvUOwCZAAAlRcK7m+YgB4AAAAASUVORK5CYII=');
          }
          tab:not([tabProtect]) .tab-icon-protect {
            display: none;
          }
    
          `;
        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);
        };
    
        this.restoreAll(0);
        gBrowser.tabContainer.addEventListener('TabMove', this, false);
        gBrowser.tabContainer.addEventListener('SSTabRestoring', this, false);
        window.addEventListener('unload', this, false)
    
        // detach tab
        let func =  gBrowser.swapBrowsersAndCloseOther.toString();
        if (gBrowser && !/copytabProtect/.test(func)) {
          func = func.replace(
            'let otherFindBar = aOtherTab._findBar;',
            `if (aOtherTab.hasAttribute("tabProtect")) {
               aOurTab.ownerGlobal.gBrowser.protectTab(aOurTab, true);
               /*copytabProtect*/
             }
             $&`
           );
          eval("gBrowser.swapBrowsersAndCloseOther = function " + func.replace(/^function/, ''));
        }
      },
    
      restoreAll: function(delay = 0) {
        var that = this;
        setTimeout(init, delay, 0);
        function init(i){
          if(i < gBrowser.tabs.length){
            var aTab = gBrowser.tabs[i];
            that.restoreForTab(aTab);
            i++;
            arguments.callee(i);
          }else{
          }
        }
      },
    
      uninit: function(){
        window.removeEventListener('unload', this, false)
        gBrowser.tabContainer.removeEventListener('SSTabRestoring', this, false);
        gBrowser.tabContainer.removeEventListener('TabMove', this, false);
        this.tabContext.removeEventListener('popupshowing', this, false);
    
      },
    
      handleEvent: function(event) {
        switch(event.type) {
          case "unload":
            this.uninit(event);
            break;
          case "SSTabRestoring":
            this.restore(event);
            break;
          case "TabMove":
            this.TabMove(event);
            break;
          case "popupshowing":
            this.popupshowing(event);
            break;
        }
      },
    
      TabMove: function(aEvent){
        var aTab = aEvent.target;
        gBrowser.protectTabIcon(aTab);
      },
    
      tabContextMenu: function(){
        //tab context menu
        var tabContext = this.tabContext;
        var menuitem = this.tabProtectMenu
                     = tabContext.appendChild(
                            document.createXULElement("menuitem"));
        menuitem.id = "tabProtect";
        menuitem.setAttribute("type", "checkbox");
        if (Services.appinfo.version.split(".")[0] >= 63)
          menuitem.setAttribute("label", "Tab(s) schützen");
        else
          menuitem.setAttribute("label", "Tab schützen");
        menuitem.setAttribute("accesskey", "z");
        menuitem.setAttribute("oncommand","tabProtect.toggle(TabContextMenu.contextTab);");
        tabContext.addEventListener('popupshowing', this, false);
      },
    
      popupshowing: function(event) {
        this.setCheckbox(event);
      },
    
      restore: function(event){
        tabProtect.restoreAll(0);
      },
    
      restoreForTab: function(aTab){
        var retrievedData = this.sessionStore.getTabValue(aTab, "tabProtect") == "true";
    console.log("restoreForTab" + retrievedData);
        if(retrievedData){
          aTab.setAttribute('tabProtect',true);
        }
        gBrowser.protectTabIcon(aTab);
      },
    
      toggle: function(aTab){
        if (typeof gBrowser.selectedTabs != "undefined") {
          this.toggleProtectSelectedTabs(this.getSelectedTabs(aTab));
        } else {
          gBrowser.protectTab(aTab);
        }
      },
    
      toggleProtectSelectedTabs: function(tabs){
        if (tabs.length < 1)
          return;
        let isProtect = gBrowser.isProtectTab(tabs[0]);
        for (let tab of tabs) {
            gBrowser.protectTab(tab, !isProtect);
        }
      },
    
      getSelectedTabs: function(aTab){
        let contextTab = aTab;
        let selectedTabs = [contextTab];
        if (gBrowser.selectedTabs.indexOf(contextTab) < 0)
          return selectedTabs;
    
        for (let tab of gBrowser.selectedTabs) {
          if (contextTab != tab)
            selectedTabs.push(tab);
        }
        return selectedTabs;
      },
    
      setCheckbox: function(event){
        var menuitem = this.tabProtectMenu;
        var aTab = TabContextMenu.contextTab;
        if( !aTab || aTab.localName !='tab'){
          menuitem.setAttribute('hidden',true);
          return;
        }
        menuitem.setAttribute('hidden',false);
        if(aTab.hasAttribute('tabProtect') && aTab.getAttribute('tabProtect')){
          menuitem.setAttribute('checked', true);
        }else{
          menuitem.setAttribute('checked', false);
        }
      }
    }
    
      // We should only start the redirection if the browser window has finished
      // starting up. Otherwise, we should wait until the startup is done.
      if (gBrowserInit.delayedStartupFinished) {
        tabProtect.init();
      } else {
        let delayedStartupFinished = (subject, topic) => {
          if (topic == "browser-delayed-startup-finished" &&
              subject == window) {
            Services.obs.removeObserver(delayedStartupFinished, topic);
            tabProtect.init();
          }
        };
        Services.obs.addObserver(delayedStartupFinished,
                                 "browser-delayed-startup-finished");
      }
    Alles anzeigen

    Mfg.
    Endor

  • Fx 69 Update und meine Scripte

    • Endor
    • 7. September 2019 um 09:03

    Hallo Fritz.

    In den Scripten für Firefox 69 von hier:

    https://github.com/Endor8/userChr…tabs/Firefox-69

    in Script 2 oder 4 in der entsprechenden Zeile.

    Standard sind fünf Tabzeilen . Wert nach deinen Wünschen ändern.

    Mfg.
    Endor

  • FF Neustart im Hamburger Menü

    • Endor
    • 6. September 2019 um 16:57

    Ja das hatten wir schon öfter und wird auch noch öfter vorkommen.
    :wink:

    Macht aber nichts. Freut mich wenn es passt.

    :)

    Mfg.
    Endor

  • FF Neustart im Hamburger Menü

    • Endor
    • 6. September 2019 um 16:47

    Bitte testen:

    Code
    (function() {
    
    var menuitem = document.createXULElement('toolbarbutton');
    menuitem.id = 'uc_menu_Restart_H';
    menuitem.classList.add('subviewbutton', 'subviewbutton-iconic');
    menuitem.setAttribute('label' , 'Neustart');
    menuitem.setAttribute('tooltiptext' , 'Neustart');
    menuitem.style.listStyleImage= 'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="context-fill" fill-opacity="context-fill-opacity" d="M15,1a1,1,0,0,0-1,1V4.418A6.995,6.995,0,1,0,8,15a6.954,6.954,0,0,0,4.95-2.05,1,1,0,0,0-1.414-1.414A5.019,5.019,0,1,1,12.549,6H10a1,1,0,0,0,0,2h5a1,1,0,0,0,1-1V2A1,1,0,0,0,15,1Z"/></svg>\')';
    menuitem.setAttribute('oncommand' , "Services.appinfo.invalidateCachesOnRestart() || BrowserUtils.restartApplication();");
    var refItem = document.getElementById('appMenu-quit-button');
    refItem.parentNode.insertBefore(menuitem, refItem);
    
    
    })();
    Alles anzeigen

    Es liegt an Zeile 3 die muss so geändert werden:

    Code
    var menuitem = document.createXULElement('toolbarbutton');

    Mfg.
    Endor

  • Fx 69 Update und meine Scripte

    • Endor
    • 6. September 2019 um 15:20

    War der falsche Link, sorry:

    https://u6.getuploader.com/script/download/1848

    Wenn man auf downloaden= ダウンロード klickt , öffnet sich eine neue Seite und der
    Download startet automatisch aber mit etwas Verzögerung.

    Hier kann man schön verfolgen wenn irgend was hochgeladen wurde:

    https://u6.getuploader.com/script/


    Da werden die verschiedensten Scripte hochgeladen.

    Aber wie Du schon sagst es genügt immer mal wieder in mein Repository zu schauen

    oder hier zu fragen.

    Mfg.

    Endor

  • Fx 69 Update und meine Scripte

    • Endor
    • 6. September 2019 um 08:59

    Nein da findest Du die nicht, denn die sind von einem anderen Autor:

    der läd die immer hier rauf:

    https://u6.getuploader.com/script/download/1810

    ich lade sie da dann runter und übersetze auf deutsch.

    Mfg.
    Endor

  • Fx 69 Update und meine Scripte

    • Endor
    • 6. September 2019 um 08:35

    Aber gerne doch.

    Freut mich wenn es passt.

    Müsste auf meiner Github Seite mal die ganzen diesbezüglichen Scripte aktualisieren.

    Der Autor hat alle aktualisiert. Mir fehlt nur leider die Zeit dazu.

    Mfg.

    Endor

  • Mit einem Klick Sidebar-Anzeige umschalten

    • Endor
    • 6. September 2019 um 08:13

    Meinst Du das Script zum öffnen der Seitenleiste bei Berührung des Seitenrandes,

    wenn ja, es gibt eine neue Version vom Script bitte testen:

    Code
    // ==UserScript==
    // @name expandsidebar.uc.js
    // @description Automatisches Öffnen und Schließen der Seitenleiste
    // @namespace http://forums.mozillazine.org/viewtopic.php?p=2592073#2592073
    // @include main
    // @compatibility Firefox 69
    // @author Alice0775
    // @Note Seitenleistenposition bei _SIDEBARPOSITION wählbar (links oder rechts)
    // @Note Keyconfig und Mousegesten usw. SidebarUI.toggle (entsprechender Code);
    // @Note
    // @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: 400, //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", // Standard Seitenleiste beim Öffnen bei hover
    _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 (Lesezeichen, Chronik usw.) 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 bei 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.forEach(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.slice(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); \
    \
    #main-window #sidebar-splitter \
    { \
    -moz-box-align: center; \
    -moz-box-pack: center; \
    cursor: ew-resize; \
    border-width: 0 2px; \
    border-style: solid; \
    -moz-border-left-colors: ThreeDShadow ThreeDHighlight; \
    -moz-border-right-colors: ThreeDDarkShadow ThreeDFace; \
    width: 2px; \
    max-width: 2px; \
    min-width: 0px; \
    background-color: ThreeDFace; \
    margin-left: 0px; \
    margin-inline-start: 0px; \
    } \
    #navigator-toolbox[inFullscreen="true"] #sidebar-box[hidden="true"] + #sidebar-splitter, \
    #main-window[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 ; \
    z-index: 55555; \
    background-color: -moz-dialog; \
    left: 4px; \
    } \
    #sidebar-box #sidebar-header \
    { \
    width :100%; \
    } \
    #sidebar-box #sidebar \
    { \
    position: fixed ; \
    height: calc(100vh - 210px); \
    border-left:3px solid -moz-dialog; \
    border-right:3px solid -moz-dialog; \
    border-bottom:3px solid -moz-dialog; \
    } \
    \
    #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: -moz-Dialog; \
    } \
    #sidebar-box sidebarheader:-moz-lwtheme { \
    color: -moz-dialogtext; \
    text-shadow: none; \
    background-color: -moz-Dialog; \
    -moz-appearance: toolbox; \
    border-bottom: 1px solid ThreeDShadow; \
    border-top: 1px solid ThreeDHighlight; \
    } \
    #sidebar-box #sidebarpopuppanel-bottom { \
    background-color: -moz-dialog; \
    width:100%; \
    }';
    
    
    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');
    checkbox.setAttribute("id", "sidebar-checkbox");
    checkbox.setAttribute("type", "checkbox");
    checkbox.setAttribute("label", "");
    checkbox.setAttribute("checked", this._CHECKBOX_AT_STARUP);
    checkbox.setAttribute('persist','checked');
    var item = document.getElementById('sidebar-throbber');
    this._checkbox = item.parentNode.insertBefore(checkbox, item);
    
    
    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")) {
    window.ucjs_expand_sidebar.toggleSidebar("");
    }
    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 ("treeStyleTab" in gBrowser)
    gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
    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);
    }
    
    
    //fireSidebarFocusedEventの置き換え
    //
    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();
    }
    }
    
    
    //起動時 閉じておく?
    
    
    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) {
    //サイドバーが開いているならそのサイズを保存しておく
    var hidden = self._sidebar_box.hasAttribute('hidden') ? true : false;
    if (!hidden && self._sidebar_box.getAttribute('collapsed') != "true" ) {
    var size = self._sidebar_box.width;
    //現在のコマンドをget
    var _command = self.getCommandId();
    if (!!_command){
    self._saveKeepItSizes(_command, size);
    }
    }
    }, 500, this);
    break;
    }
    },
    
    
    //負荷軽減のため分離
    _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;
    //オープン直後なら何もしない
    if (self._opend) return;
    //通過しただけなら開かない
    if(!self._CLOSEWHENGOOUT){
    if (self._sidebar_splitter == event.originalTarget){
    if (self._open_Timeout)
    clearTimeout(self._open_Timeout);
    self._open_Timeout = null;
    }
    return;
    }
    //チェックなら閉じない
    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);
    }
    },
    
    
    //現在のコマンドを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 (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(){
    //検索ボックスあれば,そこをフォーカス
    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();
    }, 300, 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") {
    //ウインドウの左端x座標
    if ( 0 <= x && x <= sw + this._TOLERANCE)
    return true;
    }else if(this._SIDEBARPOSITION == "R") {
    //ウインドウの右端x座標
    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") {
    //ウインドウの左端x座標
    if(sw + this._TOLERANCE < x)
    return true;
    } else if(this._SIDEBARPOSITION == "R") {
    //ウインドウの右端x座標
    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;//デフォルトサイドバー幅
    //this.debug(event.target.localName);
    /*
    if(/tabbrowser/.test(event.target.localName)){
    return
    }
    */
    //コンテンツエリアの上下範囲外かどうか
    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;
    //ウインドウの端かどうか
    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座標
    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;
    },
    
    
    //prefを読み込み
    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;
    },
    //prefを書き込み
    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);
    }
    };
    
    
    // エントリポイント
    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

  • Fx 69 Update und meine Scripte

    • Endor
    • 6. September 2019 um 08:09

    Bitte teste mal diese Version, die sollte wieder funktionieren.

    CSS
    // ==UserScript==
    // @name zzzz-MultiRowTab_Lite.uc.js
    // @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
    // @description Experimentelle CSS Version für Mehrzeilige Tableiste
    // @include main
    // @compatibility Firefox 69
    // @author Alice0775
    // @version 2016/08/05 00:00 Firefox 48
    // @version 2016/05/01 00:01 hide favicon if busy
    // @version 2016/03/09 00:01 Bug 1222490 - Actually remove panorama for Fx45+
    // @version 2016/02/09 00:01 workaround css for lwt
    // @version 2016/02/09 00:00
    // ==/UserScript==
    "user strict";
    MultiRowTabLiteforFx();
    function MultiRowTabLiteforFx() {
    var css =` @-moz-document url-prefix("chrome://browser/content/browser.xhtml") {
    /* 多段タブ */
    tabs>arrowscrollbox{display:block;}
    tabs arrowscrollbox>scrollbox{display:flex;display:-webkit-box;flex-wrap:wrap;}
    tabs tab[fadein]:not([pinned]){flex-grow:1;}
    tabs tab,.tab-background {
    height: var(--tab-min-height);
    z-index: 1 !important; }
    tab>.tab-stack{width:100%;}
    [sizemode="fullscreen"] #TabsToolbar>#window-controls,
    .titlebar-buttonbox-container>.titlebar-buttonbox{display:block;}
    /* タブバー 左右のドラッグ領域 非表示
    左右 → hbox.titlebar-spacer
    左 → hbox.titlebar-spacer[type="pre-tabs"]
    右 → hbox.titlebar-spacer[type="post-tabs"] */
    hbox.titlebar-spacer
    /* 非表示 */
    ,#alltabs-button,tabs [class^="scrollbutton"],tabs spacer,[autohide="true"][inactive="true"] .titlebar-buttonbox { display: none; }
    } `;
    var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
    var uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
    sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
    var style = ' \
    tabs tab:not(stack) { \
    border-left: solid 1px hsla(0,0%,50%,.5) !important; \
    border-right: solid 1px hsla(0,0%,50%,.5) !important; \
    } \
    tabs tab:after,tabs tab:before{display:none!important;} \
    ';
    var sspi = document.createProcessingInstruction('xml-stylesheet',
    'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"');
    document.insertBefore(sspi, document.documentElement);
    gBrowser.tabContainer._animateTabMove = function(event){}
    gBrowser.tabContainer._finishAnimateTabMove = function(){}
    gBrowser.tabContainer.lastVisibleTab = function() {
    var tabs = this.allTabs;
    for (let i = tabs.length - 1; i >= 0; i--){
    if (!tabs[i].hasAttribute("hidden"))
    return i;
    }
    return -1;
    }
    gBrowser.tabContainer.clearDropIndicator = function() {
    var tabs = this.allTabs;
    for (let i = 0, len = tabs.length; i < len; i++){
    let tab_s= tabs[i].style;
    tab_s.removeProperty("border-left-color");
    tab_s.removeProperty("border-right-color");
    }
    }
    gBrowser.tabContainer.addEventListener("dragleave",gBrowser.tabContainer.clearDropIndicator, false);
    gBrowser.tabContainer._onDragOver = function(event) {
    event.preventDefault();
    event.stopPropagation();
    this.clearDropIndicator();
    var newIndex = this._getDropIndex(event);
    if (newIndex == null)
    return;
    let children = this.allTabs;
    if (newIndex < children.length) {
    children[newIndex].style.setProperty("border-left-color","red","important");
    } else {
    newIndex = gBrowser.tabContainer.lastVisibleTab();
    if (newIndex >= 0)
    children[newIndex].style.setProperty("border-right-color","red","important");
    }
    }
    gBrowser.tabContainer.addEventListener("dragover", gBrowser.tabContainer._onDragOver, false);
    gBrowser.tabContainer.onDrop = function(event) {
    this.clearDropIndicator();
    var dt = event.dataTransfer;
    var draggedTab;
    if (dt.mozTypesAt(0)[0] == TAB_DROP_TYPE) {
    draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
    if (!draggedTab) {
    return;
    }
    }
    this._tabDropIndicator.hidden = true
    event.stopPropagation();
    if (draggedTab && draggedTab.container == this) {
    let newIndex = this._getDropIndex(event, false);
    if (newIndex > draggedTab._tPos)
    newIndex--;
    gBrowser.moveTabTo(draggedTab, newIndex);
    }
    }
    gBrowser.tabContainer.addEventListener("drop",gBrowser.tabContainer.onDrop, false);
    gBrowser.tabContainer._getDragTargetTab = function(event, isLink) {
    let tab = event.target;
    while (tab && tab.localName != "tab") {
    tab = tab.parentNode;
    }
    if (tab && isLink) {
    let { width } = tab.getBoundingClientRect();
    if (
    event.screenX < tab.screenX + width * 0.25 ||
    event.screenX > tab.screenX + width * 0.75
    ) {
    return null;
    }
    }
    return tab;
    }
    gBrowser.tabContainer._getDropIndex = function(event, isLink) {
    var tabs = this.allTabs;
    var tab = this._getDragTargetTab(event, isLink);
    if (!RTL_UI) {
    for (let i = tab ? tab._tPos : 0; i < tabs.length; i++) {
    if (
    event.screenY <
    tabs[i].screenY + tabs[i].getBoundingClientRect().height
    ) {
    if (
    event.screenX <
    tabs[i].screenX + tabs[i].getBoundingClientRect().width / 2
    ) {
    return i;
    }
    if (
    event.screenX >
    tabs[i].screenX + tabs[i].getBoundingClientRect().width / 2 &&
    event.screenX <
    tabs[i].screenX + tabs[i].getBoundingClientRect().width
    ) {
    return i + 1;
    }
    }
    }
    } else {
    for (let i = tab ? tab._tPos : 0; i < tabs.length; i++) {
    if (
    event.screenY <
    tabs[i].screenY + tabs[i].getBoundingClientRect().height
    ) {
    if (
    event.screenX <
    tabs[i].screenX + tabs[i].getBoundingClientRect().width &&
    event.screenX >
    tabs[i].screenX + tabs[i].getBoundingClientRect().width / 2
    ) {
    return i;
    }
    if (
    event.screenX <
    tabs[i].screenX + tabs[i].getBoundingClientRect().width / 2
    ) {
    return i + 1;
    }
    }
    }
    }
    return tabs.length;
    }
    }
    Alles anzeigen

    Mfg.

    Endor

  • Fx 69 Update und meine Scripte

    • Endor
    • 6. September 2019 um 07:50

    Hallo Joda123.

    Da müsstest Du aborix fragen den er hat das Script wieder zum laufen gebracht.

    Ich kann sowas leider nicht.
    Mfg.

    Endor

  • Fx 69 Update und meine Scripte

    • Endor
    • 5. September 2019 um 17:15

    Teste mal das hier für Geschlossenen Tab mit Mittelklick wieder öffnen:

    Code
    // ==UserScript==
    // @name middle-click "Undo Close Tab"
    // @description Kürzlich geschlossenen Tab mit Mittelklick wieder öffnen
    // @version 1.1
    // @include main
    // @compatibility Firefox ESR31.3, 34.0.5, 69*
    // @author oflow
    // @mod aborix
    // @namespace https://oflow.me/archives/265
    // @note Firefox 31.3, 34.0.5 neuere nicht getestet
    // @note remove arguments.callee
    // @note mTabContainer -> tabContainer
    // ==/UserScript==
    
    (function() {
    
      if (!window.gBrowser)
        return;
    
      var ucjsUndoCloseTab = function(e) {
        // Nur mit Mittelkick
        if (e.button != 1) {
          return;
        }
        // Klick auf Tab-Leiste und die Neuer Tab Schaltflächen
        let node = e.originalTarget;
        while (node.localName != 'tab' && node.localName != 'toolbarbutton' && node.id != 'tabbrowser-tabs') {
          node = node.parentNode;
        }
        if (node.id == 'tabbrowser-tabs' || node.id == 'new-tab-button'
            || node.classList.contains('tabs-newtab-button')) {
          undoCloseTab(0);
          e.preventDefault();
          e.stopPropagation();
        }
      }
    
      // Schaltfläche Neuer Tab
      document.getElementById('new-tab-button').onclick = ucjsUndoCloseTab;
      // Tab-Leiste
      gBrowser.tabContainer.addEventListener('click', ucjsUndoCloseTab, true);
    
    })();
    Alles anzeigen

    Mfg.

    Endor

  • Nighly - Schaltflächen uBlock origin und Stylus verschwunden

    • Endor
    • 26. August 2019 um 15:15

    Prima, freut mich.

    Wie immer gern geschehen.

    Mfg.
    Endor

  • Nighly - Schaltflächen uBlock origin und Stylus verschwunden

    • Endor
    • 26. August 2019 um 14:07

    Hatte letztens ein ähnliches Problem. Obwohl aktiviert waren keine Schaltflächen

    vorhanden. Nirgends. Deaktivieren und aktivieren der entsprechenden Erweiterung

    hat hier geholfen.

    Mfg.

    Endor

  • Kontext-Menü Schriftgrößen u. Farbe anpassen

    • Endor
    • 25. August 2019 um 08:21

    Sollte eigentlich gehen.

    Teste mal:

    CSS
    @-moz-document url-prefix(chrome://browser/content/browser.xul){
    
    #toolbar-context-menu, menuitem, menupopup, popup, menupopup > menu, menupopup menuitem, popup menu, popup menuitem,  {
    font-size:15px!important;
    }
    
    #bookmarks-menu autorepeatbutton,
    #personal-bookmarks autorepeatbutton {
    font-size:14px!important;
    }
    
    #contentAreaContextMenu > menuitem, #contentAreaContextMenu > menu {
    opacity: 0.8 !important;
    }
    }
    Alles anzeigen

    Hoffe das geht so.

    Mfg.
    Endor

  • Kontext-Menü Schriftgrößen u. Farbe anpassen

    • Endor
    • 24. August 2019 um 20:18

    Wie wäre es mit einem CSS Code:

    CSS
    @-moz-document url-prefix(chrome://browser/content/browser.xul){
    
    
    #toolbar-context-menu, menuitem, menupopup, popup, menupopup > menu, menupopup menuitem, popup menu, popup menuitem, #bookmarks-menu autorepeatbutton,
    #personal-bookmarks autorepeatbutton {
    font-size:15px!important;
    }

    Mit obigen wird die Schrift größer Wert nach Deinen Wünschen anpassen.

    Mfg.
    Endor

  • Wie kann ich Kontextmenüs von Erweiterungen mit dem Inspektor untersuchen?

    • Endor
    • 24. August 2019 um 19:47

    Hallo Bege.

    Da Erweiterungen eigentlich auch zur Firefox Oberfläche gehören,

    müsste man die auch mit Browser-Werkzeugen und den Inspektor

    bearbeiten. Leider klemmt das aber eben bei Kontextmenüs von Erweiterungen.

    Habe hier das selbe Problem mit der Erweiterung X-notifier.

    Mit dem normalen Inspektor kann man nur Seiteninhalt inspizieren.

    Mfg.
    Endor

Unterstütze uns!

Jährlich (2025)

105,8 %

105,8% (687,41 von 650 EUR)

Jetzt spenden
  1. Kontakt
  2. Datenschutz
  3. Impressum
Community-Software: WoltLab Suite™
Mastodon