Bitte teste mal.
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 139
// @version 0.0.3b (CSP Fix)
// ==/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(event) {
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');
if (historyPopup) {
historyPopup.addEventListener('popupshowing', onPopupshowing);
}
})();
Alles anzeigen
Und
JavaScript
// ==UserScript==
// @name patchForBug1904014_allow_search_oneoff_with_empty_text.uc.js
// @description undoing Bug 1904014 - Remove function to do an empty search using the search bar one-off buttons.
// @include chrome://browser/content/browser.xhtml
// @compatibility 139
// @version 2024/07/14 fix add search engine button
// @version 2024/07/8
// ==/UserScript==
(function() {
if (location.href !== "chrome://browser/content/browser.xhtml") return;
let original_on_click = SearchOneOffs.prototype._on_click;
SearchOneOffs.prototype._on_click = function(event) {
if (false) {
return;
}
return original_on_click.apply(this, arguments);
};
let original_on_command = SearchOneOffs.prototype._on_command;
SearchOneOffs.prototype._on_command = function(event) {
if (false) {
return;
}
if (event.target.classList.contains("searchbar-engine-one-off-add-engine")) {
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
SearchUIUtils: "resource:///modules/SearchUIUtils.sys.mjs",
});
}
return original_on_command.apply(this, arguments);
};
let PSAC = document.getElementById("PopupSearchAutoComplete");
PSAC.addEventListener("click", event => {
if (event.button == 2) {
return; // Ignore right clicks.
}
let button = event.originalTarget.closest(".searchbar-engine-one-off-add-engine");
if (button) {
return;
}
button = event.originalTarget.closest(".search-panel-header");
if (!button) {
return;
}
if (!document.getElementById("searchbar").value) {
BrowserSearch.searchBar.handleSearchCommand(event, Services.search.defaultEngine);
}
});
PSAC.addEventListener("keydown", event => {
if (event.keyCode !== KeyEvent.DOM_VK_RETURN) {
return;
}
let button = event.originalTarget.closest(".search-panel-header");
if (!button) {
return;
}
if (!document.getElementById("searchbar").value) {
BrowserSearch.searchBar.handleSearchCommand(event, Services.search.defaultEngine);
}
});
})();
Alles anzeigen