我尝试更新Chrome应用中的网页,但收到错误消息:
无法打开同一窗口链接到" chrome-extension://XXXX/page.html" ;;尝试target =" _blank"。
我的manifest.json
:
"app": {
"background": {
"scripts": [ "background.js" ]
},
"persistent": false
},
我的background.js
:
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('page.html', {
'outerBounds': {
'width': 7000,
'height': 7000
}
});
});
和window.location.reload();
page.js
P.S。:我考虑了chrome.runtime.reload();
,但它会重新启动窗口/浏览器,我只想刷新页面而不关闭窗口。
答案 0 :(得分:1)
我创建了另一个页面“ main.html”,并将该页面中的“ page.html”加载到iframe上,并且能够以这种方式重新加载它,
只是发布我自己的解决方案,希望它可以对某人有所帮助。