/** * Myext generating unique, per-site hash * * Copyright (C) 2021 Wojtek Kosior * Redistribution terms are gathered in the `copyright' file. */ "use strict"; (() => { const sha256 = window.sha256; const browser = window.browser; const is_chrome = window.is_chrome; 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); } window.gen_unique = gen_unique; })();