Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I restrict my chrome app from being opened multiple times (so just one instance)?

I have a Chrome app that I need to be just one instance. If they click the app icon again, it should go to the already opened instance instead of opening another instance. How would I do this?

like image 890
Don Rhummy Avatar asked Jun 05 '13 22:06

Don Rhummy


People also ask

Why Chrome opens multiple processes?

You may have noticed that Google Chrome will often have more than one process open, even if you only have one tab open. This occurs because Google Chrome deliberately separates the browser, the rendering engine, and the plugins from each other by running them in separate processes.

Why Chrome opens multiple windows?

Chrome opening two tabs often happens when you visit a site that uses pop-up advertising. To stop this you just have to install an ad blocker in chrome which you can do by checking the Chrome Webstore. Another reason can be that you clicked on the icon repeatedly in which case you jut need to avoid doing that.

How do I restrict apps on Google Chrome?

Go to Allow/block mode. Click Edit. For Play Store, choose what type of apps and extensions you want to let users install. Note: Only the primary account user can install apps and extensions from the Google Play store.

Why do I have so many Google Chrome in Task Manager?

The secret to why Task Manager shows so many processes for Chrome is in how this browser works. Google Chrome creates three types of processes: tabs (for every tab you have open), renderers, and plug-ins.


1 Answers

Create the window with an id and as a singleton. See the chrome.app.window documentation.

E.G. modify the hello world sample to create the window with

  chrome.app.window.create('index.html', {
    id: "", // Even an empty string is sufficient.
    singleton: true,
like image 162
Vincent Scheib Avatar answered Oct 29 '22 04:10

Vincent Scheib