Last active
May 6, 2019 02:54
-
-
Save po5/1d5ca39ea14aa9de904f80c5fcf5684d to your computer and use it in GitHub Desktop.
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.10 | |
// @description Lets you directly access torrent groups in collages | |
// @author Eva | |
// @homepage https://animebytes.tv/forums.php?action=viewthread&threadid=24213 | |
// @icon https://ptpimg.me/868r51.png | |
// @updateURL https://gist.github.com/po5/1d5ca39ea14aa9de904f80c5fcf5684d/raw/collage-direct-links.user.js | |
// @downloadURL https://gist.github.com/po5/1d5ca39ea14aa9de904f80c5fcf5684d/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?* | |
// @match https://animebytes.tv/studio.php?* | |
// @match https://animebytes.tv/bookmarks.php* | |
// @match https://awesome-hd.me/bookmarks.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="View Torrent"]').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