Skip to content

Instantly share code, notes, and snippets.

@TypeA2
Created October 8, 2023 10:24
Show Gist options
  • Save TypeA2/2025ae26df1cac28ad8e8c5c372fe3f7 to your computer and use it in GitHub Desktop.
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.
// ==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