在研究<iframe>Chrome扩展程序中的问题时<webview>,Chrome应用程序引起了我的注意并引起了我的兴趣.
所以我决定做一个我正面临的问题的小例子,<iframe>看看是否<webview>解决了.根据我对观看Chrome Dev视频的理解,这些视频的webview运行时间与您的应用程序不同; 它与您的应用没有相同的权限.所以我假设如果运行中的内容以某种方式与"主线程"(app)分开,我猜他们的内容将彼此分开执行而不会阻止应用程序或其他任何一个可能有一个可能长时间运行js executon.因此我做了以下事情:
chrome.app.runtime.onLaunched.addListener(function() {
// Tell your app what to launch and how.
chrome.app.window.create('window.html', {
width: 1800,
height: 1000
});
});
Run Code Online (Sandbox Code Playgroud)
{
// Required
"name": "Hello World!",
"version": "0.1",
"manifest_version": 2,
// Recommended
"description": "My first packaged app.",
"icons": { "16": "calculator-16.png", "128": "calculator-128.png" },
// "default_locale": "en",
// Pick one (or none) OF browser_action, page_action, theme, app
"app": {
"background": {
"scripts": [ "background.js" …Run Code Online (Sandbox Code Playgroud) javascript google-chrome behavior google-chrome-app google-chrome-webview