Greasy Fork is available in English.

ChatGPT Direct File Upload

Reverts to the old way of uploading files on ChatGPT

  1. // ==UserScript==
  2. // @name ChatGPT Direct File Upload
  3. // @namespace VphTvD
  4. // @match https://chatgpt.com/*
  5. // @grant none
  6. // @version 1.0
  7. // @author VphTvD
  8. // @description Reverts to the old way of uploading files on ChatGPT
  9. // @run-at document-idle
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. var observer = new MutationObserver(function(m) {
  14. m.forEach(function(item) {
  15. var x = item.addedNodes[0] && item.addedNodes[0].childNodes[0] && item.addedNodes[0].childNodes[0].childNodes;
  16. if (x && x.length == 4 && x[3].className == 'flex items-center m-1.5 p-2.5 text-sm cursor-pointer focus-visible:outline-0 radix-disabled:pointer-events-none radix-disabled:opacity-50 group relative hover:bg-[#f5f5f5] focus-visible:bg-[#f5f5f5] dark:hover:bg-token-main-surface-secondary dark:focus-visible:bg-token-main-surface-secondary rounded-md my-0 px-3 mx-2 radix-state-open:bg-[#f5f5f5] dark:radix-state-open:bg-token-main-surface-secondary gap-2.5 py-3') x[3].click();
  17. });
  18. });
  19. observer.observe(document.body, { childList: true });