diff --git a/src/options.ts b/src/options.ts index 9f1f0cb2..21de0859 100644 --- a/src/options.ts +++ b/src/options.ts @@ -22,7 +22,7 @@ async function init() { // selected tab if (location.hash != "") { - const substr = location.hash.substring(1); + const substr = location.hash.slice(1); let menuItem = document.querySelector(`[data-for='${substr}']`); if (menuItem == null) menuItem = document.querySelector(`[data-for='behavior']`); diff --git a/src/utils/pageUtils.ts b/src/utils/pageUtils.ts index 28ac37d8..8f484d73 100644 --- a/src/utils/pageUtils.ts +++ b/src/utils/pageUtils.ts @@ -43,7 +43,7 @@ function findValidElementFromGenerator(objects: T[] | NodeListOf } export function getHashParams(): Record { - const windowHash = window.location.hash.substr(1); + const windowHash = window.location.hash.slice(1); if (windowHash) { const params: Record = windowHash.split('&').reduce((acc, param) => { const [key, value] = param.split('=');