- Firefox-Version
- Firefox 135.0
- Betriebssystem
- Windows 11 Pro 64-Bit
Hallo @ all.
Mit dem heutige Update vom Nightly Version 135 funktioniert das Skript nicht mehr:
JavaScript
//Angepasst @aborix
//https://www.camp-firefox.de/forum/thema/135611-browser-warnonquit-skript-funktioniert-im-aktuellem-nightly-nicht-mehr/?postID=1216579#post1216579
//Angepasst durch Sören
//https://www.camp-firefox.de/forum/thema/138452-firefox-beenden-warnung-uc-js-funktioniert-in-fx-133-nicht-mehr/?postID=1258120#post1258120
//Hinweis durch Sören
//https://www.camp-firefox.de/forum/thema/138452-firefox-beenden-warnung-uc-js-funktioniert-in-fx-133-nicht-mehr/?postID=1258762#post1258762
// ab Fx 133 _numPinnedTabs heißt jetzt pinnedTabCount
(function() {
if (window.__SSi != 'window0')
return;
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BrowserGlue: "resource:///modules/BrowserGlue.sys.mjs"
});
lazy.BrowserGlue.prototype._onQuitRequest =
function BG__onQuitRequest(aCancelQuit, aQuitType) {
// If user has already dismissed quit request, then do nothing
if (aCancelQuit instanceof Ci.nsISupportsPRBool && aCancelQuit.data) {
return;
}
// There are several cases where we won't show a dialog here:
// 1. There is only 1 tab open in 1 window
// 2. browser.warnOnQuit == false
// 3. The browser is currently in Private Browsing mode
// 4. The browser will be restarted.
// 5. The user has automatic session restore enabled and
// browser.sessionstore.warnOnQuit is not set to true.
// 6. The user doesn't have automatic session restore enabled
// and browser.tabs.warnOnClose is not set to true.
//
// Otherwise, we will show the "closing multiple tabs" dialog.
//
// aQuitType == "lastwindow" is overloaded. "lastwindow" is used to indicate
// "the last window is closing but we're not quitting (a non-browser window is open)"
// and also "we're quitting by closing the last window".
if (aQuitType == "restart" || aQuitType == "os-restart") {
return;
}
// browser.warnOnQuit is a hidden global boolean to override all quit prompts.
if (!Services.prefs.getBoolPref("browser.warnOnQuit")) {
return;
}
var windowcount = 0;
var pagecount = 0;
let pinnedcount = 0;
for (let win of BrowserWindowTracker.orderedWindows) {
if (win.closed) {
continue;
}
windowcount++;
let tabbrowser = win.gBrowser;
if (tabbrowser) {
pinnedcount += tabbrowser.pinnedTabCount;
pagecount += tabbrowser.visibleTabs.length - tabbrowser.pinnedTabCount;
}
}
// No windows open so no need for a warning.
if (!windowcount) {
return;
}
// browser.warnOnQuitShortcut is checked when quitting using the shortcut key.
// The warning will appear even when only one window/tab is open. For other
// methods of quitting, the warning only appears when there is more than one
// window or tab open.
let shouldWarnForShortcut =
this._quitSource == "shortcut" &&
Services.prefs.getBoolPref("browser.warnOnQuitShortcut");
let shouldWarnForTabs =
//pagecount >= 2 &&
Services.prefs.getBoolPref("browser.tabs.warnOnClose");
if (!shouldWarnForTabs && !shouldWarnForShortcut) {
return;
}
if (!aQuitType) {
aQuitType = "quit";
}
let win = BrowserWindowTracker.getTopWindow();
// Our prompt for quitting is most important, so replace others.
win.gDialogBox.replaceDialogIfOpen();
let titleId, buttonLabelId;
if (windowcount > 1) {
// More than 1 window. Compose our own message.
titleId = {
id: "tabbrowser-confirm-close-windows-title",
args: { windowCount: windowcount },
};
buttonLabelId = "tabbrowser-confirm-close-windows-button";
} else if (shouldWarnForShortcut) {
titleId = "tabbrowser-confirm-close-tabs-with-key-title";
buttonLabelId = "tabbrowser-confirm-close-tabs-with-key-button";
} else {
titleId = {
id: "tabbrowser-confirm-close-tabs-title",
args: { tabCount: pagecount },
};
buttonLabelId = "tabbrowser-confirm-close-tabs-button";
}
// The checkbox label is different depending on whether the shortcut
// was used to quit or not.
let checkboxLabelId;
if (shouldWarnForShortcut) {
const quitKeyElement = win.document.getElementById("key_quitApplication");
const quitKey = ShortcutUtils.prettifyShortcut(quitKeyElement);
checkboxLabelId = {
id: "tabbrowser-confirm-close-tabs-with-key-checkbox",
args: { quitKey },
};
} else {
checkboxLabelId = "tabbrowser-confirm-close-tabs-checkbox";
}
let [
title,
buttonLabel,
checkboxLabel,
] = win.gBrowser.tabLocalization.formatMessagesSync([
titleId,
buttonLabelId,
checkboxLabelId,
]);
let warnOnClose = { value: true };
let flags =
Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 +
Services.prompt.BUTTON_TITLE_CANCEL * Services.prompt.BUTTON_POS_1;
// 1 Fenster mit höchstens 1 nicht angehefteter Tab
if (windowcount == 1 && pagecount < 2 && this._quitSource != "shortcut") {
title.value = "Fenster schließen?";
buttonLabel.value = "Schließen";
checkboxLabel.value = null;
}
// buttonPressed will be 0 for closing, 1 for cancel (don't close/quit)
let buttonPressed = Services.prompt.confirmEx(
win,
title.value,
null,
flags,
buttonLabel.value,
null,
null,
checkboxLabel.value,
warnOnClose
);
// If the user has unticked the box, and has confirmed closing, stop showing
// the warning.
if (buttonPressed == 0 && !warnOnClose.value) {
if (shouldWarnForShortcut) {
Services.prefs.setBoolPref("browser.warnOnQuitShortcut", false);
} else {
Services.prefs.setBoolPref("browser.tabs.warnOnClose", false);
}
}
this._quitSource = "unknown";
aCancelQuit.data = buttonPressed != 0;
}
})();
Alles anzeigen
Kann mir bitte jemand sagen, was neu angepasst werden muss.
Wie immer vielen Dank vorweg für jegliche Hilfe.
Edit:
Ich sehe gerade:
könnte also auch nur an der fehlenden Übersetzung liegen
Denn auch bei 4 oder mehr Tabs gibt es keine Nachfrage.
Edit:
Liegt am Skript.
Also wohl mal abwarten.