How Do I Close Firefox
I need to close the tab which displays my webpage, by the click of a button. But firefox does not allow to close the window by javascript as long as it is not opened by javascript.If I set the value of dom.allow_scripts_to_close_windows
to be 'true', then even normal window.close()
works too. But that is not a good solution. :(
I tried the following workaround suggested in one of the forums:
It is supposed to fool the browser into thinking that it was actually opened by javascript, but this does not work in Firefox 3.
Here are the steps to be followed to remove Firefox completely: Backup your bookmarks. In Firefox 2 go to the Bookmarks menu, select ‘Organize Bookmarks’. Then Remove Firefox from Add/Remove Programs (Windows XP) or Programs & Features (Windows Vista). Delete the folder Program Files Mozilla.
Can anyone please suggest a workaround?
7 Answers
Bill the LizardFor security reasons, your script cannot close a window/tab that it did not open.
Bulk ean 13 barcode generator. The solution is to present the age prompt at an earlier point in the navigation history. Then, you can choose to allow them to enter your site or not based on their input.
Instead of closing the page that presents the prompt, you can simply say, 'Sorry', or perhaps redirect the user to their homepage.
AndyAndyThis code works for both IE 7 and the latest version of Mozilla although the default setting in mozilla doesnt allow to close a window through javascript.
Here is the code:
function F11() { window.open(','_parent','); window.open('login.aspx', ', 'channelmode'); window.close(); }
To change the default setting :
1.type'about:config ' in your firefox address bar and enter;
2.make sure your 'dom.allow_scripts_to_close_windows' is true
self.close() does not work, are you sure you closing a window and not a script generated popup ?
you guys might want to look at this : https://bugzilla.mozilla.org/show_bug.cgi?id=183697
Salvin FrancisSalvin FrancisFrom a user experience stand-point, you don't want a major action to be done passively.
Something major like a window close should be the result of an action by the user.
Zack MarrapeseZack MarrapeseIf the browser people see this as a security and/or usability problem, then the answer to your question is to simply not close the window, since by definition they will come up with solutions for your workaround anyway. There is a nice summation about the reasoning why the choice have been in the firefox bug database https://bugzilla.mozilla.org/show_bug.cgi?id=190515#c70
So what can you do?
Change the specification of your website, so that you have a solution for these people. You could for instance take it as an opportunity to direct them to a partner.
That is, see it as a handoff to someone else that (potentially) needs it. As an example, Hanselman had a recent article about what to do in the other similar situation, namely 404 errors: http://www.hanselman.com/blog/PutMissingKidsOnYour404PageEntirelyClientSideSolutionWithYQLJQueryAndMSAjax.aspx
protected by Community♦Sep 9 '11 at 14:44
How Do I Close Firefox To Uninstall
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged javascriptfirefox or ask your own question.
We've all been there. Things are slow at work, and you find yourself somewhere you shouldn't be, like playing a game of online Scrabble or watching some painfully awful rendition of the national anthem on YouTube. Without warning, the boss comes walking in. In a state of panic, you fumble with your mouse and keyboard in an attempt to close your browser before it's too late. No such luck, as the six deadly words fill the air in your cubicle: 'What's that on your screen?'
Don't let this nightmare scenario happen to you. Keyboard shortcuts help you hide or shut down your browser lickety-split.
How to Quickly Close Web Browsers on a Windows Computer
Each browser uses a different keyboard shortcut:
- Chrome and Edge: Alt+F4 to close the active window
- Internet Explorer, Firefox, and Opera: Win+M to minimize all open windows to the taskbar, or Alt+F4 to quit the active instance of the browser
In Windows 10, the Win+D hotkey toggles the desktop. Pressing it minimizes all currently open apps (foreground and background) to the taskbar, revealing the desktop; pressing it again brings those same apps back to their original position.
How to Quickly Close Web Browsers on Mac OS X and macOS
On older Mac keyboards the Command key is the Apple key. Please also note that on Mac OS X, using Hide is noticeably faster than using Quit.
For all browsers, press Cmd+H to hide all active browser windows or Cmd+Q to quit the application altogether.