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. Boersenfeger

Beiträge von Boersenfeger

  • Hamburger Überhangmenü - Symbolleiste anpassen

    • Boersenfeger
    • 23. August 2021 um 14:29
    Zitat von 2002Andreas

    Wichtig dabei, die @Importregel muss dann ganz oben in der userChrome.css stehen, also noch vor allen anderen Codes die du darin hast.

    Ich habe früher, vor der Nutzung des LoaderScripts, nur die Importregeln in der userChrome.css stehen. Es gibt ja eigentlich auch keinen Grund dort noch anderen Code drin zu haben..

  • Hamburger Überhangmenü - Symbolleiste anpassen

    • Boersenfeger
    • 23. August 2021 um 12:51
    Zitat


    ich finde es einfach nicht meht in meinen css Wirrwarr

    @laubenpieper

    Ggf. gibst du jedem Code einen aussagekräftigen Namen...

  • UserCSSLoaderScript funktioniert nicht in Thunderbird

    • Boersenfeger
    • 23. August 2021 um 10:03

    Vielen Dank, dann müssen wir damit leben :thumbup: :saint:

  • Suche von "поиск" (russ.: Suche) übernommen

    • Boersenfeger
    • 22. August 2021 um 18:34

    Nun ists aber doppelt da teilweise..

    Ist ja auch egal. Das Problem scheint behoben... oder doch nicht?

  • Suche von "поиск" (russ.: Suche) übernommen

    • Boersenfeger
    • 21. August 2021 um 10:39
    Zitat von mgraeme

    Den Norton muss ich wohl endgültig von der Festplatte verbannen.

    unbedingt....

  • Meldung Passwort speichern wird nicht angezeigt

    • Boersenfeger
    • 20. August 2021 um 13:40

    Lies mal

    Benutzername und Passwort werden nicht gespeichert | Hilfe zu Firefox

  • Plötzlich weißer Hintergrund

    • Boersenfeger
    • 19. August 2021 um 16:44

    Zum Beispiel, das die Mac-Nutzer explizit nach Installation darauf hingewiesen werden? Keine Ahnung, nutze ein anderes Biotop.

  • Plötzlich weißer Hintergrund

    • Boersenfeger
    • 19. August 2021 um 16:19

    :thumbup: Stimmt, ich gehe aber davon aus, das es bald gefixt wird...

    Und UpDates sind eh immer gut....

  • Plötzlich weißer Hintergrund

    • Boersenfeger
    • 19. August 2021 um 15:19

    ... was mal wieder für ein zügiges Einspielen von UpDates spricht... :)

  • Wie erreiche ich es, dass heruntergeladene Dateien in der Fußleiste angezeigt werden?

    • Boersenfeger
    • 19. August 2021 um 14:33

    Gerne... :)

    BTW: Seit 4.7.2019 hat die Erweiterung kein UpDate mehr erhalten... Auch im Mozillazine kommuniziert der Entwickler seit langem nicht mehr... ggf. kommt da auch nix mehr; auf der Addons-Webseite sind 3 Bugs notiert. Inwieweit die für dich relevant sind, musst du austesten..

  • Wie erreiche ich es, dass heruntergeladene Dateien in der Fußleiste angezeigt werden?

    • Boersenfeger
    • 19. August 2021 um 13:12

    Eine Leiste bekommst du auch mit diesem Script

    JavaScript
    // ==UserScript==
    // @name           ucjsDownloadsStatusModoki.uc.js
    // @namespace      http://space.geocities.yahoo.co.jp/gl/alice0775
    // @description    Downloads Status Modoki
    // @include        main
    // @compatibility  Firefox 73+
    // @author         Alice0775
    // @note           ucjsDownloadsStatusModoki.uc.js.css をuserChrome.cssに読み込ませる必要あり
    // @version       2019/12/11 fix for 73 Bug 1601094 - Rename remaining .xul files to .xhtml in browser
    // @version        2019/10/20 12:30 workaround Bug 1497200: Apply Meta CSP to about:downloads, Bug 1513325 - Remove textbox binding
    // @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 { 
            -moz-box-orient: horizontal; 
            width: 485px !important; 
            min-width: 485px !important; 
            max-width: 485px !important; 
            max-height: 100px !important; 
            height: 28px !important;
            background-color: rgba(0,0,0,0) !important;
            margin-top: -28px !important; 
          } 
         `.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("main-window");
        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.xhtml?StatusModoki");
        var menuitem = document.createXULElement("menuitem");
        menuitem.setAttribute("id", "toggle_downloadsStatusModokiBar");
        menuitem.setAttribute("type", "checkbox");
        menuitem.setAttribute("autocheck", false);
        menuitem.setAttribute("label", "Downloads Status Modoki Bar");
        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 = true;
          try {
            closeWhenDone = Services.prefs.getBoolPref("userChrome.downloadsStatusModoki.closeWhenDone");
          } catch(e) {}
          if (closeWhenDone) {
            this.hideDownloadsStatusModoki();
          }
        }
      },
    
    
    
      // chrome://browser/content/downloads/contentAreaDownloadsView.xhtml
      onload: function(event) {
        var doc = event.originalTarget;
        var win = doc.defaultView;
        doc.documentElement.setAttribute("ucjsDownloadsStatusModoki", "true");
    
        var button = doc.createXULElement("button");
        button.setAttribute("label", "Löschen");
        button.setAttribute("id", "ucjs_clearListButton");
        button.setAttribute("accesskey", "L");
        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.createElementNS("http://www.w3.org/1999/xhtml", "input");
        textbox.setAttribute("id", "downloadFilter");
        textbox.setAttribute("clickSelectsAll", true);
        textbox.setAttribute("type", "search");
        textbox.setAttribute("placeholder", "Suche...");
        box.appendChild(textbox);
        var closebtn = doc.createXULElement("toolbarbutton");
        closebtn.setAttribute("id", "ucjsDownloadsStatusModoki-closebutton");
        closebtn.setAttribute("class", "close-icon");
        closebtn.setAttribute("tooltiptext", "Close this bar");
        box.appendChild(closebtn);
        ref.parentNode.insertBefore(vbox, ref);
        doc.getElementById("ucjs_clearListButton").addEventListener("command", function(event) {
            win.ucjsDownloadsStatusModoki_clearDownloads();
          });
        doc.getElementById("downloadFilter")
                .addEventListener("input", function(event) {
            win.ucjsDownloadsStatusModoki_doSearch(event.target.value);
          });
        doc.getElementById("ucjsDownloadsStatusModoki-closebutton")
                .addEventListener("command", function(event) {
            win.ucjsDownloadsStatusModoki_doClose();
          });
        
    /*
        // 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; /* customizeable 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
  • UserCSSLoaderScript funktioniert nicht in Thunderbird

    • Boersenfeger
    • 18. August 2021 um 17:31

    aborix

    Magst du dir das mal anschauen... ggf drüben im TB-Forum?

    UserCSSLoader.uc.js arbeitet in TB 91nicht, in FF 91schon. - Thunderbird Mail DE
    Ich habe versucht mittels im Titel genannten Script die css-Dateien zu laden. Klappt aber nicht. Kann vielleicht jemand Hilfestellung geben? In Firefox 91…
    www.thunderbird-mail.de
  • Hamburger Menü in Firefox Version 91

    • Boersenfeger
    • 18. August 2021 um 17:15

    //

    Zitat von Sören Hentzschel

    Man sollte also jedes Mal, wenn man wieder auf eine weitere Weise seinen Browser verbiegt, demütig und vor allem auch Mozilla gegenüber dankbar sein.

    Bei aller Zustimmung zu deiner Intention und bei allem Verständnis für deine Meinung, aber Demut sollte man gewiss keinem "popeligen" Browser oder deren Hersteller gegenüber aufbringen.

    Da gibts in diesen Tagen wahrhaft Wichtigeres... :)

  • LZ hinzufügen direkt im Ordner ?

    • Boersenfeger
    • 18. August 2021 um 16:24

    Ich nutze dafür diese Erweiterung

    Default Bookmark Folder – Holen Sie sich diese Erweiterung für 🦊 Firefox (de)
    Laden Sie Default Bookmark Folder für Firefox herunter. Allows you to choose the default bookmark location folder and quickly bookmark pages via a dedicated…
    addons.mozilla.org

    Ein erster Versuch mit LiceCab :S

  • UserCSSLoaderScript funktioniert nicht in Thunderbird

    • Boersenfeger
    • 18. August 2021 um 15:54

    Es gibt übrigens eine neue Version des CSSLoaderScripts mit der Angabe eines anderen Dateimanagers und dem Styles importieren via Mittelklick...

    JavaScript
    // ==UserScript==
    // @name           UserCSSLoader
    // @description    CSS Codes - Styles laden und verwalten
    // @namespace      http://d.hatena.ne.jp/Griever/
    // @author         Griever
    // @include        main
    // @license        MIT License
    // @compatibility  Firefox 4 - 61*
    // @charset        UTF-8
    // @version        0.0.4g
    // @note           Version 0.0.4.g ermoeglicht "Styles importieren" per Mittelklick und Verwendung
    // @note           eines anderen Dateimanager (s. vFileManager in Zeile 54)
    // @note           ergänzt um einen Parameter für den Dateimanager (s. vFMParameter in Zeile 56) von aborix
    // @note           Frei verschiebbare Schaltfläche eingebaut von aborix 
    // @note           0.0.4 Remove E4X
    // @note           CSSEntry-Klasse erstellt
    // @note           Style-Test-Funktion überarbeitet
    // @note           Wenn die Datei gelöscht wurde, CSS beim Neu erstellen und Löschen des Menüs abbrechen
    // @note           uc einlesen .uc.css temporäre Korrespondenz zum erneuten Lesen
    // ==/UserScript==
    
    /****** Bedienungsanleitung ******
    
    Da der CSS-Ordner im Chrome-Ordner erstellt wurde, CSS-Dateien dort ablegen - speichern.
    Diejenigen, deren Dateiname mit "xul-" beginnen, diejenigen, die mit ".as.css" enden, sind AGENT_SHEET, 
    andere außer USER_SHEET werden gelesen. Da der Inhalt der Datei nicht überprüft wird,
    darauf achten, @ Namespace Angabe nicht zu vergessen!
    
    CSS-Menü wird zur Menüleiste hinzugefügt
    Linksklick auf Stil, zum aktivieren/deaktivieren
    Mittelklick auf Stil zum aktivieren/deaktivieren, ohne Menü zu schließen
    Rechtsklick auf Stil zum Öffnen im Editor
    
    Verwenden des in "view_source.editor.path" angegebenen Editors
    Ordner kann geändert werden, indem ein Pfad in "UserCSSLoader.FOLDER" eingefügt wird
    
     **** Anleitung Ende ****/
    
    (function(){
    
    let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
    if (!window.Services)
        Cu.import("resource://gre/modules/Services.jsm");
    // Wenn beim Start ein anderes Fenster angezeigt wird (das zweite Fenster), wird es beendet
    let list = Services.wm.getEnumerator("navigator:browser");
    while(list.hasMoreElements()){ if(list.getNext() != window) return; }
    
    if (window.UCL) {
        window.UCL.destroy();
        delete window.UCL;
    }
    
    window.UCL = {
        vFileManager: 'H:\\TotalCommander\\TotalCmd64.exe',
        vFMParameter: '/T',
        USE_UC: "UC" in window,
        AGENT_SHEET: Ci.nsIStyleSheetService.AGENT_SHEET,
        USER_SHEET : Ci.nsIStyleSheetService.USER_SHEET,
        readCSS    : {},
        get disabled_list() {
            let obj = [];
            try {
                obj = this.prefs.getCharPref("disabled_list").split("|");
            } catch(e) {}
            delete this.disabled_list;
            return this.disabled_list = obj;
        },
        get prefs() {
            delete this.prefs;
            return this.prefs = Services.prefs.getBranch("UserCSSLoader.")
        },
        get styleSheetServices(){
            delete this.styleSheetServices;
            return this.styleSheetServices = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
        },
        get FOLDER() {
            let aFolder;
            try {
                // UserCSSLoader.FOLDER verwenden
                let folderPath = this.prefs.getCharPref("FOLDER");
                aFolder = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile)
                aFolder.initWithPath(folderPath);
            } catch (e) {
                aFolder = Services.dirsvc.get("UChrm", Ci.nsIFile);
                aFolder.appendRelativePath("CSS");
            }
            if (!aFolder.exists() || !aFolder.isDirectory()) {
                aFolder.create(Ci.nsIFile.DIRECTORY_TYPE, 0664);
            }
            delete this.FOLDER;
            return this.FOLDER = aFolder;
        },
        getFocusedWindow: function() {
            let win = document.commandDispatcher.focusedWindow;
            if (!win || win == window) win = content;
            return win;
        },
    
        init: function() {
            const cssmenu = $C("menu", {
                id: "usercssloader-menu",
                label: "CSS",
                accesskey: "C",
                onclick: "if (event.button == 1) UCL.rebuild()"
            });
            const menupopup = $C("menupopup", {
                id: "usercssloader-menupopup"
            });
            cssmenu.appendChild(menupopup);
    
            let menu = $C("menu", {
                label: "Style Loader Menü",
                id: "style-loader-menu",
                accesskey: "M"
            });
            menupopup.appendChild(menu);
            let mp = $C("menupopup", {
                id: "usercssloader-submenupopup" });
            menu.appendChild(mp);
            mp.appendChild($C("menuitem", {
                label: "Styles importieren",
                accesskey: "R",
                acceltext: "Alt + R",
                oncommand: "UCL.rebuild();"
            }));
            mp.appendChild($C("menuseparator"));
            mp.appendChild($C("menuitem", {
                label: "CSS Datei erstellen",
                accesskey: "D",
                oncommand: "UCL.create();"
            }));
            mp.appendChild($C("menuitem", {
                label: "CSS Ordner öffnen",
                accesskey: "O",
                oncommand: "UCL.openFolder();"
            }));
            mp.appendChild($C("menuitem", {
                label: "userChrome.css bearbeiten",
                hidden: false,
                oncommand: "UCL.editUserCSS(\'userChrome.css\');"
            }));
            mp.appendChild($C("menuitem", {
                label: "userContent.css bearbeiten",
                hidden: false,
                oncommand: "UCL.editUserCSS(\'userContent.css\');"
            }));
                    // mp.appendChild($C("menuitem", {
                // label: "UserCSSLoader.disabled_list bearbeiten",
                // hidden: false,
                // oncommand: "UCL.editUserCSS(\'UserCSSLoader.disabled_list\');"
            // }));
            mp.appendChild($C("menuseparator"));
            mp.appendChild($C("menuitem", {
                label: "Style Test (Chrome)",
                id: "usercssloader-test-chrome",
                hidden: true,
                accesskey: "C",
                oncommand: "UCL.styleTest(window);"
            }));
            mp.appendChild($C("menuitem", {
                label: "Style Test (Web)",
                id: "usercssloader-test-content",
                hidden: true,
                accesskey: "W",
                oncommand: "UCL.styleTest();"
            }));
            mp.appendChild($C("menuitem", {
                label: "Styles dieser Seite auf userstyles.org finden",
                hidden: true,
                accesskey: "S",
                oncommand: "UCL.searchStyle();"
            }));
    
            menu = $C("menu", {
                label: ".uc.css",
                accesskey: "U",
                hidden: !UCL.USE_UC
            });
            menupopup.appendChild(menu);
            mp = $C("menupopup", { id: "usercssloader-ucmenupopup" });
            menu.appendChild(mp);
            mp.appendChild($C("menuitem", {
                label: "Importieren(.uc.js)",
                oncommand: "UCL.UCrebuild();"
            }));
            mp.appendChild($C("menuseparator", { id: "usercssloader-ucseparator" }));
    
            $('mail-menubar').appendChild(cssmenu);
    
            $("mailKeys").appendChild($C("key", {
                id: "usercssloader-rebuild-key",
                oncommand: "UCL.rebuild();",
                key: "R",
                modifiers: "alt",
            }));
            this.rebuild();
            this.initialized = true;
            if (UCL.USE_UC) {
                setTimeout(function() {
                    UCL.UCcreateMenuitem();
                }, 1000);
            }
            window.addEventListener("unload", this, false);
        },
        uninit: function() {
            const dis = [];
            for (let x of Object.keys(this.readCSS)) {
                if (!this.readCSS[x].enabled)
                    dis.push(x);
            }
            this.prefs.setCharPref("disabled_list", dis.join("|"));
            window.removeEventListener("unload", this, false);
        },
        destroy: function() {
            var i = document.getElementById("usercssloader-menu");
            if (i) i.parentNode.removeChild(i);
            var i = document.getElementById("usercssloader-rebuild-key");
            if (i) i.parentNode.removeChild(i);
            this.uninit();
        },
        handleEvent: function(event) {
            switch(event.type){
                case "unload": this.uninit(); break;
            }
        },
        rebuild: function() {
            let ext = /\.css$/i;
            let not = /\.uc\.css/i;
            let files = this.FOLDER.directoryEntries.QueryInterface(Ci.nsISimpleEnumerator);
            while (files.hasMoreElements()) {
                let file = files.getNext().QueryInterface(Ci.nsIFile);
                if (!ext.test(file.leafName) || not.test(file.leafName)) continue;
                let CSS = this.loadCSS(file);
                CSS.flag = true;
            }
            for (let leafName of Object.keys(this.readCSS)) {
                const CSS = this.readCSS[leafName];
                if (!CSS.flag) {
                    CSS.enabled = false;
                    delete this.readCSS[leafName];
                }
                delete CSS.flag;
                this.rebuildMenu(leafName);
            }
            if (this.initialized) {
                if (typeof(StatusPanel) !== "undefined")
                    StatusPanel._label = "Style importiert";
                else
                    XULBrowserWindow.statusTextField.label = "Styles importieren";
            }
        },
        loadCSS: function(aFile) {
            var CSS = this.readCSS[aFile.leafName];
            if (!CSS) {
                CSS = this.readCSS[aFile.leafName] = new CSSEntry(aFile);
                if (this.disabled_list.indexOf(CSS.leafName) === -1) {
                    CSS.enabled = true;
                }
            } else if (CSS.enabled) {
                CSS.enabled = true;
            }
            return CSS;
        },
        rebuildMenu: function(aLeafName) {
            var CSS = this.readCSS[aLeafName];
            var menuitem = document.getElementById("usercssloader-" + aLeafName);
            if (!CSS) {
                if (menuitem)
                    menuitem.parentNode.removeChild(menuitem);
                return;
            }
            if (!menuitem) {
                menuitem = document.createXULElement("menuitem");
                menuitem.setAttribute("label", aLeafName);
                menuitem.setAttribute("id", "usercssloader-" + aLeafName);
                menuitem.setAttribute("class", "usercssloader-item " + (CSS.SHEET == this.AGENT_SHEET? "AGENT_SHEET" : "USER_SHEET"));
                menuitem.setAttribute("type", "checkbox");
                menuitem.setAttribute("autocheck", "false");
                menuitem.setAttribute("oncommand", "UCL.toggle('"+ aLeafName +"');");
                menuitem.setAttribute("onclick", "UCL.itemClick(event);");
                menuitem.setAttribute("onmouseup", "if (event.button == 1) event.preventDefault();");
                document.getElementById("usercssloader-menupopup").appendChild(menuitem);
            }
            menuitem.setAttribute("checked", CSS.enabled);
        },
        toggle: function(aLeafName) {
            var CSS = this.readCSS[aLeafName];
            if (!CSS) return;
            CSS.enabled = !CSS.enabled;
            this.rebuildMenu(aLeafName);
        },
        itemClick: function(event) {
            if (event.button == 0) return;
            event.preventDefault();
            event.stopPropagation();
            let label = event.currentTarget.getAttribute("label");
            if (event.button == 1) {
                this.toggle(label);
            }
            else if (event.button == 2) {
                // closeMenus(event.target);
                let file = this.getFileFromLeafName(label)
                this.edit(file);
            }
        },
        getFileFromLeafName: function(aLeafName) {
            let f = this.FOLDER.clone();
            f.QueryInterface(Ci.nsIFile); // use appendRelativePath
            f.appendRelativePath(aLeafName);
            return f;
        },
        styleTest: function(aWindow) {
            aWindow || (aWindow = this.getFocusedWindow());
            new CSSTester(aWindow, function(tester){
                if (tester.saved)
                    UCL.rebuild();
            });
        },
        searchStyle: function() {
            let word;
            try {
                word = gBrowser.currentURI.host;
            } catch {
                word = gBrowser.currentURI.spec;
            }
            openWebLinkIn("https://userstyles.org/styles/search/" + word, "tab", {});
        },
        openFolder:function(){
            if (this.vFileManager.length != 0) {
                var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
                var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
                var args=[this.vFMParameter,this.FOLDER.path];
                file.initWithPath(this.vFileManager);
                process.init(file);
                // Verzeichnis mit anderem Dateimanager öffnen
                process.run(false, args, args.length);
            } else {
                // Verzeichnis mit Dateimanager des Systems öffnen
                this.FOLDER.launch();
            }
        },
        editUserCSS: function(aLeafName) {
            let file = Services.dirsvc.get("UChrm", Ci.nsIFile);
            file.appendRelativePath(aLeafName);
            this.edit(file);
        },
        edit: function(aFile) {
            var editor = Services.prefs.getCharPref("view_source.editor.path");
            if (!editor) return alert("Unter about:config den vorhandenen Schalter:\n view_source.editor.path mit dem Editorpfad ergänzen");
            try {
                var UI = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
                UI.charset = window.navigator.platform.toLowerCase().indexOf("win") >= 0? "Shift_JIS": "UTF-8";
                var path = UI.ConvertFromUnicode(aFile.path);
                var app = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);
                app.initWithPath(editor);
                var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
                process.init(app);
                process.run(false, [path], 1);
            } catch (e) {}
        },
        create: function(aLeafName) {
            if (!aLeafName) aLeafName = prompt("Name des Styles", dateFormat(new Date(), "%Y_%m%d_%H%M%S"));
            if (aLeafName) aLeafName = aLeafName.replace(/\s+/g, " ").replace(/[\\/:*?\"<>|]/g, "");
            if (!aLeafName || !/\S/.test(aLeafName)) return;
            if (!/\.css$/.test(aLeafName)) aLeafName += ".css";
            let file = this.getFileFromLeafName(aLeafName);
            this.edit(file);
        },
        UCrebuild: function() {
            let re = /^file:.*\.uc\.css(?:\?\d+)?$/i;
            let query = "?" + new Date().getTime();
            [...document.styleSheets].slice().forEach(function(css){
                if (!re.test(css.href)) return;
                if (css.ownerNode) {
                    css.ownerNode.parentNode.removeChild(css.ownerNode);
                }
                let pi = document.createProcessingInstruction('xml-stylesheet','type="text/css" href="'+ css.href.replace(/\?.*/, '') + query +'"');
                document.insertBefore(pi, document.documentElement);
            });
            UCL.UCcreateMenuitem();
        },
        UCcreateMenuitem: function() {
            let sep = $("usercssloader-ucseparator");
            let popup = sep.parentNode;
            if (sep.nextSibling) {
                let range = document.createRange();
                range.setStartAfter(sep);
                range.setEndAfter(popup.lastChild);
                range.deleteContents();
                range.detach();
            }
    
            let re = /^file:.*\.uc\.css(?:\?\d+)?$/i;
            [...document.styleSheets].slice().forEach(function(css) {
                if (!re.test(css.href)) return;
                let fileURL = decodeURIComponent(css.href).split("?")[0];
                let aLeafName = fileURL.split("/").pop();
                let m = document.createXULElement("menuitem");
                m.setAttribute("label", aLeafName);
                m.setAttribute("tooltiptext", fileURL);
                m.setAttribute("id", "usercssloader-" + aLeafName);
                m.setAttribute("type", "checkbox");
                m.setAttribute("autocheck", "false");
                m.setAttribute("checked", "true");
                m.setAttribute("oncommand", "this.setAttribute('checked', !(this.css.disabled = !this.css.disabled));");
                m.setAttribute("onclick", "UCL.UCItemClick(event);");
                m.css = css;
                popup.appendChild(m);
            });
        },
        UCItemClick: function(event) {
            if (event.button == 0) return;
            event.preventDefault();
            event.stopPropagation();
    
            if (event.button == 1) {
                event.target.doCommand();
            }
            else if (event.button == 2) {
                closeMenus(event.target);
                let fileURL = event.currentTarget.getAttribute("tooltiptext");
                let file = Services.io.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler).getFileFromURLSpec(fileURL);
                this.edit(file);
            }
        },
    };
    
    function CSSEntry(aFile) {
        this.path = aFile.path;
        this.leafName = aFile.leafName;
        this.lastModifiedTime = 1;
        this.SHEET = /^xul-|\.as\.css$/i.test(this.leafName) ? 
            Ci.nsIStyleSheetService.AGENT_SHEET: 
            Ci.nsIStyleSheetService.USER_SHEET;
    }
    CSSEntry.prototype = {
        sss: Components.classes["@mozilla.org/content/style-sheet-service;1"]
                        .getService(Components.interfaces.nsIStyleSheetService),
        _enabled: false,
        get enabled() {
            return this._enabled;
        },
        set enabled(isEnable) {
            var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile)
            aFile.initWithPath(this.path);
        
            var isExists = aFile.exists(); // Wenn die Datei existiert true
            var lastModifiedTime = isExists ? aFile.lastModifiedTime : 0;
            var isForced = this.lastModifiedTime != lastModifiedTime; // Wenn es eine Änderung in der Datei gibt true
    
            var fileURL = Services.io.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler).getURLSpecFromFile(aFile);
            var uri = Services.io.newURI(fileURL, null, null);
    
            if (this.sss.sheetRegistered(uri, this.SHEET)) {
                // Wenn diese Datei bereits gelesen wurde
                if (!isEnable || !isExists) {
                    this.sss.unregisterSheet(uri, this.SHEET);
                }
                else if (isForced) {
                    // Nach Stornierung erneut einlesen
                    this.sss.unregisterSheet(uri, this.SHEET);
                    this.sss.loadAndRegisterSheet(uri, this.SHEET);
                }
            } else {
                // Datei wurde nicht gelesen
                if (isEnable && isExists) {
                    this.sss.loadAndRegisterSheet(uri, this.SHEET);
                }
            }
            if (this.lastModifiedTime !== 1 && isEnable && isForced) {
                log(this.leafName + " wurde aktualisiert");
            }
            this.lastModifiedTime = lastModifiedTime;
            return this._enabled = isEnable;
        },
    };
    
    function CSSTester(aWindow, aCallback) {
        this.win = aWindow || window;
        this.doc = this.win.document;
        this.callback = aCallback;
        this.init();
    }
    CSSTester.prototype = {
        sss: Components.classes["@mozilla.org/content/style-sheet-service;1"]
                        .getService(Components.interfaces.nsIStyleSheetService),
        preview_code: "",
        saved: false,
        init: function() {
            this.dialog = openDialog(
                "data:text/html;charset=utf8,"+encodeURIComponent('<!DOCTYPE HTML><html lang="ja"><head><title>CSSTester</title></head><body></body></html>'),
                "",
                "width=550,height=400,dialog=no");
            this.dialog.addEventListener("load", this, false);
        },
        destroy: function() {
            this.preview_end();
            this.dialog.removeEventListener("unload", this, false);
            this.previewButton.removeEventListener("click", this, false);
            this.saveButton.removeEventListener("click", this, false);
            this.closeButton.removeEventListener("click", this, false);
        },
        handleEvent: function(event) {
            switch(event.type) {
                case "click":
                    if (event.button != 0) return;
                    if (this.previewButton == event.currentTarget) {
                        this.preview();
                    }
                    else if (this.saveButton == event.currentTarget) {
                        this.save();
                    }
                    else if (this.closeButton == event.currentTarget) {
                        this.dialog.close();
                    }
                    break;
                case "load":
                    var doc = this.dialog.document;
                    doc.body.innerHTML = '\
                        <style type="text/css">\
                            :not(input):not(select) { padding: 0px; margin: 0px; }\
                            table { border-spacing: 0px; }\
                            body, html, #main, #textarea { width: 100%; height: 100%; }\
                            #textarea { font-family: monospace; }\
                        </style>\
                        <table id="main">\
                            <tr height="100%">\
                                <td colspan="4"><textarea id="textarea"></textarea></td>\
                            </tr>\
                            <tr height="40">\
                                <td><input type="button" value="Vorschau" id="Vorschau"/></td>\
                                <td><input type="button" value="Speichern" id="Speichern"/></td>\
                                <td width="80%"><span class="log"></span></td>\
                                <td><input type="button" value="Schließen" id="Schliessen"/></td>\
                            </tr>\
                        </table>\
                    ';
                    this.textbox = doc.querySelector("textarea");
                    this.previewButton = doc.querySelector('input[value="Vorschau"]');
                    this.saveButton = doc.querySelector('input[value="Speichern"]');
                    this.closeButton = doc.querySelector('input[value="Schließen"]');
                    this.logField = doc.querySelector('.log');
    
                    var code = "@namespace url(" + this.doc.documentElement.namespaceURI + ");\n";
                    code += this.win.location.protocol.indexOf("http") === 0?
                        "@-moz-document domain(" + this.win.location.host + ") {\n\n\n\n}":
                        "@-moz-document url(" + this.win.location.href + ") {\n\n\n\n}";
                    this.textbox.value = code;
                    this.dialog.addEventListener("unload", this, false);
                    this.previewButton.addEventListener("click", this, false);
                    this.saveButton.addEventListener("click", this, false);
                    this.closeButton.addEventListener("click", this, false);
    
                    this.textbox.focus();
                    let p = this.textbox.value.length - 3;
                    this.textbox.setSelectionRange(p, p);
    
                    break;
                case "unload":
                    this.destroy();
                    this.callback(this);
                    break;
            }
        },
        preview: function() {
            var code = this.textbox.value;
            if (!code || !/\:/.test(code))
                return;
            code = "data:text/css;charset=utf-8," + encodeURIComponent(this.textbox.value);
            if (code == this.preview_code)
                return;
            this.preview_end();
            var uri = Services.io.newURI(code, null, null);
            this.sss.loadAndRegisterSheet(uri, Ci.nsIStyleSheetService.AGENT_SHEET);
            this.preview_code = code;
            this.log("Preview");
        },
        preview_end: function() {
            if (this.preview_code) {
                let uri = Services.io.newURI(this.preview_code, null, null);
                this.sss.unregisterSheet(uri, Ci.nsIStyleSheetService.AGENT_SHEET);
                this.preview_code = "";
            }
        },
        save: function() {
            var data = this.textbox.value;
            if (!data) return;
    
            var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
            fp.init(window, "", Ci.nsIFilePicker.modeSave);
            fp.appendFilter("CSS Files","*.css");
            fp.defaultExtension = "css";
            if (window.UCL)
                fp.displayDirectory = UCL.FOLDER;
            var res = fp.show();
            if (res != fp.returnOK && res != fp.returnReplace) return;
    
            var suConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
            suConverter.charset = "UTF-8";
            data = suConverter.ConvertFromUnicode(data);
            var foStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
            foStream.init(fp.file, 0x02 | 0x08 | 0x20, 0664, 0);
            foStream.write(data, data.length);
            foStream.close();
            this.saved = true;
        },
        log: function() {
            this.logField.textContent = dateFormat(new Date(), "%H:%M:%S") + ": " + $A(arguments);
        }
    };
    
    UCL.init();
    
    function $(id) { return document.getElementById(id); }
    function $A(arr) { return [...arr].slice(); }
    function $C(name, attr) {
        var el = document.createXULElement(name);
        if (attr) Object.keys(attr).forEach(function(n) { el.setAttribute(n, attr[n]) });
        return el;
    }
    function dateFormat(date, format) {
        format = format.replace("%Y", ("000" + date.getFullYear()).substr(-4));
        format = format.replace("%m", ("0" + (date.getMonth()+1)).substr(-2));
        format = format.replace("%d", ("0" + date.getDay()).substr(-2));
        format = format.replace("%H", ("0" + date.getHours()).substr(-2));
        format = format.replace("%M", ("0" + date.getMinutes()).substr(-2));
        format = format.replace("%S", ("0" + date.getSeconds()).substr(-2));
        return format;
    }
    
    function log() { Application.console.log([...arguments].slice()); }
    
    })();
    Alles anzeigen
  • UserCSSLoaderScript funktioniert nicht in Thunderbird

    • Boersenfeger
    • 18. August 2021 um 15:41

    Du hast immer noch ein Verständnisproblem....

    Das Script funktioniert bei Dir nicht im TB 91... dieses lädt die CSS-Codes.... klar das dann keine erscheinen!

    Da hier der falsche Ort für diese Thematik ist bitte ich dich inständig im TB-Forum weiterzumachen und dort die gestellten Fragen zu beantworten! 8)

  • UserCSSLoaderScript funktioniert nicht in Thunderbird

    • Boersenfeger
    • 18. August 2021 um 15:18

    Er nutzt das Script.. die Diskussion findet auch im TB-Forum statt

    UserCSSLoader.uc.js arbeitet in TB 91, nicht in FF 91 - Thunderbird Mail DE
    Ich habe versucht mittels im Titel genannten Script die css-Dateien zu laden. Klappt aber nicht. Kann vielleicht jemand Hilfestellung geben? In Firefox 91…
    www.thunderbird-mail.de
  • Klicken Sie mit der mittleren Maustaste auf Undo Close Tab für Firefox 92?

    • Boersenfeger
    • 18. August 2021 um 11:36

    BTW:

    -moz-appearance: heißt jetzt appearance:

  • Sidebar via Hover Kontextmenü ergänzen

    • Boersenfeger
    • 18. August 2021 um 11:05

    Bingo, da war ein Minuswert eingetragen... Vielen Dank! :) :thumbup:

  • UpdateBookmark2.uc.js

    • Boersenfeger
    • 18. August 2021 um 11:01

    Ah, danke... :)

Unterstütze uns!

Jährlich (2026)

76,1 %

76,1% (589,79 von 775 EUR)

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