Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/content.js

Issue 29716600: Issue 6292 - Make issue reporter compatible with test server (Closed)
Patch Set: Rebased Created March 12, 2018, 2:48 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.js ('k') | issue-reporter.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/content.js
===================================================================
--- a/ext/content.js
+++ b/ext/content.js
@@ -67,7 +67,6 @@
browser.runtime.sendMessage = (message, responseCallback) =>
{
let messageId = ++maxMessageId;
-
ext.backgroundPage._sendRawMessage({
type: "message",
messageId,
@@ -96,4 +95,19 @@
});
}
};
+
+ if (!("tabs" in browser))
+ browser.tabs = new Map([[0, {url: "example.com"}]]);
+
+ browser.tabs.get = (...args) =>
+ {
+ let result = Map.prototype.get.apply(browser.tabs, args);
+ return new Promise((resolve, reject) =>
+ {
+ if (result)
+ resolve(result);
+ else
+ reject(new Error("Tab cannot be found"));
+ });
+ }
}());
« no previous file with comments | « background.js ('k') | issue-reporter.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld