How can I upload an image to a site with a userscript/extension?

82 Views Asked by At

I want to make a userscript/extension that creates a post for you on twitter or reddit.

Unfortunately the browser does not have access to the "choose files" popup, or to the users clipboard, so I'm unsure how I could upload the image otherwise.

I know I could do it by using an external program to hit ctrl+v for me, but I'd like it to be contained in an extension so I can share it.

1

There are 1 best solutions below

0
Hazik Arshad On

You can achieve this by creating a form on your user script and have the user manually enter the URL of the image. Then use the API to post the image with any text.