digitarald/chromeless-external-links-snippet — explained in plain English
Analysis updated 2026-07-17 · repo last pushed 2013-09-27
Keep users inside an installable iOS web app when they tap an external link.
Prevent a Firefox OS app from losing focus when a user clicks an outbound link.
Add outbound-link handling to a news or tool app without pulling in a dependency.
Stop a web-based game from navigating away entirely when it links to external resources.
| digitarald/chromeless-external-links-snippet | adguardteam/recovery | adm1nsys/safari-ai-extension | |
|---|---|---|---|
| Stars | 8 | 8 | 8 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2013-09-27 | 2018-03-16 | — |
| Maintenance | Dormant | Dormant | — |
| Setup difficulty | easy | easy | hard |
| Complexity | 1/5 | 2/5 | 2/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Cannot distinguish your own app's multiple subdomains from truly external domains.
This is a tiny JavaScript snippet that solves a specific problem for web apps running on mobile devices or in minimal browser environments: it automatically opens external links in a new window instead of navigating away from your app. If you've ever built a web app for Firefox OS or as an iOS web app, you know that when a user clicks a link to an outside website, they get kicked out of your app entirely. This snippet prevents that by intercepting external links and opening them in a separate window, keeping your app in the foreground where the user can return to it. The way it works is straightforward. The code watches for clicks on any link across your entire web app (using a technique called event delegation, which is fast and handles links added dynamically later). When someone clicks a link that points to a different domain, the snippet changes the link's target to open in a new window, without using the window.open() function, which can be unreliable. If a link already has a specific target set, the code respects that choice and leaves it alone. Who needs this? Mainly developers building web apps for older mobile platforms like Firefox OS, or creating installable web apps for iOS that run without a full browser interface. It's also useful for any web app where you want to keep users in your experience when they click outbound links, think of a news app, a tool, or a web-based game that occasionally links to external resources. The snippet is written in plain JavaScript with no external dependencies, so it works across browsers and adds almost no overhead to your app. The README honestly notes some limitations: if you have multiple domains within your own app (like login.example.com and www.example.com), the snippet can't tell those apart and will treat internal domain-switching as external links. It's also not perfect at detecting every kind of outbound navigation if it doesn't happen through a regular link click. But for most cases, especially mobile web apps where you just want to prevent accidental navigation away, it does the job.
A tiny dependency-free JavaScript snippet that opens external links in a new window so mobile web apps don't lose the user by navigating away.
Mainly JavaScript. The stack also includes JavaScript.
Dormant — no commits in 2+ years (last push 2013-09-27).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.