Created
October 8, 2023 10:24
-
-
Save TypeA2/2025ae26df1cac28ad8e8c5c372fe3f7 to your computer and use it in GitHub Desktop.
Allows uploading by directly inputting the fxtwitter/vxtwitter link on the upload page.
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 fxtwitter/vxtwitter uploader - danbooru.donmai.us | |
// @namespace Violentmonkey Scripts | |
// @match https://*.donmai.us/uploads/new | |
// @grant none | |
// @version 1.0 | |
// @author TypeA2 | |
// @description 10/8/2023, 12:27:51 AM | |
// ==/UserScript== | |
document.getElementById("new_upload").addEventListener("submit", e => { | |
const src = document.getElementById("upload_source"); | |
if (src.value.length > 0) { | |
let url = new URL(src.value); | |
switch (url.host) { | |
case "fxtwitter.com": | |
case "vxtwitter.com": | |
url.host = "twitter.com"; | |
src.value = url.toString(); | |
break; | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment