aboutsummaryrefslogtreecommitdiff
path: root/common/gen_unique.js
diff options
context:
space:
mode:
Diffstat (limited to 'common/gen_unique.js')
-rw-r--r--common/gen_unique.js42
1 files changed, 23 insertions, 19 deletions
diff --git a/common/gen_unique.js b/common/gen_unique.js
index 4bcfd67..7ec8b4a 100644
--- a/common/gen_unique.js
+++ b/common/gen_unique.js
@@ -5,25 +5,29 @@
* Redistribution terms are gathered in the `copyright' file.
*/
-"use strict";
-
-(() => {
- const sha256 = window.sha256;
- const browser = window.browser;
- const is_chrome = window.is_chrome;
+/*
+ * IMPORTS_START
+ * IMPORT sha256
+ * IMPORT browser
+ * IMPORT is_chrome
+ * IMPORTS_END
+ */
- function get_id()
- {
- if (is_chrome)
- return browser.runtime.getManifest().key.substring(0, 50);
- else
- return browser.runtime.getURL("dummy");
- }
+function get_id()
+{
+ if (is_chrome)
+ return browser.runtime.getManifest().key.substring(0, 50);
+ else
+ return browser.runtime.getURL("dummy");
+}
- function gen_unique(url)
- {
- return "#" + sha256(get_id() + url);
- }
+function gen_unique(url)
+{
+ return "#" + sha256(get_id() + url);
+}
- window.gen_unique = gen_unique;
-})();
+/*
+ * EXPORTS_START
+ * EXPORT gen_unique
+ * EXPORTS_END
+ */