Compare commits
No commits in common. "692e073ae75a0cecce41e9fa4790e512d1fabded" and "d7f5975f6686c83a630f139bca1531a551dd3e24" have entirely different histories.
692e073ae7
...
d7f5975f66
|
@ -1,26 +1,15 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Display anime names under pictures
|
// @name Display anime names in collages
|
||||||
// @namespace Violentmonkey Scripts
|
// @namespace Violentmonkey Scripts
|
||||||
// @match https://animebytes.tv/collage.php
|
// @match https://animebytes.tv/collage.php
|
||||||
// @match https://animebytes.tv/
|
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 1.2
|
// @version 1.1
|
||||||
// @author Lukáš Kucharczyk
|
// @author Lukáš Kucharczyk
|
||||||
// @description Displays anime titles underneath posters on the collage page.
|
// @description Displays anime titles underneath posters on the collage page.
|
||||||
// @downloadURL https://git.kucharczyk.xyz/lukas/userscripts/raw/branch/main/animebytes_display_anime_names/display_anime_names.js
|
// @downloadURL https://git.kucharczyk.xyz/lukas/userscripts/raw/branch/main/animebytes_display_anime_names/display_anime_names.js
|
||||||
// @supportURL https://git.kucharczyk.xyz/lukas/userscripts
|
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
let url_selectors = {
|
let r = document.querySelectorAll('#collage_table tbody tr td')
|
||||||
"^(https?://)?animebytes.tv/?$": ".aot_inner",
|
r.forEach((element) => {
|
||||||
"^(https?://)?animebytes.tv/collage.php": "#collage_table tbody tr td"
|
|
||||||
}
|
|
||||||
let selectors_as_array = Object.entries(url_selectors)
|
|
||||||
let selector = selectors_as_array.filter(([key, value]) => {
|
|
||||||
let regex = new RegExp(key)
|
|
||||||
return regex.test(window.location)
|
|
||||||
})
|
|
||||||
let elements = document.querySelectorAll(selector[0][1])
|
|
||||||
elements.forEach((element) => {
|
|
||||||
let anime_title = element.querySelector('a img').attributes['alt'].value
|
let anime_title = element.querySelector('a img').attributes['alt'].value
|
||||||
let anime_title_div = document.createElement('div')
|
let anime_title_div = document.createElement('div')
|
||||||
anime_title_div.style = 'width: 125px; height: 50px;'
|
anime_title_div.style = 'width: 125px; height: 50px;'
|
||||||
|
|
Loading…
Reference in New Issue