On the New Upload page
I want to fill the File URL, Sources and Description fields with a Tampermonkey script.
Something like this:
// ==UserScript==
// @name e621 upload test
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Fills the e621 upload form
// @author Mantikor
// @match https://e621.net/uploads/new
// @grant none
// ==/UserScript==
(function() {
'use strict';
let element_url = document.querySelector("div.flex-grid:nth-child(3) > div:nth-child(2) > div:nth-child(2) > label:nth-child(1) > input:nth-child(1)");
element_url.value = "https://d.furaffinity.net/art/fender/1284661300/1284661300.fender_fender.png";
let element_source = document.querySelector(".upload-source-row > input:nth-child(1)");
element_source.value = "https://www.furaffinity.net/view/4483888/";
let element_description = document.querySelector("#post_description");
element_description.value = "Test Test Test";
})();
Problem:
When I click inside the Artists field and start typing, the File URL and Description disappear.
And when I click the Plus button to the right of the Source field, the source disappears.
How can I make this work?
So far, my solution involves "focus" event handlers that put text in the clipboard, and the user pastes it manually.
edit:
I know about the e621 API.
But I want to use the existing upload form, not make my own.