TurboWarp / extensions

User-contributed unsandboxed extension gallery for TurboWarp
https://extensions.turbowarp.org/
MIT License
116 stars 237 forks source link

Unpredictable & Broken behavior with unsandboxed extensions loaded from localhost #222

Closed ImSomeOtherGuy closed 1 year ago

ImSomeOtherGuy commented 1 year ago

Unsandboxed extensions are looking to be an awesome thing, but trying to load custom ones has proven way more complicated than I thought. Considering I haven't seen anyone else mention this, the issues described below may be a problem with my setup (or skill) so I may try this on linux or another windows partition and do a follow-up comment later. If all the crap that keeps happening to me is my fault, then this issue can just be closed.

None of the extensions I tested were imported directly from the extension gallery. Anything from the extension gallery works flawlessly. Instead, I downloaded all the extensions from the repo itself (because there are some that are not in the gallery on the desktop app). I know for a fact that no firewall, proxy, port, or other settings are interfering with Turbowarp or Chrome in any way. I also have the newest version of Python installed.


Here are the issues in detail:

  1. Anything that uses online features on the online editor is extremely hit-or-miss. The default values for every block that uses online work as expected. However, as soon as I input anything from another domain, the blocks won't work. -For example, when I put in the localhost path of a text file into fetch, the block will report nothing. Sometimes it just stops immediately, but other times it goes on forever. -Strangely enough, the CMD window I have open which is logging traffic says there is a request made and gives me the 200 code along with the filename, meaning the connection was successful. (Even if the connection never actually finished!) Loading the same file path into a new chrome tab works exactly as expected.

  2. Anything online, period, on the desktop app, will not work. This includes things as simple as the "hello world" on fetch. Strangely enough, many extensions which normally could access local files now can't.


Below are some console errors I found when trying to run specific blocks.

This is what the console says whenever I try to use the fetch block in Turbowarp Desktop: weird error

Similarly, something happens whenever I try to load an image from penplus.js (still Turbowarp Desktop): error with penplus

Once again, this only applies to online stuff. Offline blocks, such as profanity.js, work just fine.

Here is an error with loading some text on fetch.js: fetch error on online This one could be my fault, but considering the script has no documentation regarding this, I'm not fully sure.


Once again, I will follow up with another comment saying if I was successful with other operating systems and how things worked with other extensions.

GarboMuffin commented 1 year ago

Scratch.fetch is not a function

Desktop app is old, will be fixed in next update. Just use fetch() instead for now.

Access to fetch at ... Access-Control-Allow-Origin ...

Your server needs to set Access-Control-Allow-Origin to * so that other websites are allowed to access it (this being opt-in is why online banking is not completely insecure). Google "cors" to learn more. The development server we provide in this repository does so automatically as does extensions.turbowarp.org.

GarboMuffin commented 1 year ago

Things in the gallery work flawlessly because they use an old snapshot which doesn't use things that aren't yet supported in the desktop app: https://github.com/TurboWarp/extensions/tree/08b82d4605b4de4a11d994dde65b9b01a89d7587

ImSomeOtherGuy commented 1 year ago

Good to know, thanks for the quick response!!