ChatGPT Image Upload Enabler

Attempt to enable image uploads on ChatGPT without Plus.

  1. // ==UserScript==
  2. // @name ChatGPT Image Upload Enabler
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Attempt to enable image uploads on ChatGPT without Plus.
  6. // @author YourName
  7. // @match https://chatgpt.com/*
  8. // @icon https://chatgpt.com/favicon.ico
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function enableImageUpload() {
  16. const chatInputArea = document.querySelector('textarea');
  17. if (!chatInputArea) return;
  18.  
  19. // Create an image upload button
  20. const uploadButton = document.createElement('input');
  21. uploadButton.type = 'file';
  22. uploadButton.accept = 'image/*';
  23. uploadButton.style.margin = '10px';
  24.  
  25. uploadButton.addEventListener('change', (event) => {
  26. const file = event.target.files[0];
  27. if (file) {
  28. alert(`Selected image: ${file.name}`);
  29.  
  30. // Placeholder action - real uploads require API access
  31. console.log('Image selected:', file);
  32. }
  33. });
  34.  
  35. // Insert the upload button before the input area
  36. chatInputArea.parentNode.insertBefore(uploadButton, chatInputArea);
  37. }
  38.  
  39. // Observe page for dynamic changes
  40. const observer = new MutationObserver(() => {
  41. if (!document.querySelector('input[type="file"]')) {
  42. enableImageUpload();
  43. }
  44. });
  45.  
  46. observer.observe(document.body, { childList: true, subtree: true });
  47.  
  48. enableImageUpload();
  49. })();