| 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) |