Reputation: 25870
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?
Upvotes: 11
Views: 4901
Reputation: 18620
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,
Upvotes: 13