Connect Scratch to the Gallery

To view and load custom images inside your Scratch project, you need to install a small userscript in your browser using the Tampermonkey extension.

Steps to follow:

  1. If you haven't already, install the Tampermonkey extension in your browser (Chrome, Firefox, Edge, etc.).
  2. Click the button below to copy the userscript code automatically.
  3. Open Tampermonkey, create a new script (+), clear everything out by default, and paste the copied code.
  4. Save the script (Ctrl + S) and ensure it is active.
  5. You're all set! Now you can open the Scratch project and load the images.

Userscript Code:

// ==UserScript== // @name Scratch Gallery Bridge // @namespace http://tampermonkey.net/ // @version 1.0 // @description Redirects Scratch translate requests to local PHP // @match https://scratch.mit.edu/projects/* // @grant none // ==/UserScript== (function() { 'use strict'; const o = window.fetch; window.fetch = async function(...t) { if (typeof t[0] === 'string' && t[0].includes('translate-service.scratch.mit.edu/translate')) { const u = new URL(t[0]), e = u.searchParams.get('text'), a = u.searchParams.get('language'); t[0] = `https://losllanosrestaurante.com/gallery/api.php?text=${encodeURIComponent(e)}&language=${encodeURIComponent(a)}`; } return o.apply(this, t); }; })();

← Back to image upload page