我正在开发一个Chrome应用程序,它可以简单地在Chrome中打开链接,例如"http://www.cnn.com/",并在新标签页中显示。
我在我的manifest.json中有以下代码:
{
"manifest_version": 2,
"name": "CNN",
"version": "2.1",
"permissions": ["webview", "pointerLock", "geolocation", "videoCapture"],
"app": {
"background": {
"scripts": ["main.js"]
}
}
}
以下是我在main.js中的代码:
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('http://www.cnn.com/', {
});
});
我也尝试过,
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create({ "url": "http://cloudsupport.neonova.net/home" });
});
以及:
chrome.app.runtime.onLaunched.addListener(function(tab) {
chrome.app.tab.create({ "url": "http://cloudsupport.neonova.net/home" });
});
我可以帮忙翻译。
谢谢你。