Last active
October 22, 2022 13:46
-
-
Save vaaski/62252e2ab70b3d6f4232d764308004b0 to your computer and use it in GitHub Desktop.
don't open 6372583 tabs and skip 5s download wait on modland.net
This file contains hidden or 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 fuck modland | |
| // @namespace https://gist.github.com/vaaski/62252e2ab70b3d6f4232d764308004b0 | |
| // @updateURL https://gist.github.com/vaaski/62252e2ab70b3d6f4232d764308004b0/raw/fuckmodland.user.js | |
| // @downloadURL https://gist.github.com/vaaski/62252e2ab70b3d6f4232d764308004b0/raw/fuckmodland.user.js | |
| // @version 1 | |
| // @description don't open 6372583 tabs and skip 5s download wait | |
| // @author vaaski | |
| // @match https://*.modland.net/* | |
| // @match https://modland.net/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=modland.net | |
| // @grant none | |
| // @run-at document-end | |
| // ==/UserScript== | |
| ;(async () => { | |
| "use strict" | |
| const qs = (selector) => document.querySelector(selector) | |
| const qsa = (selector) => document.querySelectorAll(selector) | |
| if (location.pathname.startsWith("/download")) { | |
| const form = qs(".download-form") | |
| form.target = "_self" | |
| form.submit() | |
| } else { | |
| const anchors = qsa("a[target='_blank']") | |
| for (const anchor of anchors) { | |
| anchor.target = "_self" | |
| } | |
| } | |
| })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment