In order to process special URLs in an already opened web application I use this approach:
- the user receives a special URL in an email (alarm notifications)
- the URL opens a small helper web page (H) with JavaScript code that temporarily sets a session cookie
- the main web application (M), which is already open in another tab/window, recognizes this and handles the request after deleting the cookie
- the helper web page (H) identifies this as a success and is now useless and should be closed.
This all works fine except for the helper window (H) remaining open. Of course there is a small text saying "please close this window now" but it would be perfect if it could do this automatically.
window.close()
causes a confirmation dialog in IE and FireFox just ignores the command. I understand this is because the window has not been opened using window.open()
.
Similarly, calling window.focus()
in the main window does not do anything, either.
Does anyone have an idea how to accomplish this anyway? At least, automatically focusing the main window without closing the helper window would be better than nothing.
Of couse I'm also open for other solutions to handle e-mail links in an already open web application... :)
Note the web application (and the helper page of course) are on a HTTPS server.