-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
ff121
Продолжительное время такой проблемы не было, но потом стал ловить замедления на любых страницах.
При обычной навигации, переходе в хронологию или из нее в тайтл.
Хронология может открываться секунд 20. Перезапуск браузера не помог.
"use strict"
class Shikimori {
static isAnimePage(location) {
const isAnimePageRegEx = /\/animes\/[a-z]?(?<id>[0-9]+)-([a-z0-9]+-?)+$/;
return location.pathname.match(isAnimePageRegEx);
}
static getWatchingEpisode(animeId) {
const request = new XMLHttpRequest();
request.open(
"GET",
`${window.location.protocol}//${window.location.hostname}/api/animes/${animeId}`,
false);
request.send();
const response = JSON.parse(request.response);
return (response.user_rate?.episodes || 0) + 1;
}
static getNameOfAnime(animeId) {
const request = new XMLHttpRequest();
request.open(
"GET",
`${window.location.protocol}//${window.location.hostname}/api/animes/${animeId}`,
false);
request.send();
const response = JSON.parse(request.response);
return (response.name || response.english[0] || response.russian || 0);
}
}
Metadata
Metadata
Assignees
Labels
No labels