mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 04:27:15 +03:00
substr -> slice
This commit is contained in:
@@ -22,7 +22,7 @@ async function init() {
|
|||||||
|
|
||||||
// selected tab
|
// selected tab
|
||||||
if (location.hash != "") {
|
if (location.hash != "") {
|
||||||
const substr = location.hash.substring(1);
|
const substr = location.hash.slice(1);
|
||||||
let menuItem = document.querySelector(`[data-for='${substr}']`);
|
let menuItem = document.querySelector(`[data-for='${substr}']`);
|
||||||
if (menuItem == null)
|
if (menuItem == null)
|
||||||
menuItem = document.querySelector(`[data-for='behavior']`);
|
menuItem = document.querySelector(`[data-for='behavior']`);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ function findValidElementFromGenerator<T>(objects: T[] | NodeListOf<HTMLElement>
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getHashParams(): Record<string, unknown> {
|
export function getHashParams(): Record<string, unknown> {
|
||||||
const windowHash = window.location.hash.substr(1);
|
const windowHash = window.location.hash.slice(1);
|
||||||
if (windowHash) {
|
if (windowHash) {
|
||||||
const params: Record<string, unknown> = windowHash.split('&').reduce((acc, param) => {
|
const params: Record<string, unknown> = windowHash.split('&').reduce((acc, param) => {
|
||||||
const [key, value] = param.split('=');
|
const [key, value] = param.split('=');
|
||||||
|
|||||||
Reference in New Issue
Block a user