3

I cannot find anything about it but I find it hard to believe no one has ever tried this.

I'm looking for a client-side solution that allows me to re-use an existing web application running in a browser tab/window when a link is 'clicked' externally. For example, someone sends me en email with 10 links pointing to a web app (http://myapp.com/:id)

I just want a single instance of that web app to avoid opening a new tab when a link is clicked. My app is really heavy to load and already manages its own tabs re-using existing data.

I've currently implemented this using a Chrome extension that closes the tab if there is an existing one with the same domain, but I want a better cross-browser solution (at least Firefox)

Does anyone know how to achieve this using JS? I was thinking of Shared workers, but I'm sure there is no way to focus a browser tab using JS...

Thanks!

demian85
  • 2,394
  • 3
  • 20
  • 20
  • I think you'll find an answer to your question here: http://stackoverflow.com/questions/13779508/open-url-in-new-tab-or-reuse-existing-one-whenever-possible – Alari Truuts Apr 04 '16 at 14:06
  • That's not what I'm asking. I cannot control the target attribute of links that someone sends me through an instant messenger for example... – demian85 Apr 04 '16 at 14:30
  • Perhaps you should try to make the app cache as much assets as possible so that opening any subsequent tabs is as fast as possible ([link](https://mobiforge.com/design-development/using-html5-application-cache-mobile-web-apps)). I don't imagine there would be any easy way to keep a track of tabs opened from your app in the same browser without writing to and watching cookies/localstorage constantly. Besides, the behaviour you're implementing is slightly unconventional and that could be confusing to your users. – r0hitsharma Apr 04 '16 at 15:46
  • I encounter exactly the same problem, have you found a solution since April? – fabien-michel Jul 21 '16 at 08:06

0 Answers0