Can I with javascript lockdown browser address bar to a specific domain?
I'm quite new at Javascript, and have so far only used the DOM, but I now need to access the browser model, and I don't know if what I'd like to do is possible.
The problem: sometimes I let my youngest daughter browse some kid-friendly Flash game sites. The problem is that most flash games display links to other sites in their splash screens. So of开发者_JAVA技巧ten, my daughter chooses a game, and then, while the Flash game is loading, she clicks on the splash screen, which takes her to some other site. It drives me nuts, because every two minutes she calls for help, as the browser has opened a new tab on some other site.
My specific needs: I wondered if there might be some way with Javascript, like with a bookmarklet or something alike, at any particular moment lock down the browser in some kind of pseudo-kiosk-mode, so it ONLY follows links to URLS on the current domain, ie the domain in the address bar when the bookmarklet was activated.
I don't expect anyone to solve the whole problem for me, but some pointers would be greatly appreciated. Thanks a lot in advance.
If the link is being opened from Flash, you can't do anything about it. If it was a normal HTML link you could try to intercept the click
event and block it if it's an external link. But with Flash, you're out of luck.
You're going to need some kind of browser extension or external monitoring software for that.
Extending what Matti said, I see two approaches worth looking into. If you search for something like "your_browser kiosk", replacing your_browser with the actual name of your browser, you'll likely find some useful tools. Alternatively, if there is a consistent set of problem sites, you could modify your hosts file to block those sites' domains.
精彩评论