Last active
June 22, 2018 19:40
-
-
Save ewasion/6a7b6449ac1c46eb93eb02822e074533 to your computer and use it in GitHub Desktop.
Collage direct links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Collage direct links | |
// @namespace https://github.com/ewasion | |
// @version 0.1.6 | |
// @description Lets you directly access torrent groups on collages | |
// @author Eva | |
// @homepage https://gist.github.com/ewasion/6a7b6449ac1c46eb93eb02822e074533 | |
// @icon https://animebytes.tv/favicon.ico | |
// @updateURL https://gist.github.com/ewasion/6a7b6449ac1c46eb93eb02822e074533/raw/collage-direct-links.user.js | |
// @downloadURL https://gist.github.com/ewasion/6a7b6449ac1c46eb93eb02822e074533/raw/collage-direct-links.user.js | |
// @grant none | |
// @match https://animebytes.tv/collage.php?* | |
// @match https://animebytes.tv/artist.php?* | |
// @match https://animebytes.tv/company.php?* | |
// @license GPL-3.0 | |
// @run-at document-end | |
// ==/UserScript== | |
document.querySelectorAll('#collage_table a[href^="#group_"]').forEach(link => { | |
link.children[0].setAttribute('hash', link.hash); | |
link.href = document.querySelector(link.hash + ' a[title]').href | |
link.addEventListener('click', event => { | |
if(event.which == 1 && !event.ctrlKey) { | |
window.location.hash = event.target.getAttribute('hash'); | |
event.preventDefault(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment