I want my web application to run in a window that does not have a menu, address bar, etc. I have a Default.html page, and on this page I click the Run Application button, which first opens my application in another window using window.open and then closes the current window by opening "AutoClose.html" using window.open with _self parameter
Default.html
<html> <head> <script type="text/javascript"> function runApp() { </script> </head> <body> <input type="button" value="Run Application" onclick="runApp();" /> </body> </html>
AutoClose.html
<html> <head> <script type="text/javascript"> window.close(); </script> </head> <body></body> </html>
My application should support IE, Firefox and Chrome, and my code works fine in IE and Chrome, but it cannot close the first window in Firefox due to the fact that "Scripts may not close windows that were not opened with a script" ., In Firefox, it opens a call to AutoClose.html, but window.close() on this page causes βScripts may not close windows that were not opened with a script,β and the window does not close. By the way, my application window is open without any problems (no problems with this).
It seems that using window.open() with the _self parameter trick does not work for Firefox. Since my goal is to run the application in a window without a menu, address bar, etc.
- Is there a way to hide the address bar menu without using
window.open() (at least for Firefox)? Then I will not need to run window.close() - Are there any settings to suppress "Scripts may not close windows that were not opened with a script" warning in Firefox? "Allowing scripts to close windows that were not opened with the script parameter" would be great (:
- Is there a way to make
window.close() work for "windows that were not opened with a script using javascript" in Firefox? - Or, are there any other suggestions (:
Thanks in advance.
UPDATE: This is a banking application, and I'm just a developer, not a decision maker. In other words, some analyst wants the application to work this way. And I do not ask about it. Therefore, "all you are trying to do is completely wrong," the answers will not be really helpful.
source share