summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-07-20 10:17:19 +0200
committerWojtek Kosior <koszko@koszko.org>2021-07-20 10:17:19 +0200
commit0c7c1ebddab49e1e0b1ad4cc4c8fcdeedd220946 (patch)
tree1afd10275310177cf28991ad021cfb74e4add9f3 /html
parent1789f17466847d731d0bafa67b6d76526ca32b1d (diff)
parentecb787046271de708b94da70240713e725299d86 (diff)
downloadbrowser-extension-0c7c1ebddab49e1e0b1ad4cc4c8fcdeedd220946.tar.gz
browser-extension-0c7c1ebddab49e1e0b1ad4cc4c8fcdeedd220946.zip
Merge commit 'ecb787046271de708b94da70240713e725299d86'
Diffstat (limited to 'html')
-rw-r--r--html/options_main.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/html/options_main.js b/html/options_main.js
index f7adf39..2eeee1b 100644
--- a/html/options_main.js
+++ b/html/options_main.js
@@ -11,7 +11,6 @@
* IMPORT TYPE_PREFIX
* IMPORT TYPE_NAME
* IMPORT list_prefixes
- * IMPORT url_extract_target
* IMPORT nice_name
* IMPORTS_END
*/
@@ -691,20 +690,20 @@ function initialize_import_facility()
*/
function jump_to_item(url_with_item)
{
- const parsed_url = url_extract_target(url_with_item);
-
- if (parsed_url.target === undefined)
+ const [dummy1, base_url, dummy2, target] =
+ /^([^#]*)(#(.*))?$/i.exec(url_with_item);
+ if (target === undefined)
return;
- const prefix = parsed_url.target.substring(1, 2);
+ const prefix = target.substring(0, 1);
if (!list_prefixes.includes(prefix)) {
- history.replaceState(null, "", parsed_url.base_url);
+ history.replaceState(null, "", base_url);
return;
}
by_id(`show_${TYPE_NAME[prefix]}s`).checked = true;
- edit_item(prefix, decodeURIComponent(parsed_url.target.substring(2)));
+ edit_item(prefix, decodeURIComponent(target.substring(1)));
}
async function main()