I'm trying to make my chrome extension visit an URL when it is uninstalled. Apparently chrome.runtime.setUninstallUrl
is the best (and only?) option, but it doesn't seem to work for me. It's not firing at all.
This is the code I use:
chrome.runtime.setUninstallURL('www.google');
It's located in the extension's background JavaScript file together with a couple of other event listeners. I tried loading my unpacked extension into Chrome and then removing it, but the uninstall URL does not budge.
Any help would be appreciated.
I'm trying to make my chrome extension visit an URL when it is uninstalled. Apparently chrome.runtime.setUninstallUrl
is the best (and only?) option, but it doesn't seem to work for me. It's not firing at all.
This is the code I use:
chrome.runtime.setUninstallURL('www.google.');
It's located in the extension's background JavaScript file together with a couple of other event listeners. I tried loading my unpacked extension into Chrome and then removing it, but the uninstall URL does not budge.
Any help would be appreciated.
Share Improve this question edited Nov 5, 2014 at 10:31 Xan 77.7k18 gold badges197 silver badges217 bronze badges asked Nov 5, 2014 at 7:54 roherohe 151 silver badge5 bronze badges 02 Answers
Reset to default 5The URL must have an http: or https: scheme.
Update
The feature landed in Chrome 41, so the answer is mostly obsolete - it should work now.
The documentation displays a warning:
Dev channel only.
This means that this API function is still considered experimental and not enabled in Stable/Beta builds of Chrome.
Here's the corresponding issue in the Chrome bug tracker. Seems like this feature should hit stable soon (ready since July) but got a bit lost on its way. Consider starring the issue to raise its priority.
Until it is fixed, it won't work in normal Chrome versions. You should have seen an error that the function is undefined if you looked in the background console, by the way.
You can already safely include it in your code conditionally, so it will work on builds where it's enabled:
if(chrome.runtime.setUninstallURL) {
chrome.runtime.setUninstallURL('http://example./');
} else {
// Not yet enabled
}