From 4ae14329c1a0fd2626c88bbcbd948be75d4adf06 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Mon, 27 May 2024 19:53:52 -0400 Subject: [PATCH 01/14] Create root --- images/PPPDUD/root | 1 + 1 file changed, 1 insertion(+) create mode 100644 images/PPPDUD/root diff --git a/images/PPPDUD/root b/images/PPPDUD/root new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/images/PPPDUD/root @@ -0,0 +1 @@ + From 8ee05731b91274525dfde79a82d033ca1665e286 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Mon, 27 May 2024 18:55:06 -0500 Subject: [PATCH 02/14] Add files via upload --- images/PPPDUD/fetchplus.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 images/PPPDUD/fetchplus.svg diff --git a/images/PPPDUD/fetchplus.svg b/images/PPPDUD/fetchplus.svg new file mode 100644 index 0000000000..abe521f03b --- /dev/null +++ b/images/PPPDUD/fetchplus.svg @@ -0,0 +1 @@ +fetch+ \ No newline at end of file From 18b7eecc42c8caef85d12c8aea5a63fcfee549f6 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Mon, 27 May 2024 18:56:46 -0500 Subject: [PATCH 03/14] Add files via upload --- images/PPPDUD/fetchplus.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/PPPDUD/fetchplus.svg b/images/PPPDUD/fetchplus.svg index abe521f03b..ee5945c111 100644 --- a/images/PPPDUD/fetchplus.svg +++ b/images/PPPDUD/fetchplus.svg @@ -1 +1 @@ -fetch+ \ No newline at end of file +fetch+ \ No newline at end of file From 7094c2f76c50562098e11b85566521abf643b3a3 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Mon, 27 May 2024 19:57:30 -0400 Subject: [PATCH 04/14] Create fetchplus.js --- extensions/PPPDUD/fetchplus.js | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 extensions/PPPDUD/fetchplus.js diff --git a/extensions/PPPDUD/fetchplus.js b/extensions/PPPDUD/fetchplus.js new file mode 100644 index 0000000000..9974c6df7c --- /dev/null +++ b/extensions/PPPDUD/fetchplus.js @@ -0,0 +1,60 @@ +// Name: Fetch+ +// ID: fetchplus +// Description: Make requests to the broader internet and use CORS proxies. +// License: MPL-2.0 + +class AsyncExtension { + getInfo() { + return { + id: 'fetchplus', + name: 'Fetch+', + blocks: [ + { + opcode: 'fetch', + text: 'fetch [URL]', + blockType: Scratch.BlockType.REPORTER, + arguments: { + URL: { + type: Scratch.ArgumentType.STRING, + defaultValue: 'https://extensions.turbowarp.org/hello.txt' + } + } + }, + + { + opcode: 'cors_fetch', + text: 'fetch with proxy [URL]', + blockType: Scratch.BlockType.REPORTER, + arguments: { + URL: { + type: Scratch.ArgumentType.STRING, + defaultValue: 'https://extensions.turbowarp.org/hello.txt' + } + } + } + ] + }; + } + fetch (args) { + return fetch(args.URL) + .then((response) => { + return response.text(); + }) + .catch((error) => { + console.error(error); + return 'Uh oh! Something went wrong.'; + }); + } + + cors_fetch(args) { + return fetch('https://corsproxy.io/?' + encodeURIComponent(args.URL)) + .then((response) => { + return response.text(); + }) + .catch((error) => { + console.error(error); + return 'Uh oh! Something went wrong.'; + }); + } +} +Scratch.extensions.register(new AsyncExtension()); From 216f7cb0c83e6faca689071c0e9ec9b5964ca58e Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Mon, 27 May 2024 19:58:31 -0400 Subject: [PATCH 05/14] Update extensions.json --- extensions/extensions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/extensions.json b/extensions/extensions.json index 1afb46a935..436da73c38 100644 --- a/extensions/extensions.json +++ b/extensions/extensions.json @@ -9,6 +9,7 @@ "cursor", "runtime-options", "fetch", + "pppdud/fetchplus", "text", "local-storage", "true-fantom/base", From b6dcd6d3b765ffaff74b82f98a09aa582eae9a88 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 11:33:14 -0400 Subject: [PATCH 06/14] Delete images/PPPDUD/root --- images/PPPDUD/root | 1 - 1 file changed, 1 deletion(-) delete mode 100644 images/PPPDUD/root diff --git a/images/PPPDUD/root b/images/PPPDUD/root deleted file mode 100644 index 8b13789179..0000000000 --- a/images/PPPDUD/root +++ /dev/null @@ -1 +0,0 @@ - From 6a56eb85f5120a3d304114cae39be704d092fd96 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 11:33:36 -0400 Subject: [PATCH 07/14] Add files via upload --- images/PPPDUD/fetchplus.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/PPPDUD/fetchplus.svg b/images/PPPDUD/fetchplus.svg index ee5945c111..d62404ebba 100644 --- a/images/PPPDUD/fetchplus.svg +++ b/images/PPPDUD/fetchplus.svg @@ -1 +1 @@ -fetch+ \ No newline at end of file + \ No newline at end of file From 70e35d79135f99cd3b94ff349ad645fbe3470f4a Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 11:36:50 -0400 Subject: [PATCH 08/14] Add files via upload --- images/PPPDUD/fetchplus.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/PPPDUD/fetchplus.svg b/images/PPPDUD/fetchplus.svg index d62404ebba..02062e729d 100644 --- a/images/PPPDUD/fetchplus.svg +++ b/images/PPPDUD/fetchplus.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From ed42e0e7075cc025ee3f83409955439703b9614f Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 11:47:22 -0400 Subject: [PATCH 09/14] Add files via upload --- images/PPPDUD/fetchplus.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/PPPDUD/fetchplus.svg b/images/PPPDUD/fetchplus.svg index 02062e729d..753d4b8848 100644 --- a/images/PPPDUD/fetchplus.svg +++ b/images/PPPDUD/fetchplus.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From eb558ff5df337f54a7bcc165d803c371c23c5dce Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 11:50:31 -0400 Subject: [PATCH 10/14] Update fetchplus.svg --- images/PPPDUD/fetchplus.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/PPPDUD/fetchplus.svg b/images/PPPDUD/fetchplus.svg index 753d4b8848..9b1a2615fa 100644 --- a/images/PPPDUD/fetchplus.svg +++ b/images/PPPDUD/fetchplus.svg @@ -1 +1 @@ - \ No newline at end of file + From 7bd5f7d572f48085dab0999236ab16b7cd2656a7 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 11:55:37 -0400 Subject: [PATCH 11/14] Update fetchplus.js --- extensions/PPPDUD/fetchplus.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extensions/PPPDUD/fetchplus.js b/extensions/PPPDUD/fetchplus.js index 9974c6df7c..ef936c486a 100644 --- a/extensions/PPPDUD/fetchplus.js +++ b/extensions/PPPDUD/fetchplus.js @@ -3,6 +3,7 @@ // Description: Make requests to the broader internet and use CORS proxies. // License: MPL-2.0 +(function (Scratch) { class AsyncExtension { getInfo() { return { @@ -10,7 +11,7 @@ class AsyncExtension { name: 'Fetch+', blocks: [ { - opcode: 'fetch', + opcode: 'fetch_norm', text: 'fetch [URL]', blockType: Scratch.BlockType.REPORTER, arguments: { @@ -23,7 +24,7 @@ class AsyncExtension { { opcode: 'cors_fetch', - text: 'fetch with proxy [URL]', + text: 'fetch with CORS proxy [URL]', blockType: Scratch.BlockType.REPORTER, arguments: { URL: { @@ -35,8 +36,8 @@ class AsyncExtension { ] }; } - fetch (args) { - return fetch(args.URL) + fetch_norm (args) { + return Scratch.fetch(args.URL) .then((response) => { return response.text(); }) @@ -47,7 +48,7 @@ class AsyncExtension { } cors_fetch(args) { - return fetch('https://corsproxy.io/?' + encodeURIComponent(args.URL)) + return Scratch.fetch('https://corsproxy.io/?' + encodeURIComponent(args.URL)) .then((response) => { return response.text(); }) @@ -58,3 +59,4 @@ class AsyncExtension { } } Scratch.extensions.register(new AsyncExtension()); +})(Scratch); From 3e09e03742f06d8c075d163dbf9814f796d42e82 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 11:57:06 -0400 Subject: [PATCH 12/14] Update fetchplus.js --- extensions/PPPDUD/fetchplus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/PPPDUD/fetchplus.js b/extensions/PPPDUD/fetchplus.js index ef936c486a..c0fb99e0a2 100644 --- a/extensions/PPPDUD/fetchplus.js +++ b/extensions/PPPDUD/fetchplus.js @@ -2,7 +2,7 @@ // ID: fetchplus // Description: Make requests to the broader internet and use CORS proxies. // License: MPL-2.0 - +'use strict' (function (Scratch) { class AsyncExtension { getInfo() { From dd5fec190957c00ca86b19678aef83f16a2413c6 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 12:01:09 -0400 Subject: [PATCH 13/14] Update fetchplus.js --- extensions/PPPDUD/fetchplus.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/PPPDUD/fetchplus.js b/extensions/PPPDUD/fetchplus.js index c0fb99e0a2..7bd2b4512e 100644 --- a/extensions/PPPDUD/fetchplus.js +++ b/extensions/PPPDUD/fetchplus.js @@ -2,8 +2,9 @@ // ID: fetchplus // Description: Make requests to the broader internet and use CORS proxies. // License: MPL-2.0 -'use strict' + (function (Scratch) { + 'use strict' class AsyncExtension { getInfo() { return { From c634825b759d41350c58410e9a3b7a091c4ae17b Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Tue, 28 May 2024 12:02:43 -0400 Subject: [PATCH 14/14] Update fetchplus.js --- extensions/PPPDUD/fetchplus.js | 109 ++++++++++++++++----------------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/extensions/PPPDUD/fetchplus.js b/extensions/PPPDUD/fetchplus.js index 7bd2b4512e..724020dfc3 100644 --- a/extensions/PPPDUD/fetchplus.js +++ b/extensions/PPPDUD/fetchplus.js @@ -3,61 +3,60 @@ // Description: Make requests to the broader internet and use CORS proxies. // License: MPL-2.0 -(function (Scratch) { - 'use strict' -class AsyncExtension { - getInfo() { - return { - id: 'fetchplus', - name: 'Fetch+', - blocks: [ - { - opcode: 'fetch_norm', - text: 'fetch [URL]', - blockType: Scratch.BlockType.REPORTER, - arguments: { - URL: { - type: Scratch.ArgumentType.STRING, - defaultValue: 'https://extensions.turbowarp.org/hello.txt' - } - } - }, +(function(Scratch) { + 'use strict' + class AsyncExtension { + getInfo() { + return { + id: 'fetchplus', + name: 'Fetch+', + blocks: [{ + opcode: 'fetch_norm', + text: 'fetch [URL]', + blockType: Scratch.BlockType.REPORTER, + arguments: { + URL: { + type: Scratch.ArgumentType.STRING, + defaultValue: 'https://extensions.turbowarp.org/hello.txt' + } + } + }, - { - opcode: 'cors_fetch', - text: 'fetch with CORS proxy [URL]', - blockType: Scratch.BlockType.REPORTER, - arguments: { - URL: { - type: Scratch.ArgumentType.STRING, - defaultValue: 'https://extensions.turbowarp.org/hello.txt' - } - } - } - ] - }; - } - fetch_norm (args) { - return Scratch.fetch(args.URL) - .then((response) => { - return response.text(); - }) - .catch((error) => { - console.error(error); - return 'Uh oh! Something went wrong.'; - }); - } + { + opcode: 'cors_fetch', + text: 'fetch with CORS proxy [URL]', + blockType: Scratch.BlockType.REPORTER, + arguments: { + URL: { + type: Scratch.ArgumentType.STRING, + defaultValue: 'https://extensions.turbowarp.org/hello.txt' + } + } + } + ] + }; + } + fetch_norm(args) { + return Scratch.fetch(args.URL) + .then((response) => { + return response.text(); + }) + .catch((error) => { + console.error(error); + return 'Uh oh! Something went wrong.'; + }); + } - cors_fetch(args) { - return Scratch.fetch('https://corsproxy.io/?' + encodeURIComponent(args.URL)) - .then((response) => { - return response.text(); - }) - .catch((error) => { - console.error(error); - return 'Uh oh! Something went wrong.'; - }); - } -} -Scratch.extensions.register(new AsyncExtension()); + cors_fetch(args) { + return Scratch.fetch('https://corsproxy.io/?' + encodeURIComponent(args.URL)) + .then((response) => { + return response.text(); + }) + .catch((error) => { + console.error(error); + return 'Uh oh! Something went wrong.'; + }); + } + } + Scratch.extensions.register(new AsyncExtension()); })(Scratch);