-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working on Firefox 133 #17
Comments
@akgis32 Do you have Tampermonkey installed? |
I'm seeing the same issue. Going back does not close the tab and I am not using Tampermonkey. |
For me the back button is just greyed out and I don't see the inserted item in the history list at all |
It stopped working, I'm currently on FF v135, I have Violentmonkey installed |
Here is a minimal userscript, that adds a fake history entry on new tabs and auto-closes the tab when navigating back to it. Tested with Tampermonkey. In Firefox you have to set Edit: since Firefox 135 this only works if the page was activated before :/ (function () {
"use strict";
var events = ["click", "contextmenu", "keydown", "dragstart"];
events.forEach(e => document.addEventListener(e, ()=>{
if (history.length === 1 && !sessionStorage.getItem("__close")) {
sessionStorage.setItem("__close", 1);
history.replaceState({ close: 1 }, "", location.href);
history.pushState(null, "", location.href);
}
}));
addEventListener("popstate", (e) => e.state?.close && close());
})(); |
What happened? doesn't work any more. |
Tried the script fix.. Didn't work. nothing works.. |
Did you set the about:config flag? |
Yes |
Tampermonkey says the script is active on pages.. But it does nothing... no matter how I open a new tab. clicking back button does nothing. |
I'm using Firefox 1.3.5 Maybe that's why? |
It seems to be Firefox 135. When manipulating the history (like the addon Back2close and the little script above do), the history is still changed, but the back button is not activated. This is only made, when the user used the page / clicked on the site, before manipulating the history. |
Tip: I'm on FF 134.02 and the extension has been unreliable when ViolentMonkey was active. I got the extension working again by changing ViolentMonkey's settings to use Synchronous page mode. Weirdly, it seemed to fail on tabs opened by clicking a bookmark but if I first opened a tab with CTRL-T and then click the bookmark (loading it into the tab just created with CTRL-T), the extension would work and close the tab. One difference I noticed was it seemed to fail when history.length was 1 but work when history.length was 2. The one site that didn't work for me was YouTube but only after starting to view a video. The extension closes the YouTube tab if I haven't started viewing a video yet. However, YouTube (and all other sites (so far)), do work with Alt-Left Arrow. It seems maybe YouTube is trapping the Backspace key. Edit: I just tested with FF 135 and the behavior is slightly different. Now Alt-Left Arrow won't close any tab when there's no history left but Backspace does work everywhere except to close a YouTube tab after that tab has navigated away from the first page it was opened on. I guess I can live with that since it seems to work perfectly everywhere except YouTube. Note: in all of the above I set "dom.allow_scripts_to_close_windows" to true in about:config |
I been looking for this kinda of option and found this addon but doesnt work in 133 it seems.
I open a new tab but using the back button at the end of history doesnt closes it
The text was updated successfully, but these errors were encountered: