mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
substr -> slice
This commit is contained in:
@@ -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']`);
|
||||
|
||||
@@ -43,7 +43,7 @@ function findValidElementFromGenerator<T>(objects: T[] | NodeListOf<HTMLElement>
|
||||
}
|
||||
|
||||
export function getHashParams(): Record<string, unknown> {
|
||||
const windowHash = window.location.hash.substr(1);
|
||||
const windowHash = window.location.hash.slice(1);
|
||||
if (windowHash) {
|
||||
const params: Record<string, unknown> = windowHash.split('&').reduce((acc, param) => {
|
||||
const [key, value] = param.split('=');
|
||||
|
||||
Reference in New Issue
Block a user