我设法构建了Ripple Emulator开源软件(https://github.com/apache/incubator-ripple).
我根据说明(Jake构建)构建了它,它创建了Chrome扩展目标,允许我通过我内置的chrome扩展测试我的网络应用程序,按照https://github.com/apache/incubator-ripple/blob /master/doc/chrome_extension.md.
我成功地将解压缩的扩展加载到chrome上,但是当我启用它时没有任何反应,虽然页面重新加载扩展不起作用,而是我得到2个错误:
未捕获的ReferenceError:未定义webkitNotifications
webkitNotifications.createHTMLNotification('/views/update.html').show();
Run Code Online (Sandbox Code Playgroud)运行tabs.executeScript时未经检查的runtime.lastError:无法访问chrome:// URL
chrome.tabs.executeScript(tabId, {
Run Code Online (Sandbox Code Playgroud)我该如何解决这个问题?
完整的background.js:
if (!window.tinyHippos) {
window.tinyHippos = {};
}
tinyHippos.Background = (function () {
var _wasJustInstalled = false,
_self;
function isLocalRequest(uri) {
return !!uri.match(/^https?:\/\/(127\.0\.0\.1|localhost)|^file:\/\//);
}
function initialize() {
// check version info for showing welcome/update views
var version = window.localStorage["ripple-version"],
xhr = new window.XMLHttpRequest(),
userAgent,
requestUri = chrome.extension.getURL("manifest.json");
_self.bindContextMenu();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
var manifest = JSON.parse(xhr.responseText),
currentVersion = …
Run Code Online (Sandbox Code Playgroud)