summaryrefslogtreecommitdiff
path: root/common/browser.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'common/browser.mjs')
-rw-r--r--common/browser.mjs18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/browser.mjs b/common/browser.mjs
new file mode 100644
index 0000000..0d1b233
--- /dev/null
+++ b/common/browser.mjs
@@ -0,0 +1,18 @@
+/**
+* Myext WebExtension API access normalization
+*
+* Copyright (C) 2021 Wojtek Kosior
+*
+* Dual-licensed under:
+* - 0BSD license
+* - GPLv3 or (at your option) any later version
+*/
+
+"use strict";
+
+/*
+ * This module normalizes access to WebExtension apis between
+ * chrome-based and firefox-based browsers.
+ */
+
+export default (window.browser === undefined) ? chrome : browser;