window.chrome.app.isInstalled returns true as soon as one of your many apps is installed.

374 views
Skip to first unread message

DevelopDaily

unread,
Dec 30, 2012, 1:06:40 AM12/30/12
to native-cli...@googlegroups.com
The inline installation instructs us to use the "window.chrome.app.isInstalled" property to check if an app is installed or not before we attempt to install the app from the Chrome Web Store. The trouble is that all the apps are considered "installed" as soon as one of the the apps is installed because the Chrome browser will return "window.chrome.app.isInstalled" as true for all the pages (JavaScript) from the same web site that hosts the apps. In fact, the Chrome browser will actually load the NaCl apps that have never gone through the installation procedure and don't show up in the browser "Apps" section.

Is that a bug?

The problem becomes serious if your apps rely on the installation procedure that takes care of the "permissions" specified in the manifest.json of the Chrome Web Store. Your NaCl apps will complete loading and run, but will crash when they attempt to access the resources such as the file system because of lack of the permissions that have been left out by the installation procedure.

Andrey Khalyavin

unread,
Dec 30, 2012, 7:16:49 AM12/30/12
to native-cli...@googlegroups.com
On Sunday, December 30, 2012 10:06:40 AM UTC+4, DevelopDaily wrote:
The inline installation instructs us to use the "window.chrome.app.isInstalled" property to check if an app is installed or not before we attempt to install the app from the Chrome Web Store. The trouble is that all the apps are considered "installed" as soon as one of the the apps is installed 
because the Chrome browser will return "window.chrome.app.isInstalled" as true for all the pages (JavaScript) from the same web site that hosts the apps. In fact, the Chrome browser will actually load the NaCl apps that have never gone through the installation procedure and don't show up in the browser "Apps" section.

Is that a bug?
Since isInstalled doesn't have any parameters, I don't see how it can behave any other way.
If some app have an URL in app/urls (not completely sure about it) or app/launch section of the manifest, all NaCl modules at this URL will work. This is intended behaviour.
You can try to access chrome-extension://id/something URL to detect installed extensions (such URL must be present in web_accessible_resource section of the manifest).

--Andrey Khalyavin
Reply all
Reply to author
Forward
0 new messages