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.
Beiträge von aborix
-
-
-
Hallo liebe Freunde. Hilfe, bitte anpassen sie dieses Skript für Firefox 95+
Bitte schön:
JavaScript
Alles anzeigen// 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); })();
-
Vielleicht ist hier etwas Brauchbares dabei:
Detect Browser lost focus in CSSI 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.comDie Anzahl der Fenster und das aktive kann man so erhalten:
-
Noch eine kleine Änderung:
Bei einer Änderung des Ordnernamens wird der neue Name nicht übernommen. Das ist jetzt korrigiert:
JavaScript
Alles anzeigen(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); })();
-
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
Alles anzeigen(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); })();
Der Namenseintrag hat den Klassennamen "name-menuitem" und kann über diesen mit CSS gestaltet werden.
-
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.
-
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.
-
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.
-
FuchsFan :
Teste mal:
JavaScript
Alles anzeigen(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); })();
-
milupo :
Scroll selbst nach unten, dann schließe das Popup und dann öffne es wieder. Wie ist es dann?
-
Die Anzahlen werden jetzt aktualisiert. Ab Zeile 66 ist der Code für den Text der besagten Zeile einzutragen.
JavaScript
Alles anzeigen(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); })();
-
-
Nein, hab ich nicht.
-
Teste:
JavaScript
Alles anzeigen(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); })();
-
Ganz oben:
JavaScript
Alles anzeigen(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); })();
-
Teste:
JavaScript
Alles anzeigen(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); })();
-
-
in den Ordnern direkt auf der Lesezeichensymbolleiste werden aber keine Angaben gemacht, kann das noch angepasst werden?
Vielleicht, ich weiß es noch nicht.
-
Teste:
JavaScript
Alles anzeigen(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); })();