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

Beiträge von aborix

  • Entladene Tabs werden nach Neustart nicht korrekt geladen

    • aborix
    • 19. Dezember 2021 um 22:23

    Bei mir funktioniert das Skript wie es soll und beim Klick auf einen ungeladenen Tab wird dieser sofort geladen. Ich habe noch folgenden Vorschlag zum Testen: Teste in einem neuen Profil, das nur dieses Skript enthält, keine anderen Skripte, keine Erweiterungen und auch sonst unverändert ist. Wenn es auch dann nicht funktioniert, teste in diesem Profil mit weniger Tabs.

  • userChrome.js Scripte für den Fuchs (Diskussion)

    • aborix
    • 17. Dezember 2021 um 12:14

    Teste bitte:

    JavaScript
    (function() {
      document.getElementById("tabbrowser-arrowscrollbox").addEventListener("dblclick", function(e) {
        if (e.originalTarget.localName != "toolbarbutton" && e.button == 0) {
          e.preventDefault();
          e.stopPropagation();
          BrowserOpenTab();
        }
      });
    })();
  • userChrome.js Scripte für den Fuchs (Diskussion)

    • aborix
    • 16. Dezember 2021 um 23:12
    Zitat von pro100user

    Hallo liebe Freunde. Hilfe, bitte anpassen sie dieses Skript für Firefox 95+

    Bitte schön:

    JavaScript
    // Double click on tabs toolbar opens a new tab
    
    (function() {
      document.getElementById("tabbrowser-arrowscrollbox").addEventListener("dblclick", function(e) {
        if (e.originalTarget.localName == "scrollbox" && e.button == 0) {
          e.preventDefault();
          e.stopPropagation();
          BrowserOpenTab();
        }
      }, false);
    })();
    Alles anzeigen
  • FF-Fenster - Anzahl und Focus feststellbar?

    • aborix
    • 14. Dezember 2021 um 11:36

    Vielleicht ist hier etwas Brauchbares dabei:

    Detect Browser lost focus in CSS
    I saw this functionality in a design a while back and thought "hay, that looks like a good idea". But looking further into it, I'm not sure it's entirely…
    stackoverflow.com

    Die Anzahl der Fenster und das aktive kann man so erhalten:

    JavaScript
    let E = Services.wm.getEnumerator('navigator:browser');
    let n = 0;
    while (E.hasMoreElements()) {
      E.getNext();
      n++;
    }
    //console.log(n);
    
    let win = Services.wm.getMostRecentBrowserWindow();
    //console.log(win);
  • userChrome.js Scripte für den Fuchs (Diskussion)

    • aborix
    • 13. Dezember 2021 um 19:26

    Noch eine kleine Änderung:

    Bei einer Änderung des Ordnernamens wird der neue Name nicht übernommen. Das ist jetzt korrigiert:

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      function setFunction() {
    
        PlacesViewBase.prototype._mayAddCommandsItems =
        function PVB__mayAddCommandsItems(aPopup) {
    
          // The command items are never added to the root popup.
          if (aPopup == this._rootElt) {
            return;
          }
    
          // if there is no name item, insert it; update label
          if (!aPopup.firstChild.classList.contains("name-menuitem")) {
            aPopup.insertBefore(document.createXULElement("menuseparator"), aPopup.firstChild);
            let nameItem = document.createXULElement("menuitem");
            nameItem.classList.add("name-menuitem");
            aPopup.insertBefore(nameItem, aPopup.firstChild);
          }
          aPopup.firstChild.label = aPopup.parentNode.label;
    
          let hasMultipleURIs = false;
    
          // Check if the popup contains at least 2 menuitems with places nodes.
          // We don't currently support opening multiple uri nodes when they are not
          // populated by the result.
          if (aPopup._placesNode.childCount > 0) {
            let currentChild = aPopup.firstElementChild;
            let numURINodes = 0;
            while (currentChild) {
              if (currentChild.localName == "menuitem" && currentChild._placesNode) {
                if (++numURINodes == 2) {
                  break;
                }
              }
              currentChild = currentChild.nextElementSibling;
            }
            hasMultipleURIs = numURINodes > 1;
          }
    
          if (!hasMultipleURIs) {
            aPopup.setAttribute("nofooterpopup", "true");
          } else {
            aPopup.removeAttribute("nofooterpopup");
          }
    
          if (!hasMultipleURIs) {
            // We don't have to show any option.
            if (aPopup._endOptOpenAllInTabs) {
              aPopup.removeChild(aPopup._endOptOpenAllInTabs);
              aPopup._endOptOpenAllInTabs = null;
    
              aPopup.removeChild(aPopup._endOptSeparator);
              aPopup._endOptSeparator = null;
            }
          } else if (!aPopup._endOptOpenAllInTabs) {
            // Create a separator before options.
            aPopup._endOptSeparator = document.createXULElement("menuseparator");
            aPopup._endOptSeparator.className = "bookmarks-actions-menuseparator";
            aPopup.appendChild(aPopup._endOptSeparator);
    
            // Add the "Open All in Tabs" menuitem.
            aPopup._endOptOpenAllInTabs = document.createXULElement("menuitem");
            aPopup._endOptOpenAllInTabs.className = "openintabs-menuitem";
    
            if (typeof this.options.extraClasses.entry == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.entry
              );
            }
            if (typeof this.options.extraClasses.footer == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.footer
              );
            }
    
            aPopup._endOptOpenAllInTabs.setAttribute(
              "oncommand",
              "PlacesUIUtils.openMultipleLinksInTabs(this.parentNode._placesNode, event, " +
                "PlacesUIUtils.getViewForNode(this));"
            );
            aPopup._endOptOpenAllInTabs.setAttribute(
              "label",
              gNavigatorBundle.getString("menuOpenAllInTabs.label")
            );
            aPopup.appendChild(aPopup._endOptOpenAllInTabs);
          }
        }
      }
    
      let intId = setInterval(function() {
        if (window.PlacesViewBase) {
          clearInterval(intId);
          setFunction();
        }
      }, 500);
    
    })();
    Alles anzeigen
  • userChrome.js Scripte für den Fuchs (Diskussion)

    • aborix
    • 12. Dezember 2021 um 22:22
    Zitat von harff182

    Man erzeuge in jedem Ordner-Dropdown einen "Dummy"-Eintrag ganz oben an erster Stelle.

    Ob das ein "toter" Link ist oder per Script sei dahingestellt.

    Dann hole man sich den Namen des Ordners und ersetze "Dummy" damit (oder einem angepastem String).

    Aborix hat die Tage hier mal irgendwo ein Script zum Besten gegeben, das sie Einträge in einem Ordner zählt.

    Vielleicht kann man da abgucken [...]

    Ja, so machen wir das:

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      function setFunction() {
    
        PlacesViewBase.prototype._mayAddCommandsItems =
        function PVB__mayAddCommandsItems(aPopup) {
    
          // The command items are never added to the root popup.
          if (aPopup == this._rootElt) {
            return;
          }
    
          // insert name item
          if (!aPopup.firstChild.classList.contains("name-menuitem")) {
            aPopup.insertBefore(document.createXULElement("menuseparator"), aPopup.firstChild);
            let nameItem = document.createXULElement("menuitem");
            nameItem.label = aPopup.parentNode.label;
            nameItem.classList.add("name-menuitem");
            aPopup.insertBefore(nameItem, aPopup.firstChild);
          }
    
          let hasMultipleURIs = false;
    
          // Check if the popup contains at least 2 menuitems with places nodes.
          // We don't currently support opening multiple uri nodes when they are not
          // populated by the result.
          if (aPopup._placesNode.childCount > 0) {
            let currentChild = aPopup.firstElementChild;
            let numURINodes = 0;
            while (currentChild) {
              if (currentChild.localName == "menuitem" && currentChild._placesNode) {
                if (++numURINodes == 2) {
                  break;
                }
              }
              currentChild = currentChild.nextElementSibling;
            }
            hasMultipleURIs = numURINodes > 1;
          }
    
          if (!hasMultipleURIs) {
            aPopup.setAttribute("nofooterpopup", "true");
          } else {
            aPopup.removeAttribute("nofooterpopup");
          }
    
          if (!hasMultipleURIs) {
            // We don't have to show any option.
            if (aPopup._endOptOpenAllInTabs) {
              aPopup.removeChild(aPopup._endOptOpenAllInTabs);
              aPopup._endOptOpenAllInTabs = null;
    
              aPopup.removeChild(aPopup._endOptSeparator);
              aPopup._endOptSeparator = null;
            }
          } else if (!aPopup._endOptOpenAllInTabs) {
            // Create a separator before options.
            aPopup._endOptSeparator = document.createXULElement("menuseparator");
            aPopup._endOptSeparator.className = "bookmarks-actions-menuseparator";
            aPopup.appendChild(aPopup._endOptSeparator);
    
            // Add the "Open All in Tabs" menuitem.
            aPopup._endOptOpenAllInTabs = document.createXULElement("menuitem");
            aPopup._endOptOpenAllInTabs.className = "openintabs-menuitem";
    
            if (typeof this.options.extraClasses.entry == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.entry
              );
            }
            if (typeof this.options.extraClasses.footer == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.footer
              );
            }
    
            aPopup._endOptOpenAllInTabs.setAttribute(
              "oncommand",
              "PlacesUIUtils.openMultipleLinksInTabs(this.parentNode._placesNode, event, " +
                "PlacesUIUtils.getViewForNode(this));"
            );
            aPopup._endOptOpenAllInTabs.setAttribute(
              "label",
              gNavigatorBundle.getString("menuOpenAllInTabs.label")
            );
            aPopup.appendChild(aPopup._endOptOpenAllInTabs);
          }
        }
      }
    
      let intId = setInterval(function() {
        if (window.PlacesViewBase) {
          clearInterval(intId);
          setFunction();
        }
      }, 500);
    
    })();
    Alles anzeigen

    Der Namenseintrag hat den Klassennamen "name-menuitem" und kann über diesen mit CSS gestaltet werden.

  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 2. Dezember 2021 um 22:15

    Wenn ich es richtig verstehe, ist das die gleiche Frage wie in #11. Die Anzahlen nach dem Öffnen des Fensters anzuzeigen ist einfach; die Schwierigkeit ist, sie bei Änderungen zu aktualisieren. Ich weiß noch nicht, ob ich das erreichen kann.

  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 2. Dezember 2021 um 21:26

    Ich hab nicht darauf vergessen. :)

    Ich kann es leider nicht. Die Lesezeichen in der Sidebar sind anders aufgebaut als die im Menü und in der Leiste.

  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 2. Dezember 2021 um 09:51
    Zitat von milupo
    Zitat von aborix

    Scroll selbst nach unten, dann schließe das Popup und dann öffne es wieder. Wie ist es dann?

    Das habe ich jetzt noch mal getestet, ist aber wieder meine Version. Wenn ich herunterscrolle und schließe und wieder öffne, merkt sich das Popup offensichtlich, wo ich war; war ich am Ende, zeigt es mir das Ende, war ich am Anfang zeigt es mir den Anfang.

    Ist bei mir auch so. Mit dem Skript aus #69 ist bei mir immer der Anfang sichtbar.

  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 1. Dezember 2021 um 20:20

    FuchsFan :

    Teste mal:

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      function setFunction() {
    
        PlacesViewBase.prototype._onPopupShowing = function PVB__onPopupShowing(aEvent) {
          let popup = aEvent.originalTarget;
          this._ensureMarkers(popup);
          if ("_delayedRemovals" in popup) {
            while (popup._delayedRemovals.length) {
              popup.removeChild(popup._delayedRemovals.shift());
            }
          }
          if (!(popup._placesNode && PlacesUIUtils.getViewForNode(popup) == this))
            return;
          if (!popup._placesNode.containerOpen) {
            popup._placesNode.containerOpen = true;
          }
          if (!popup._built) {
            this._rebuildPopup(popup);
          }
          this._mayAddCommandsItems(popup);
    
          /* original function end */
    
          popup.addEventListener('popupshown', () => {
            for (let item of popup.children) {
              if (item.localName != 'menu' || item.id?.startsWith('history'))
                continue;
              let itemPopup = item.menupopup;
              itemPopup.openPopup();
              itemPopup.hidePopup();
              let menuitemCount = 0;
              let menuCount = 0;
              for (let subitem of itemPopup.children) {
                if (subitem.classList.contains('bookmark-item') && !subitem.disabled && !subitem.hidden) {
                  if (subitem.localName == 'menuitem') {
                    menuitemCount++;
                  } else if (subitem.localName == 'menu') {
                    menuCount++;
                  }
                }
              }
              if (!item.labelOriginal) {
                item.labelOriginal = item.label;
              }
              item.labelSuffix = '  ' + menuitemCount + ' / ' + menuCount;
              item.label = item.labelOriginal + item.labelSuffix;
            }
            popup.firstChild.scrollIntoView();
          }, {once: true});
    
          popup.addEventListener('popuphidden', function onPopuphidden(event) {
            if (event.target != this)
              return;
            popup.removeEventListener('popuphidden', onPopuphidden);
            for (let item of popup.children) {
              if (item.localName == 'menu') {
                if (item.labelOriginal) {
                  item.label = item.labelOriginal;
                  item.labelOriginal = undefined;
                }
              }
            }
          });
        }
    
      }
    
      let intId = setInterval(() => {
        if (window.PlacesViewBase) {
          clearInterval(intId);
          setFunction();
        }
      }, 500);
    
    })();
    Alles anzeigen
  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 1. Dezember 2021 um 20:05

    milupo :

    Scroll selbst nach unten, dann schließe das Popup und dann öffne es wieder. Wie ist es dann?

  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 30. November 2021 um 21:25

    Die Anzahlen werden jetzt aktualisiert. Ab Zeile 66 ist der Code für den Text der besagten Zeile einzutragen.

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      function setFunction() {
        PlacesViewBase.prototype._mayAddCommandsItems =
        function PVB__mayAddCommandsItems(aPopup) {
          let hasMultipleURIs = false;
          let menuitemCount = 0;
          let menuCount = 0;
          if (aPopup._placesNode.childCount > 0) {
            for (let item of aPopup.children) {
              if (item._placesNode) {
                if (item.localName == 'menuitem') {
                  menuitemCount++;
                } else if (item.localName == 'menu') {
                  menuCount++;
                }
              }
            }
            if (menuitemCount > 0 || menuCount > 0) {
              hasMultipleURIs = true;
            }
          }
          if (!hasMultipleURIs)  {
            aPopup.setAttribute("nofooterpopup", "true");
            if (aPopup._endOptOpenAllInTabs) {
              aPopup.removeChild(aPopup._endOptOpenAllInTabs);
              aPopup._endOptOpenAllInTabs = null;
              aPopup.removeChild(aPopup._endOptSeparator);
              aPopup._endOptSeparator = null;
            }
            return;
          }
    
          aPopup.removeAttribute("nofooterpopup");
          if (!aPopup._endOptOpenAllInTabs) {
            aPopup._endOptSeparator = document.createXULElement("menuseparator");
            aPopup._endOptSeparator.className = "bookmarks-actions-menuseparator";
            aPopup.insertBefore(aPopup._endOptSeparator, aPopup.firstChild);
            aPopup._endOptOpenAllInTabs = document.createXULElement("menuitem");
            aPopup._endOptOpenAllInTabs.className = "openintabs-menuitem";
            if (typeof this.options.extraClasses.entry == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.entry
              );
            }
            if (typeof this.options.extraClasses.footer == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.footer
              );
            }
            aPopup._endOptOpenAllInTabs.setAttribute(
              "oncommand",
              "PlacesUIUtils.openMultipleLinksInTabs(this.parentNode._placesNode, event, " +
                "PlacesUIUtils.getViewForNode(this));"
            );
            aPopup._endOptOpenAllInTabs.setAttribute(
              "onclick",
              "checkForMiddleClick(this, event); event.stopPropagation();"
            );
            aPopup.insertBefore(aPopup._endOptOpenAllInTabs, aPopup.firstChild);
          }
    
          /*
    
          let label = ...
                .
                .
                .
    
          */
    
          aPopup._endOptOpenAllInTabs.setAttribute("label", label);
        }
      }
    
      let intId = setInterval(function() {
        if (window.PlacesViewBase) {
          clearInterval(intId);
          setFunction();
        }
      }, 500);
    
    })();
    Alles anzeigen
  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 30. November 2021 um 19:41

    Es genügt anscheinend, die Zeilen 8 und 9 auszukommentieren.

    JavaScript
          if (aPopup == this._rootElt)
            return;

    Ich habe außerdem bemerkt, Veränderungen in der Anzahl der Ordner und Lesezeichen werden nicht immer übernommen.

  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 30. November 2021 um 08:48
    Zitat von omar1979

    aborix hast du eigentlich auch eine Seite, wo du deine Scripts hochlädst wie Endor auf Github? :)

    Nein, hab ich nicht.

  • Tab Reloader (page auto refresh) von James Fray

    • aborix
    • 28. November 2021 um 10:38

    Teste:

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      let frameScript = function() {
    
        function urlMatches(aUrl) {
          const urls = [
            'https://www.camp-firefox.de/forum/ungelesene-beitraege/'
          ];
          const urlPrefixes = [
            
          ];
          return urls.includes(aUrl) || urlPrefixes.some(string => aUrl.startsWith(string));
        };
    
        addEventListener('DOMContentLoaded', function(event) {
          let document = event.target;
          if (!urlMatches(document.location.href))
            return;
          let timId;
          /* if (!document.hidden) { */
            let wait = 9000;
            if (document.URL.startsWith('about:neterror?')) {
              wait = 1000;
            };
            timId = content.setTimeout(function() {
              document.location.reload();
            }, wait);
          /* }; */
          document.addEventListener('visibilitychange', function() {
            if (document.hidden) {
              /* content.clearTimeout(timId); */
            } else {
              document.location.reload();
            }
          });
        });
    
      };
    
      let frameScriptURI = 'data:,(' + frameScript.toString() + ')()';
      window.messageManager.loadFrameScript(frameScriptURI, true);
    
    })();
    Alles anzeigen
  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 28. November 2021 um 10:33

    Ganz oben:

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      function setFunction() {
        PlacesViewBase.prototype._mayAddCommandsItems = function PVB__mayAddCommandsItems(aPopup) {
          if (aPopup == this._rootElt)
            return;
          let hasMultipleURIs = false;
          let menuitemCount = 0;
          let menuCount = 0;
          if (aPopup._placesNode.childCount > 0) {
            for (let item of aPopup.children) {
              if (item._placesNode) {
                if (item.localName == 'menuitem') {
                  menuitemCount++;
                } else if (item.localName == 'menu') {
                  menuCount++;
                }
              }
            }
            if (menuitemCount > 0 || menuCount > 0) {
              hasMultipleURIs = true;
            }
          }
          if (!hasMultipleURIs)
            aPopup.setAttribute("nofooterpopup", "true");
          else
            aPopup.removeAttribute("nofooterpopup");
          if (!hasMultipleURIs) {
            if (aPopup._endOptOpenAllInTabs) {
              aPopup.removeChild(aPopup._endOptOpenAllInTabs);
              aPopup._endOptOpenAllInTabs = null;
              aPopup.removeChild(aPopup._endOptSeparator);
              aPopup._endOptSeparator = null;
            }
          } else if (!aPopup._endOptOpenAllInTabs) {
            aPopup._endOptSeparator = document.createXULElement("menuseparator");
            aPopup._endOptSeparator.className = "bookmarks-actions-menuseparator";
            aPopup.insertBefore(aPopup._endOptSeparator, aPopup.firstChild);
            aPopup._endOptOpenAllInTabs = document.createXULElement("menuitem");
            aPopup._endOptOpenAllInTabs.className = "openintabs-menuitem";
            if (typeof this.options.extraClasses.entry == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.entry
              );
            }
            if (typeof this.options.extraClasses.footer == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.footer
              );
            }
            aPopup._endOptOpenAllInTabs.setAttribute(
              "oncommand",
              "PlacesUIUtils.openMultipleLinksInTabs(this.parentNode._placesNode, event, " +
                "PlacesUIUtils.getViewForNode(this));"
            );
            aPopup._endOptOpenAllInTabs.setAttribute(
              "onclick",
              "checkForMiddleClick(this, event); event.stopPropagation();"
            );
            let label = menuitemCount + " Link";
            if (menuitemCount != 1) {
              label += "s";
            }
            label += " / " + menuCount + " Ordner."
            if (menuitemCount == 1) {
              label += " -> Link in Tab öffnen."
            } else if (menuitemCount > 1) {
              label += " -> Links in Tabs öffnen."
            }
            aPopup._endOptOpenAllInTabs.setAttribute("label", label);
            aPopup.insertBefore(aPopup._endOptOpenAllInTabs, aPopup.firstChild);
          }
        }
      }
    
      let intId = setInterval(function() {
        if (window.PlacesViewBase) {
          clearInterval(intId);
          setFunction();
        }
      }, 500);
    
    })();
    Alles anzeigen
  • Tab Reloader (page auto refresh) von James Fray

    • aborix
    • 28. November 2021 um 09:08

    Teste:

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      let frameScript = function() {
    
        function urlMatches(aUrl) {
          const urls = [
            'https://www.camp-firefox.de/forum/ungelesene-beitraege/'
          ];
          const urlPrefixes = [
            
          ];
          return urls.includes(aUrl) || urlPrefixes.some(string => aUrl.startsWith(string));
        };
    
        addEventListener('DOMContentLoaded', function(event) {
          let document = event.target;
          if (!urlMatches(document.location.href))
            return;
          let timId;
          //if (!document.hidden) {
            let wait = 9000;
            if (document.URL.startsWith('about:neterror?')) {
              wait = 1000;
            };
            timId = content.setTimeout(function() {
              document.location.reload();
            }, wait);
          //};
          document.addEventListener('visibilitychange', function() {
            if (document.hidden) {
              //content.clearTimeout(timId);
            } else {
              document.location.reload();
            }
          });
        });
    
      };
    
      let frameScriptURI = 'data:,(' + frameScript.toString() + ')()';
      window.messageManager.loadFrameScript(frameScriptURI, true);
    
    })();
    Alles anzeigen
  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 28. November 2021 um 08:55

    Versuche es damit:

    JavaScript
            let label = menuitemCount + " Link";
            if (menuitemCount != 1) {
              label += "s";
            }
            label += " / " + menuCount + " Ordner."
            if (menuitemCount == 1) {
              label += " -> Link in Tab öffnen."
            } else if (menuitemCount > 1) {
              label += " -> Links in Tabs öffnen."
            }
  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 23. November 2021 um 21:47
    Zitat von Dharkness

    in den Ordnern direkt auf der Lesezeichensymbolleiste werden aber keine Angaben gemacht, kann das noch angepasst werden?

    Vielleicht, ich weiß es noch nicht.

  • Anzahl Unterordner und Lesezeichen im Ordner anzeigen.

    • aborix
    • 22. November 2021 um 19:05

    Teste:

    JavaScript
    (function() {
    
      if (!window.gBrowser)
        return;
    
      function setFunction() {
        PlacesViewBase.prototype._mayAddCommandsItems = function PVB__mayAddCommandsItems(aPopup) {
          if (aPopup == this._rootElt)
            return;
          let hasMultipleURIs = false;
          let menuitemCount = 0;
          let menuCount = 0;
          if (aPopup._placesNode.childCount > 0) {
            for (let item of aPopup.children) {
              if (item._placesNode) {
                if (item.localName == 'menuitem') {
                  menuitemCount++;
                } else if (item.localName == 'menu') {
                  menuCount++;
                }
              }
            }
            if (menuitemCount > 0 || menuCount > 0) {
              hasMultipleURIs = true;
            }
          }
          if (!hasMultipleURIs)
            aPopup.setAttribute("nofooterpopup", "true");
          else
            aPopup.removeAttribute("nofooterpopup");
          if (!hasMultipleURIs) {
            if (aPopup._endOptOpenAllInTabs) {
              aPopup.removeChild(aPopup._endOptOpenAllInTabs);
              aPopup._endOptOpenAllInTabs = null;
              aPopup.removeChild(aPopup._endOptSeparator);
              aPopup._endOptSeparator = null;
            }
          } else if (!aPopup._endOptOpenAllInTabs) {
            aPopup._endOptSeparator = document.createXULElement("menuseparator");
            aPopup._endOptSeparator.className = "bookmarks-actions-menuseparator";
            aPopup.appendChild(aPopup._endOptSeparator);
            aPopup._endOptOpenAllInTabs = document.createXULElement("menuitem");
            aPopup._endOptOpenAllInTabs.className = "openintabs-menuitem";
            if (typeof this.options.extraClasses.entry == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.entry
              );
            }
            if (typeof this.options.extraClasses.footer == "string") {
              aPopup._endOptOpenAllInTabs.classList.add(
                this.options.extraClasses.footer
              );
            }
            aPopup._endOptOpenAllInTabs.setAttribute(
              "oncommand",
              "PlacesUIUtils.openMultipleLinksInTabs(this.parentNode._placesNode, event, " +
                "PlacesUIUtils.getViewForNode(this));"
            );
            aPopup._endOptOpenAllInTabs.setAttribute(
              "onclick",
              "checkForMiddleClick(this, event); event.stopPropagation();"
            );
            let label = menuCount + " Ordner und " + menuitemCount + " Link";
            if (menuitemCount > 1) {
              label += "s. Links in Tabs öffnen";
            } else if (menuitemCount == 1) {
              label += ". Link in Tab öffnen";
            } else {  // menuitemCount == 0
              label += "s.";
            }
            aPopup._endOptOpenAllInTabs.setAttribute("label", label);
            aPopup.appendChild(aPopup._endOptOpenAllInTabs);
          }
        }
      }
    
      let intId = setInterval(function() {
        if (window.PlacesViewBase) {
          clearInterval(intId);
          setFunction();
        }
      }, 500);
    
    })();
    Alles anzeigen

Unterstütze uns!

Jährlich (2025)

67,1 %

67,1% (435,86 von 650 EUR)

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