Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Creating *Unsandboxed* extensions for Scratch 3.0
- showierdata9978
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
About unsandboxed extensions
unsandboxed extensions are scratch extensions that have full access to the scratch VM
benifits to unsandboxed mode
- Your extension has access to the scratch VM
- Your extension runs faster (usually)
- You have access to all browser api's
Some Examples
Everything in Scratch 3.0 *Unsandboxed* Extension Directory
The Guide itself
Precursor
The Creating extensions for Scratch 3.0 thread by NitroCipher is a precursor to this thread, and shows how to make scratch extentons that are sandboxed. but also does into detail on how to set your environment and extension class up
How to load unsandboxed extentions
// major credit to CST for this (I did modify it some to allow sandboxed if you only want the speed boost (: const extensionClass = YourExt; if (Scratch) { if (Scratch.extensions.unsandboxed) { Scratch.extensions.register(new extensionClass(Scratch.vm)); } else { // comment out if you use VM things Scratch.extensions.register(new extensionClass()); // throw new Error("YourExt cannot run in sandboxed mode."); } } else if (globalThis.vm) { // Support loading the extension "the old way" // (running the code in something like the browser console // or E羊icques' load_plugin URL parameter) const extensionInstance = new extensionClass(globalThis.vm); const serviceName = globalThis.vm.extensionManager._registerInternalExtension( extensionInstance ); globalThis.vm.extensionManager._loadedExtensions.set( extensionInstance.getInfo().id, serviceName ); } else { throw new Error("Scratch Not detected"); // no idea if there is anything else i can do here };
Scratch VM Docs
There Is currently documentation of the Scratch VM, but it uses jsdoc. The Docs are not helpful. The url is here
Warning: it is on github pages, which is blocked by most schools
another good source of documentation is Turbowarp's type repo . Its helpful because you can load it into your TypeScript aware IDE and see all the vm's types and internals in intelisense.
Browser API Docs
The Most trusted Browser API docs are made by Mozilla. (the company that owns firefox). here are some useful links for making scratch extentions.
- https://developer.mozilla.org/en-US/docs/Web/API
- https://developer.mozilla.org/en-US/docs/Web/JavaScript
- https://developer.mozilla.org/en-US/docs/Web
The name of the web documentation is mdn (mozilla developer network) web docs. it has a github and a website.
FAQ
-
this is incredibly interesting, unsandboxed extensions seem really useful. why haven't i heard of this??
Because before a few weeks ago, you had to use internal Scratch.extentions.* methods
Last edited by showierdata9978 (Jan. 17, 2023 15:31:30)
High School freshman
unsandboxed extension directory
Creating unsandboxed extensions
https://github.com/showierdata9978
(Scroll down to see more info about me)
People I know (And Work With):
* know0your0true0color
* CST1229
* zedthehedgehog
(if you want to know what char i used this is it “ ”)
I only use scratch for the fourms. I only talk on developing scratch extentions, and Advanced topics
Problem ST?

- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
Suggestion: add example blocks for all block types that will do something(idk what)
Hi! I'm know0your0true0color, you can also call me Fresh
- jaxon_baxon
-
11 posts
Creating *Unsandboxed* extensions for Scratch 3.0
this is incredibly interesting, unsandboxed extensions seem really useful. why haven't i heard of this??
- showierdata9978
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
– outdated information used to be here –
Last edited by showierdata9978 (Dec. 15, 2022 17:48:37)
High School freshman
unsandboxed extension directory
Creating unsandboxed extensions
https://github.com/showierdata9978
(Scroll down to see more info about me)
People I know (And Work With):
* know0your0true0color
* CST1229
* zedthehedgehog
(if you want to know what char i used this is it “ ”)
I only use scratch for the fourms. I only talk on developing scratch extentions, and Advanced topics
Problem ST?

- CST1229
-
1000+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
I have also made an extension (st: not a browser extension!) that can only run unsandboxed by the way (to load images from URL and stamp them onto the stage).
(does this count as advertising?)
(does this count as advertising?)
Last edited by CST1229 (Oct. 4, 2022 17:12:01)
This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023

RIP assets image hosting. 2013?-2023

- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
Bump!
Great to see some recognition!
Great to see some recognition!
Hi! I'm know0your0true0color, you can also call me Fresh
- showierdata9978
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
an extension (st: not a browser extension!) that can only run unsandboxed by the way (to load images from URL and stamp them onto the stage).I have also made
(does this count as advertising?)
il just add it as an example!
and no its does not (for me atleast)
High School freshman
unsandboxed extension directory
Creating unsandboxed extensions
https://github.com/showierdata9978
(Scroll down to see more info about me)
People I know (And Work With):
* know0your0true0color
* CST1229
* zedthehedgehog
(if you want to know what char i used this is it “ ”)
I only use scratch for the fourms. I only talk on developing scratch extentions, and Advanced topics
Problem ST?

- DifferentDance8
-
1000+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
Wait a second, nono word allows you to load unsandboxed extensions? They have to be injected with nono word
Scratch Team: “Sorry, but we can't add a forum search function because we can't edit the forum page”
Also Scratch Team: “Here we edited the forum page to add the mainsite filter”
Notice how this is self-contradictory?
=







=
“average person eats 3 spiders a year" factoid actualy (sic) just statistical error. average person eats 0 spiders per year. Spiders Georg, who lives in cave & eats over 10,000 each day, is an outlier adn should not have been counted
=
I have become a mega-strickler for the rules now


- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
no i dont think soWait a second, nono word allows you to load unsandboxed extensions? They have to be injected with nono word
you have to load them with a bookmarklet(bookmark that runs js) or
https://sheeptester.github.io/scratch-gui/?load_plugin=(url)
i dont think bookmarklet is a nono word on here
Last edited by know0your0true0color (Oct. 6, 2022 13:56:10)
Hi! I'm know0your0true0color, you can also call me Fresh
- showierdata9978
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
– outdated information used to be here –
Last edited by showierdata9978 (Dec. 15, 2022 17:49:25)
High School freshman
unsandboxed extension directory
Creating unsandboxed extensions
https://github.com/showierdata9978
(Scroll down to see more info about me)
People I know (And Work With):
* know0your0true0color
* CST1229
* zedthehedgehog
(if you want to know what char i used this is it “ ”)
I only use scratch for the fourms. I only talk on developing scratch extentions, and Advanced topics
Problem ST?

- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
i made a bookmarklet that can inject scratch extensionsWait a second, nono word allows you to load unsandboxed extensions? They have to be injected with nono word
Ye, using one that can inject javascript into pages
you can also use sheeptesters scratch GUI
javascript:(function()%7Bfetch(prompt('url%3F')).then(r%3D>r.text()).then(t%3D>eval(t))%7D)()%3B
click on it to use
Last edited by know0your0true0color (Oct. 6, 2022 18:11:35)
Hi! I'm know0your0true0color, you can also call me Fresh
- CST1229
-
1000+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
(#11)Use [code][/code] tags:i made a bookmarklet that can inject scratch extensionsWait a second, nono word allows you to load unsandboxed extensions? They have to be injected with nono word
Ye, using one that can inject javascript into pages
you can also use sheeptesters scratch GUI
javascriptfunction()%7Bfetch(prompt('url%3F')).then(r%3D>r.text()).then(t%3D>eval(t))%7D)()%3B
replace the sad face with a : and a ( combined
make a bookmark in your browser with this as the url
click on it to use
javascript:(function()%7Bfetch(prompt('url%3F')).then(r%3D>r.text()).then(t%3D>eval(t))%7D)()%3B
This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023

RIP assets image hosting. 2013?-2023

- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
thx(#11)Use [code][/code] tags:i made a bookmarklet that can inject scratch extensionsWait a second, nono word allows you to load unsandboxed extensions? They have to be injected with nono word
Ye, using one that can inject javascript into pages
you can also use sheeptesters scratch GUI
javascriptfunction()%7Bfetch(prompt('url%3F')).then(r%3D>r.text()).then(t%3D>eval(t))%7D)()%3B
replace the sad face with a : and a ( combined
make a bookmark in your browser with this as the url
click on it to usejavascript:(function()%7Bfetch(prompt('url%3F')).then(r%3D>r.text()).then(t%3D>eval(t))%7D)()%3B
Hi! I'm know0your0true0color, you can also call me Fresh
- showierdata9978
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
Scriptlets do not work on firefox it seems like
High School freshman
unsandboxed extension directory
Creating unsandboxed extensions
https://github.com/showierdata9978
(Scroll down to see more info about me)
People I know (And Work With):
* know0your0true0color
* CST1229
* zedthehedgehog
(if you want to know what char i used this is it “ ”)
I only use scratch for the fourms. I only talk on developing scratch extentions, and Advanced topics
Problem ST?

- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
Suggestion: add GameUtils as a example(also include the topic link)
Hi! I'm know0your0true0color, you can also call me Fresh
- showierdata9978
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
– outdated information used to be here –
Last edited by showierdata9978 (Dec. 15, 2022 17:50:01)
High School freshman
unsandboxed extension directory
Creating unsandboxed extensions
https://github.com/showierdata9978
(Scroll down to see more info about me)
People I know (And Work With):
* know0your0true0color
* CST1229
* zedthehedgehog
(if you want to know what char i used this is it “ ”)
I only use scratch for the fourms. I only talk on developing scratch extentions, and Advanced topics
Problem ST?

- CST1229
-
1000+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
(#16)On Scratch, “nono word” usually refers to a specific browser extension for Scratch and not any browser extension.Wait a second, nono word allows you to load unsandboxed extensions? They have to be injected with nono word
yes there are nonoword js, html, css injectors that you can use to run JavaScript in a tab
This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023

RIP assets image hosting. 2013?-2023

- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
Imagine if this got stickied





Hi! I'm know0your0true0color, you can also call me Fresh
- know0your0true0color
-
100+ posts
Creating *Unsandboxed* extensions for Scratch 3.0
bump!
Hi! I'm know0your0true0color, you can also call me Fresh
- ohman_soonsoon
-
27 posts
Creating *Unsandboxed* extensions for Scratch 3.0
i wanna make admireblocks+ with this, but do i need to require ‘async’ and ‘try’ when making the block functions?
Drannamongtime, the creator of the scratch extension “Admireblocks”.
[Admireblocks] to BASE64 :: reporter :: #8b7fc9
BASE64 [QWRtaXJlYmxvY2tz] To text :: reporter :: #8b7fc9
(item [last v] of [this v] :: list)
- Discussion Forums
- » Developing Scratch Extensions
-
» Creating *Unsandboxed* extensions for Scratch 3.0