Firefox - Javascript prevents me from closing tab - security vulnerability - installs malware or just annoying
Some times a website hijacks your tab and won't allow you to close it unless you choose an option. If you choose yes or no then it install a virus or malware.
In chrome you can just hold enter and then close window and if force closes browser window. Only option is to force close the entire browser window via the task manager or agree to the terms.
I believe javascript should not prevent you from closing the browser tab/window or at least write an internal over ride that will terminate any script running in the browser in the current tab. Otherwise why did I choose to close it in the first place.
There might be legitimate reason to allow this but you should offer an override. Also from a user stand point there are many people out there that have little to no information about how a browser or tech works. Someone like my dad who is over 50 years old and struggles to us the internet or smart phone. He would not know how to deal with this. Thus would end up installing the virus.
Anyway I have yet to see anywhere this is a useful feature. Mostly used on bad websites. I don't want to disable javascript for the browser. I just want close a tab.
just before submitting this I encountered one window that if closed it would open up 2 more tabs. All with the same problem.
So if I was going to code this I would code as some kind of button you hold down on the keyboard or right click and then terminates the script in the tab and then closes the tab. Like force quit a program.
すべての返信 (4)
hello samsoundguy, i agree that this should not be allowed to happen - could you file a bug report for this issue including the offending url at [bugzilla.mozilla.org]? thanks a lot!
Chrome currently creates a separate process (you can see it in the Windows Task Manager) per window or per tab. That makes the killing of a single window or tab separate from the rest of the windows and tabs. Firefox has a feature in development that will spawn separate content processes, but it's taking time to get the kinks out: https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox While that means some delay before your suggestion could be implemented, it also means an opportunity to make sure it is fully featured when it arrives.
You can also possibly set the dom.disable_beforeunload prefto true on the about:config page.
You can open the about:config page via the location/address bar. You can accept the warning and click "I'll be careful" to continue.
This add-on can stop such pages; disallow Script Button {web link} The Disallow Script button looks like a letter "M" and the title is the Minus Script, drag and drop the button on a toolbar. If the button is not displayed then nothing operates, except rules for plugins.