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

Unified Diff: ext/common.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Workaround CSS.excape, i18n issue and use typeof for 'undefined' detection Created July 17, 2017, 12:51 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 | « ext/background.js ('k') | ext/popup.js » ('j') | ext/popup.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/common.js
===================================================================
--- a/ext/common.js
+++ b/ext/common.js
@@ -19,6 +19,12 @@
(function()
{
+ // Both Edge and Mozilla Web Extensions use the namespace
+ // 'browser' instead of 'chrome'. Edge has chrome namespace defined,
+ // in some cases, but only with one property: 'app'.
+ if (typeof chrome == "undefined" || typeof chrome.extension == "undefined")
Oleksandr 2017/07/17 12:52:40 When 'chrome' is undefined, calling 'if (!chrome)'
kzar 2017/07/17 14:08:19 Acknowledged.
+ window.chrome = window.browser;
+
window.ext = {};
let EventTarget = ext._EventTarget = function()
« no previous file with comments | « ext/background.js ('k') | ext/popup.js » ('j') | ext/popup.js » ('J')

Powered by Google App Engine
This is Rietveld