有没有办法让我可以在后台运行 JavaScript 函数,即使浏览器已被用户关闭。它可以在 Android 应用程序中完成,我也做到了。但不了解 JavaScript。
最佳答案
如果你把你的javascript函数变成 Chrome Extension 就可以了.
即使浏览器关闭,它也能工作。
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.
关于javascript - 即使浏览器关闭,也会在后台运行函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44342762/