From cd5272acb47a53ad71e5a6bcbcb4f712bdd285c5 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 30 Jun 2021 14:12:43 +0200 Subject: refactor 3 miscellaneous fnctionalities to a their single own file --- common/gen_unique.js | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 common/gen_unique.js (limited to 'common/gen_unique.js') diff --git a/common/gen_unique.js b/common/gen_unique.js deleted file mode 100644 index 7ec8b4a..0000000 --- a/common/gen_unique.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Myext generating unique, per-site hash - * - * Copyright (C) 2021 Wojtek Kosior - * Redistribution terms are gathered in the `copyright' file. - */ - -/* - * 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 gen_unique(url) -{ - return "#" + sha256(get_id() + url); -} - -/* - * EXPORTS_START - * EXPORT gen_unique - * EXPORTS_END - */ -- cgit v1.2.3