-
Notifications
You must be signed in to change notification settings - Fork 3
Adding SVG support? #21
Comments
Okay, this is kinda hard to do 😅 |
or, y'know, |
@easrng Yes, that is what I tried. I noticed some days ago that canvg isn't needed; it's built-in in most browsers. |
Currently, the thumbnails don't support SVG. But there's a way of still doing it: Using assets.scratch.mit.edu. |
@NoobTracker assets.scratch.mit.edu is not whitelisted. |
Ohhh it's possible. I found an exploit that makes that possible. Look at this, someone either copied my idea or discovered it too. And it is technically whitelisted. |
@NoobTracker Oh, that's interesting. |
Indeed. You need to use |
Ping @JeffaloBob, assets are possible. |
I already told Jeffalo, he tried it. |
Currently, if you upload an SVG image, the image will not appear and a 500 error occurs.
We should convert the SVG to PNG. This is easy: you can create a canvas element, render the SVG on it, and finally grab a picture of the canvas using canvas.toDataURL.
The harder part is that it doesn't work if the canvas is offscreen. To fix that, we can use @canvg. Create a file called canvg.js with these contents, and also add it to the content scripts in manifest.json.
We first need to merge #20 before I can start working on it.
The text was updated successfully, but these errors were encountered: