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

Unified Diff: ext/common.js

Issue 29573905: Issue 4580 - Replace ext.devtools with devtools Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Oct. 11, 2017, 10:38 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
« devtools-panel.js ('K') | « ext/background.js ('k') | ext/devtools.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/common.js
===================================================================
--- a/ext/common.js
+++ b/ext/common.js
@@ -156,16 +156,42 @@
let rawCatalog = JSON.parse(xhr.responseText);
for (let msgId in rawCatalog)
{
if (!(msgId in catalog))
catalog[msgId] = parseMessage(rawCatalog[msgId]);
}
};
+ /* Polyfills */
Manish Jethani 2017/10/11 22:46:00 The code in this section will eventually move to p
+
+ if (/\/devtools-panel\.html\b/.test(top.location.href))
Manish Jethani 2017/10/11 22:46:00 chrome.devtools is not available outside the devto
+ {
+ chrome.devtools = {
+ panels: {
+ openResource() {}
+ },
+
+ inspectedWindow: {
+ reload() {}
+ },
+
+ onCreated: {
+ addListener(listener)
+ {
+ window.addEventListener("message", (event) =>
+ {
+ if (event.data.type == "devtools")
+ listener(new ext.Page(event.source));
+ });
+ }
+ }
+ };
+ }
+
chrome.i18n = {
getUILanguage()
{
return locales[0].replace(/_/g, "-");
},
getMessage(msgId, substitutions)
{
while (true)
« devtools-panel.js ('K') | « ext/background.js ('k') | ext/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld