Skip to content

Commit

Permalink
Optimized player removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Malanavi committed May 5, 2023
1 parent a8f9fdb commit a3d9400
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Watch and download on Shikimori",
"version": "3.0.2",
"version": "3.0.3",

"description": "The addon adds the ability to watch and download anime on the Shikimori website.",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion manifest.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @icon https://raw.github.com/Malanavi/Watch-and-download-on-Shikimori/main/images/icons/logo128.png
// @author Malanavi
// @homepageURL https://github.com/Malanavi/Watch-and-download-on-Shikimori
// @version 3.0.2
// @version 3.0.3
// @copyright 2023, Malanavi
// @license GPL-3.0-or-later; https://www.gnu.org/licenses/gpl-3.0.txt

Expand Down
9 changes: 1 addition & 8 deletions scripts/helpers/anilibria.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AniLibria {
const anilibria = document.createElement("a");
anilibria.text = "AniLibria";
anilibria.onclick = () => {
this.#removePlayer(".iframe-player");
document.querySelectorAll(".iframe-player").forEach(player => player.remove());

const searchUrl = `https://api.anilibria.tv/v3/title/search?search=${nameOfAnime}`;
AniLibria.getAnimeOnAnilibria(searchUrl)
Expand Down Expand Up @@ -54,11 +54,4 @@ class AniLibria {

return anilibriaPlayer;
}

static #removePlayer(className) {
const player = document.querySelector(className);
if (player) {
player.remove();
}
}
}
9 changes: 1 addition & 8 deletions scripts/helpers/kodik.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Kodik {
const kodik = document.createElement("a");
kodik.text = "Kodik";
kodik.onclick = () => {
this.#removePlayer(".iframe-player");
document.querySelectorAll(".iframe-player").forEach(player => player.remove());

const block = document.querySelector(".block-with-player");
block.appendChild(this.#createKodikPlayer(animeId));
Expand Down Expand Up @@ -36,11 +36,4 @@ class Kodik {

return kodikPlayer;
}

static #removePlayer(className) {
const player = document.querySelector(className);
if (player) {
player.remove();
}
}
}

0 comments on commit a3d9400

Please sign in to comment.