diff options
author | Wojtek Kosior <koszko@koszko.org> | 2021-06-30 12:28:05 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2021-06-30 12:28:05 +0200 |
commit | 261548ff184926567a623e90df7954aeef842d59 (patch) | |
tree | 9b5697a77c758eaae969a8fba8b4edea5ecf59d4 /common/gen_unique.js | |
parent | 83a8d263f6efddf4f742bf7a687d10bfd1907ef8 (diff) | |
download | browser-extension-261548ff184926567a623e90df7954aeef842d59.tar.gz browser-extension-261548ff184926567a623e90df7954aeef842d59.zip |
emply an sh-based build system; make some changes to blocking
Diffstat (limited to 'common/gen_unique.js')
-rw-r--r-- | common/gen_unique.js | 42 |
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 + */ |