即使关闭了Chrome,Chrome扩展程序仍可运行 [英] Chrome extension that runs even if chrome closed

查看:114
本文介绍了即使关闭了Chrome,Chrome扩展程序仍可运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个chrome扩展程序,在打开chrome时可以很好地运行.问题是当chrome应用程序关闭时. 我需要使扩展程序始终运行-在打开或关闭chrome浏览器的情况下. 有什么方法可以使扩展程序即使在chrome关闭的情况下也能运行?

I have a chrome extension that runs good when the chrome is opened. The problems is when the chrome application is closed. I need to make the extension to run always - wheather the chrome browser is opened or closed. Is there any way to make it happen that the extension will run even when chrome is closed?

推荐答案

这正是> background权限确实:

This is exactly what the background permission does:

使Chrome提前启动,然后延迟关闭,以便使应用和扩展程序的使用寿命更长.

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

当任何已安装的托管应用,打包应用或扩展程序具有背景"字样时,权限,则在用户启动Chrome之前,Chrome就会(无形地)在用户登录到计算机后立即运行. 背景"指的是背景".权限还会使Chrome继续运行(即使在关闭最后一个窗口之后),直到用户明确退出Chrome.

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.

只需将"background"添加到扩展程序manifest.json中列出的权限中,它将在Chrome打开之前和Chrome关闭之后继续运行.

Simply add "background" to the permissions listed in your extension's manifest.json, and it will continue running before Chrome opens and after Chrome is closed.

这篇关于即使关闭了Chrome,Chrome扩展程序仍可运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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