From 261548ff184926567a623e90df7954aeef842d59 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 30 Jun 2021 12:28:05 +0200 Subject: emply an sh-based build system; make some changes to blocking --- common/gen_unique.js | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'common/gen_unique.js') 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 + */ -- cgit v1.2.3