Discuss Scratch

Sheep_maker
Scratcher
1000+ posts

Creating extensions for Scratch 3.0

psicinfoscratch wrote:

Now it works, thanks!
Could I ask you why apparently some of your blocks (from the example https://nitrocipher.github.io/ext2to3/ext-test.js? ) do not return anything? I am intending, in particular, “javascript”, “prompt user with” and “get data from url”
Unofficial extensions are run in a web worker, which doesn't have access to functions such as alert or prompt, which the alert _, prompt user with _, and the default value for the javascript _ block use

The default value for the get data from url: _ block, "http://google.com ," wouldn't work for two reasons:
  • it's served on http sites, and now https sites cannot request anything from a http site for security reasons
  • Google doesn't allow other web pages to fetch it for security reasons
Also, the block uses jQuery to fetch the data, but jQuery isn't included with his extension

- Sheep_maker This is a kumquat-free signature. :P
My signature appears below all my posts; discuss it on my profile, not the forums.
To make your own, click “Change your signature” at the bottom of the main forums page.

<key (join [enter] []) pressed?> // This works now
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
NitroCipher
Scratcher
500+ posts

Creating extensions for Scratch 3.0

psicinfoscratch wrote:

-snip-
Now it works, thanks!
Could I ask you why apparently some of your blocks (from the example https://nitrocipher.github.io/ext2to3/ext-test.js? ) do not return anything? I am intending, in particular, “javascript”, “prompt user with” and “get data from url”

Hi, glad to hear that it works! The reason these blocks don't work is due to Scratch using web workers to isolate javascript. In this case, javascript is unable to use a few functions such as eval, window/document variables, and ajax.

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
NitroCipher
Scratcher
500+ posts

Creating extensions for Scratch 3.0

Sheep_maker wrote:

-snip-

Also, the block uses jQuery to fetch the data, but jQuery isn't included with his extension

Ooops, completely forgot about jQuery when I made the 3.0 extension, I had written it to work through a chrome addon, and loaded jQuery through that. (it was originally an extension that loaded blocks directly into vanilla scratch)

I hope my post helped you in some way! Post count: 500+

Current project: [s3Blocks: scratchblocks rewritten for Scratch 3.0] ::#4b4a60 //https://scratch.mit.edu/discuss/topic/290031/ Basically done!
This is my signature identifier “aWFtbml0cm9jaXBoZXI=”
psicinfoscratch
New to Scratch
5 posts

Creating extensions for Scratch 3.0

NitroCipher wrote:

Sheep_maker wrote:

-snip-

Also, the block uses jQuery to fetch the data, but jQuery isn't included with his extension

Ooops, completely forgot about jQuery when I made the 3.0 extension, I had written it to work through a chrome addon, and loaded jQuery through that. (it was originally an extension that loaded blocks directly into vanilla scratch)

thanks for your kind attention, your posts were really useful to understand I have to face with another route to try to do what I want! (I have to try to modify scratch-vm very little just to save locally some execution data, but I still don't know how to do this)
ahtewhs
Scratcher
25 posts

Creating extensions for Scratch 3.0

Try to code this:When red button pressed
If do not know, then
when green flag clicked
forever
reset timer
end
when [ timer] > (0.01)
next backdrop
ahtewhs
Scratcher
25 posts

Creating extensions for Scratch 3.0

ummmmmmmmmmm……………………………………………………………………………………………………………………………………………………….
lktornado360
Scratcher
35 posts

Creating extensions for Scratch 3.0

ahtewhs wrote:

Try to code this:When red button pressed
If do not know, then
when green flag clicked
forever
reset timer
end
when [ timer] > (0.01)
next backdrop
that is unrelated

“Heluim is inert, it does not react to anything. This makes it perfect to help create a safe atmosphere for welding.” & “Atomic Number: 2; Formula: He; Atomic Weight: 4.002602; State at 20° C: gas; Boiling point: -268.928° C; Melting point: unknown; % in the Universe: 23; % in the Earth's crust: 0.00000055; % in Earths's oceans: 0.00000000072; % in humans: none.”
–The Periodic Table by Sean Callery and Miranda Smith

Powered by DjangoBB

Standard | Mobile