// ==UserScript== // @name Anilist more links (MAL/AniDB) // @namespace https://github.com/Alistair1231/my-userscripts/ // @version 0.5.1 // @description adds links to anilist/mal site to anilist (uses just the duckduckgo I'm feeling ducky feature with the anime name) // @author Alistair1231 // @match https://anilist.co/* // @icon https://icons.duckduckgo.com/ip2/anilist.co.ico // @license GPL-3.0 // @downloadURL none // ==/UserScript== function createButton(linkcolor="#5B0BB5e0", link, text, iconDomain) { const anchorTag = document.createElement('a'); anchorTag.setAttribute('data-v-c1b7ee7c', ''); anchorTag.setAttribute('href', link); anchorTag.setAttribute('target', '_blank'); anchorTag.setAttribute('class', 'external-link'); anchorTag.setAttribute('style', `--link-color:${linkcolor};`); const divTag = document.createElement('div'); divTag.setAttribute('data-v-c1b7ee7c', ''); divTag.setAttribute('class', 'icon-wrap'); divTag.setAttribute('style', `background:black;`); const imgTag = document.createElement('img'); imgTag.setAttribute('data-v-c1b7ee7c', ''); imgTag.setAttribute('src', 'https://icons.duckduckgo.com/ip2/' + iconDomain + '.ico'); imgTag.setAttribute('class', 'icon'); // min-width: 25px; imgTag.style.minWidth = "25px"; const spanTag = document.createElement('span'); spanTag.setAttribute('data-v-c1b7ee7c', ''); spanTag.setAttribute('class', 'name'); spanTag.textContent = text; divTag.appendChild(imgTag); anchorTag.appendChild(divTag); anchorTag.appendChild(spanTag); return anchorTag; } function run() { // if no external links there, add the div to the sidebar if (document.querySelectorAll("div.external-links h2~div").length === 0) { var myDiv = document.createElement("div"); myDiv.setAttribute("data-v-7a1f9df8", ""); myDiv.setAttribute("data-v-1c97ba07", ""); myDiv.setAttribute("class", "external-links"); myDiv.innerHTML = "