How to detect event when chrome packaged app uninstalled? - google-chrome

I am developing a chrome packaged app. As part of the app i need to know, when user uninstalled the app. I could not find any method as part of the API,to read such a event when it happens. In extensions we have chrome.management api to do this, but chrome packaged app doesn't have this permission. Any help would be highly appreciated.

Try using chrome.runtime.setUninstallURL, this allows you to set a URL which is loaded as soon as the App is removed from Chrome. It does not require any additional permissions.

Related

How to bundle a Native Host with Chrome Extension and publish it?

I'm publishing a Chrome Extension that uses Native Messaging with a java application but it says that i cannot upload a double manifest ( one for the extension, the other one for the native host installation).
The only solution that i thought is to include the manifest of the java app inside the extension manifest (but i'm not sure it's possible, could you confirm please) OR to upload somewhere else the native host app (including its manifest) and let the user to download and install it. Is there another way?
Chrome extensions cannot include additional software which runs outside Chrome, like native host apps.
You will need to distribute your Java application (and its associated application manifest) separately from the Chrome extension.
You can't include multiple manifest files.
For native message host, please try to refer this link
https://developer.chrome.com/apps/nativeMessaging#native-messaging-host

Prevent debugging chrome packaged app

I created a "packaged app" for Chrome browser and I do not want others to debug the app.
Is there a flag in the manifest or any other way to prevent debugging?
If you use native client and don't use any HTML/JS/DOM, except for loading the native client module, then you would not be able to debug very much with devtools.

"window.openDatabase is not a function" error in chrome app

When i run my index.html from chrome browser everything works fine but after i created a chrome app from the same files and tried to run the app i get "window.openDatabase is not a function" error.Did i miss something? I've heard that WEBsql is being depreciated but if that's the problem then why is it working on my browser?The only change i made to the folder with my html/js/css files in order to create the chrome app was adding a manifest and a background.js,i also changed window.localstorage with chrome.storage.local
Chrome has refused to support it in apps.
Given that WebSQL is deprecated, it's extremely unlikely that we'd expose the API in new contexts.
It has been noted that you can workaround by using it inside a webview. Here is the relevant issue.

How does Chrome App Launcher add itself?

If I want to install the Chrome App Launcher and navigate to https://chrome.google.com/webstore/launcher , then click the only button over there, that page will install Chrome App Launcher shortcut to my Windows taskbar without any confirmation from the operating system whatsoever.
If I use a different browser, other than Chrome, I get redirected to the Chrome Webstore, with a message "You will need Google Chrome to install most apps, extensions and themes." showing. I guess, Chrome is able to place a shortcut from within a web page to my Desktop/Taskbar via its inner methods, as it's a general executable and may do "a lot" on its own.
How can I add my (any) shortcut from within a web page rendered in Chrome the same (or another) way the Chrome App Launcher has been installed?
Sorry, the webstore has special powers in chrome which regular web sites don't get. This is how it can also install extensions and apps, see whether you have particular extensions and apps installed, etc. You can see API by which it gets these special privileges here.
This API is made available by chrome just to the webstore.

Packaged App - install from outside of app store

I have a packaged app, but I want to distribute it through my own website - outside of the Google Chrome Web Store. So when user lands on my website, they receive the dialogue box to 'install' my app, and can install it, independently of the Chrome Web Store.
Is it at all possible?
Thanks in advance -
There is a way to do it without --enable-easy-off-store-extension-install -- it's just a little bit trickier for users. You will have to tell your users to do the following:
Download the .crx file from your website.
Navigate to chrome://extensions.
Drag the .crx file from the file explorer onto the extensions page.
This will install the packaged app into Chrome completely independently of the Web Store.