admin管理员组文章数量:1410737
I would like to open a packaged chrome application automatically when the browser starts.
I have tried: chrome-extension://app id/
But it doesn't work. I get chrome-extension://invalid/ error page.
I would like to open a packaged chrome application automatically when the browser starts.
I have tried: chrome-extension://app id/
But it doesn't work. I get chrome-extension://invalid/ error page.
- chrome.management.launchApp(id) – Daniel Herr Commented Apr 14, 2016 at 1:12
- where exactly would I run this? I can't include it in the app as it's a packaged app and management is not allowed – E_bme Commented Apr 14, 2016 at 1:23
- If you control the app why dont you just open it normally? – Daniel Herr Commented Apr 14, 2016 at 1:24
- End users can't be trusted to remember to run the app. So I want it to run as soon as the browser opens up. – E_bme Commented Apr 14, 2016 at 1:29
1 Answer
Reset to default 7Use the chrome.runtime.onStartup event, "Fired when a profile that has this extension installed first starts up".
chrome.runtime.onStartup.addListener(function() {
chrome.app.window.create("main.html")
})
https://developer.chrome./extensions/runtime#event-onStartup
本文标签: javascriptLaunch chrome application on startupStack Overflow
版权声明:本文标题:javascript - Launch chrome application on startup - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744334402a2601116.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论