- Firefox-Version
- Firefox 139.0
- Betriebssystem
- Windows 11 Pro 64-Bit
Hallo @ all.
Bei diesem Skript:
JavaScript
// ==UserScript==
// @name newtabfromhistory.uc.js
// @namespace https://www.camp-firefox.de/forum/viewtopic.php?p=1090093#p1090093
// @description Links aus Chronik in neuem Tab öffnen
// @author aborix
// @compatibility 95+
// @version 0.0.3a
// ==/UserScript==
(function() {
if (location != 'chrome://browser/content/browser.xhtml')
return;
PlacesUIUtils.openNodeWithEvent = function PUIU_openNodeWithEvent(aNode, aEvent) {
let window = aEvent.target.ownerGlobal;
let browserWindow = (window && window.document.documentElement.getAttribute('windowtype') == 'navigator:browser') ? window : BrowserWindowTracker.getTopWindow();
let where = window.BrowserUtils.whereToOpenLink(aEvent, false, true);
if (this.loadBookmarksInTabs) {
if (where == 'current' && !aNode.uri.startsWith('javascript:')) {
where = 'tab';
}
if (where == 'tab' && browserWindow.gBrowser.selectedTab.isEmpty) {
where = 'current';
}
}
this._openNodeIn(aNode, where, window);
}
let onPopupshowing = function() {
let historyMenu = document.getElementById('history-menu');
if (!historyMenu._placesView) {
new HistoryMenu(event);
historyMenu._placesView._onCommand = function HM__onCommand(aEvent) {
let placesNode = aEvent.target._placesNode;
if (placesNode) {
PlacesUIUtils.openNodeWithEvent(placesNode, aEvent);
};
};
};
};
let historyPopup = document.getElementById('historyMenuPopup');
historyPopup.setAttribute('onpopupshowing', '(' + onPopupshowing.toString() + ')()');
})();
Alles anzeigen
erhalte ich ab Fx Version 140 folgende Fehlermeldung:
ZitatContent-Security-Policy: Die Einstellungen der Seite haben die Ausführung eines Ereignis-Handlers (script-src-attr) blockiert, weil er gegen folgende Direktive verstößt: "script-src chrome: moz-src: resource: 'report-sample'". Ziehen Sie die Verwendung eines Hashs ('sha256-+NPc6D2NrYXo+qQKhKsaiU/9OA3R/H/2Q4lvkO3Ax8A=') zusammen mit 'unsafe-hashes' in Erwägung.
Die Funktion vom Skript ist aber vorhanden.
Lässt sich das Skript wieder anpassen/ändern?
Für jegliche Hilfe wie immer vielen Dank vorweg.