谷歌浏览器打包应用程序 - 在系统启动时运行 [英] Google Chrome Packaged App - run at system startup

查看:263
本文介绍了谷歌浏览器打包应用程序 - 在系统启动时运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要让Google Packaged App在系统启动时运行。所以,当操作系统启动时,它会自动加载我的应用程序。



在Google Chrome中执行此操作的任何方法??




解决方案

如果您真的希望您的应用程序在操作系统启动时启动,那么答案是:您不能。



否则,如果应用程序在用户登录时启动就可以了,请添加background / code>许可你的清单文件。


​​权限背景



使Chrome尽早启动并且延迟关闭,以便应用程序和扩展程序可以拥有当任何已安装的托管应用程序,打包应用程序或扩展程序具有后台权限时,只要用户登录到其计算机,Chrome就会(无形地)运行。

在用户启动Chrome之前。 背景权限还使Chrome继续运行(即使在关闭最后一个窗口后),直到用户明确退出Chrome。 strong>背景权限仅适用于托管应用程序, 传统打包应用程序 Chrome应用的扩展名



如果您想在Chrome应用中使用背景权限,那么唯一的方法就是将扩展名列入白名单。这可以使用 - whitelisted-extension-id 标记完成:

  chromium --whitelisted-extension-id = [YOUREXTENSIONID  -  32 chars ap] 

有一个通过命令行列入白名单的扩展名,所以这只能用于测试。如果你想用背景许可发布你的应用程序,那么你的运气不好。 Chromium团队故意禁用了此权限,请参阅 https://code.google.com/p / chromium / issues / detail?id = 163770

I need to get a Google Packaged App to run at system startup. So, when the OS boots, it automatically loads my app.

Any way to do this in Google Chrome??

Thanks in advance.

解决方案

If you literally want your app to start up "when the OS boots", then the answer is: You can't.

Otherwise, if it's OK if your app starts when the user logs in, add the "background" permission to your manifest file.

Permission "background"

Makes Chrome start up early and and shut down late, so that apps and extensions can have a longer life.

When any installed hosted app, packaged app, or extension has "background" permission, Chrome runs (invisibly) as soon as the user logs into their computer—before the user launches Chrome. The "background" permission also makes Chrome continue running (even after its last window is closed) until the user explicitly quits Chrome.

The "background" permission is only available for hosted apps, legacy packaged apps and extensions, not for Chrome apps.

If you want to use the "background" permission in a Chrome App, then the only way to do this is to get the extension whitelisted. This can be done using the --whitelisted-extension-id flag:

chromium --whitelisted-extension-id=[YOUREXTENSIONID - 32 chars a-p]

You can only have one extension whitelisted via the command-line, so this should only be used for testing. If you want to publish your app with the background permission, then you're out of luck. The permission was intentionally disabled by the Chromium team, see https://code.google.com/p/chromium/issues/detail?id=163770.

这篇关于谷歌浏览器打包应用程序 - 在系统启动时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆