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: Fixed nits Created March 12, 2018, 3:58 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,15 @@
});
}
};
+
+ if (!("tabs" in browser))
+ browser.tabs = new Map([[0, {url: "example.com"}]]);
+
+ browser.tabs.get = (...args) =>
+ {
+ // Extend browser.tabs.get()
+ const result = Map.prototype.get.apply(browser.tabs, args);
+ return (result ? Promise.resolve(result) :
+ Promise.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