2021-05-24 08:11:13 +00:00
|
|
|
// ==UserScript==
|
2021-06-23 13:12:01 +00:00
|
|
|
// @name Display anime names under pictures
|
2021-05-24 08:11:13 +00:00
|
|
|
// @namespace Violentmonkey Scripts
|
|
|
|
// @match https://animebytes.tv/collage.php
|
2022-10-09 08:58:18 +00:00
|
|
|
// @match https://animebytes.tv/company.php
|
2021-06-23 13:12:01 +00:00
|
|
|
// @match https://animebytes.tv/
|
2021-05-24 08:11:13 +00:00
|
|
|
// @grant none
|
2022-10-09 09:28:28 +00:00
|
|
|
// @version 1.4
|
2021-05-24 08:11:13 +00:00
|
|
|
// @author Lukáš Kucharczyk
|
2021-05-24 08:15:46 +00:00
|
|
|
// @description Displays anime titles underneath posters on the collage page.
|
2022-10-17 13:42:53 +00:00
|
|
|
// @downloadURL https://git.kucharczyk.xyz/lukas/userscripts/raw/branch/main/animebytes_display_anime_names/display_anime_names.user.js
|
2021-06-23 13:19:21 +00:00
|
|
|
// @supportURL https://git.kucharczyk.xyz/lukas/userscripts
|
2021-05-24 08:11:13 +00:00
|
|
|
// ==/UserScript==
|
2021-06-23 13:12:01 +00:00
|
|
|
let url_selectors = {
|
|
|
|
"^(https?://)?animebytes.tv/?$": ".aot_inner",
|
2022-10-09 09:28:28 +00:00
|
|
|
"^(https?://)?animebytes.tv/(collage|company).php": "#collage_table tbody tr td"
|
2021-06-23 13:12:01 +00:00
|
|
|
}
|
|
|
|
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) => {
|
2021-05-24 08:11:13 +00:00
|
|
|
let anime_title = element.querySelector('a img').attributes['alt'].value
|
|
|
|
let anime_title_div = document.createElement('div')
|
|
|
|
anime_title_div.style = 'width: 125px; height: 50px;'
|
|
|
|
element.appendChild(anime_title_div)
|
|
|
|
anime_title_div.innerText = anime_title
|
|
|
|
})
|