add extension: ShareSheet - #2269
Conversation
|
Your image should be SVG + you need to add your extension to |
|
Ok let me do this maybe later |
|
!format |
I didn't bother to add casting past the "setdatatourl" block
|
!format |
|
@CreeperNewGamer the previous commit should fix some of your issues In the future, always try to use Scratch.Cast and Scratch.translate where applicable. If you want this extension to appear in the gallery, you'll need to add the relevant information to |
This comment was marked as resolved.
This comment was marked as resolved.
|
Oh thanks, is this helping me so much! YAY! |
|
Also can you please appear this extension on the gallery, and you also help me creating a better thumbnail! |
I'll see what I can do, but I'm not good at graphic design. |
|
I added the line to extensions.json, so your extension should appear somewhere around the middle of the gallery if this gets merged. |
Cast.toBool doesn't exist; toBoolean does.
|
Your code had a bug causing the <is share sheet supported?> block to hang forever, so I fixed it for you. |
Thanks |
Happy to help! |
|
ShareSheet is not supported on Chromium with Ubuntu 25.04; what platforms is it supposed to work on? |
This also does not work. Tested on Arch Linux, Chromium 141.0.7390.76. |
|
But is working on iPad 7th running iPadOS 18.7, for me |
|
To answer this question "what platforms is it supposed to work on" is mobile or windows 11 |
I'm confused. |
Sorry, but I have a time limit on my computer, so I use my iPad instead 😕! |
I mean the request change |
|
It's been a hot second sorry |
|
@Brackets-Coder I believe that it's Saturday now. |
|
It's an unexpectedly very busy Saturday |
There was a problem hiding this comment.
I apologize for my tardiness. Yesterday was really busy
- I verified that the extension follows all acceptance criteria and guidelines in CONTRIBUTING.md.
- I believe the block list is well-designed and intuitive.
- I tested all functionality and found no bugs, security flaws, or unintuitive behavior.
- I reviewed the code and believe it is well-written and easy to maintain or extend in the future, even without help from the original author.
- I have no additional concerns.
"set image data to costume" block still seems to report a blank image:
"The file 'image.png' could not be opened. It may be damaged or use a file format that Preview doesn’t recognize."
Everything else looks good. Fix this and you'll get my approval. Fantastic work!
|
@CreeperNewGamer Just checking in—is there anything else I can help you with? |
|
@CreeperNewGamer This PR is getting a little stale—would you like to continue working on it? There's just one fix before I approve! |
|
Yes |
|
Hello @CreeperNewGamer Just checking in on your progress. Is there anything I can help you with? |
|
I want to merge it |
|
Okay, I can help make that happen, but I'll need another reviewer to help me In the previous testing, I couldn't get "set image data to costume" to work. The file seems to have attempted to upload, but its data is corrupted. Can this be fixed before merging? Thanks |
|
sigh Time to unsubscribe from this issue. |
I'm sorry you've had an unpleasant experience :/ |
|
!format |
|
On my last change I added images to blocks |
|
Cool, I can help you better after I get home from work |
There was a problem hiding this comment.
- I verified that the extension follows all acceptance criteria and guidelines in CONTRIBUTING.md.
- I believe the block list is well-designed and intuitive.
- I tested all functionality and found no bugs, security flaws, or unintuitive behavior.
- I reviewed the code and believe it is well-written and easy to maintain or extend in the future, even without help from the original author.
- I have no additional concerns.
Everything looks good, just a few nitpicky things. You may want to make sure the "set data from costume" block works with SVG costumes as well. If not, you should specify that block is only for bitmap costumes and only accept bitmap costumes
| const imageFile = new File([blob], "image.png", { | ||
| type: blob.type, | ||
| }); |
There was a problem hiding this comment.
This assumes the image is a PNG?
There was a problem hiding this comment.
Maybe it should detect the type of the asset
| async setdatatocostume({ COSTUME: costumeName }, util) { | ||
| const target = util.target; | ||
| const costumeIndex = target.getCostumeIndexByName(costumeName); | ||
| const costume = target.sprite.costumes[costumeIndex]; | ||
| const asset = costume.asset.encodeDataURI(); | ||
|
|
||
| this.hasError = false; | ||
| try { | ||
| const response = await Scratch.fetch(asset); | ||
| const blob = await response.blob(); | ||
|
|
||
| const imageFile = new File([blob], "image.png", { | ||
| type: blob.type, | ||
| }); | ||
|
|
||
| this.dataType = "image"; | ||
| this.data = imageFile; | ||
| } catch (err) { | ||
| this.hasError = true; | ||
| this.errorMsg = err.message; | ||
| } | ||
| } |
There was a problem hiding this comment.
I was only able to get this block to work with bitmap costumes. Many costumes will be vector. Either specify "set data to bitmap costume" or, better, convert the costume to bitmap before setting the data.
|
Thanks for contributing! |
Co-authored-by: Brackets-Coder <142950368+Brackets-Coder@users.noreply.github.com>


No description provided.