/    Sign up×
Community /Pin to ProfileBookmark

Closing Windows

Browsers do not allow JS to close a window that has not been opened by the script in the first place. Is there any way round this problem? Here is what I need to do

To enable local debugging of an application developed in a custom IDE (our own, 32bit windows) and running in a web browser I am starting the process by simply using ShellExecute from within the IDE to open up an HTML file in the user’s default browser and then using JS from within that file to run against a dedicated server in the IDE. Once the testing has been done I would like to close down the browser window/tab opened for the purpose. But since I start the process by opening an HTML file using ShellExecute, not JS, I am then not allowed to close it using JS!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@evanageeJan 16.2007 — The problem is, as you stated, you cannot close windows that weren't spawned by Javascript. This prevents, among other things, a website from taking control of a users browser and closing it automatically, which could be rather annoying. So, while it keeps you from achieving a desired result it helps the world at large.
Copy linkTweet thisAlerts:
@FredAtauthorJan 16.2007 — Yes, I realize why the constraint is there. I was just wondering if there would be some way of doing things that would work around the problem.
×

Success!

Help @FredAt spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...