Open External Links in New Window
Automatically open external links in a new window when your web app runs in a chromeless runtime.
Why it doesn't suck
- Event delegation: Fast load and works on dynamic content
- Doesn't use
window.open, just changes the
targetfor clicked links
- Keeps existing
Why it's not a 100% solution
- Can't catch links to pages on the same host that don't have navigation back to your web app
- If you use multiple hostnames (e.g. login.mywebsite.com and www.mywebsite.com) within your app then those links will be broken.
How to Use
- Copy code into your web app project,
- Embed deferred via github,
- … or just get inspired and make your own.