admin管理员组文章数量:1415491
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
}
本文标签: javascriptchromeruntimesetUninstallUrl doesn39t seem to be workingStack Overflow
版权声明:本文标题:javascript - chrome.runtime.setUninstallUrl doesn't seem to be working - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745157667a2645273.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论