copy-selection-as-markdown
copy-selection-as-markdown copied to clipboard
optionally embedd images as base64
It's possible to embed images via data URLs in base64. For example

It would be nice if copy-selection-as-markdown would support this functionality as well.
This way it would be easier to have a full backup of an article that might be deleted later on, including it's resources.
PS: Thank you for this extension :pray:
PPS: There are also browser extensions like img2base64, that allow to copy an image as base64 directly. Maybe it would be possible to take that logic from there?
There's also a tool for backing up Medium articles called medup that's doing this.
What I like about the approach in medup is, that the images are only inlined at the end and there are only references to them within the regular text flow.
@alexanderadam: Thanks a lot for your suggestion! I don't have your use case but interesting enhancement. challenge accepted!
Will update this issue after release.
@alexanderadam: Just released v0.20.4 which contains this feature. Grub your update and let me know if you found any issue. Thanks!
Check Embed imgs (.gif, .jpg, .jpeg, .png, and .webp) as base64 text as possible at Advanced setting to enable the feature. It requires additional permission to access referenced images.
@0x6b, Thank you so much for working on this. :raised_hands: Unfortunately it didn't work properly when I just tested this. I marked your avatar here on this issue page and I got a reference but it wasn't base64 encoded.
It looks like this:
[![@0x6b][img1]](https://github.com/0x6b) [ 0x6b](https://github.com/0x6b)
[img1]: https://avatars0.githubusercontent.com/u/679719?s=40&v=4
EDIT: Maybe it's a permission thing because it's working perfectly on other sites!
I accepted the permission to access everything but it's not appearing at the listed permissions (only Input data to the clipboard is listed.):

Maybe I somehow misunderstand the optional permission concept. I also see permission error in the console like:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://github.githubassets.com/images/spinners/octocat-spinner-32.gif. (Reason: CORS header ‘Origin’ cannot be added).
Will work on this again. Thanks for testing!
EDIT: Easiest solution is to add <all_urls> permission request by default, but it's too open for advanced options.
Easiest solution is to add
<all_urls>permission request by default, but it's too open for advanced options.
I absolutely agree and I value your concerns in this regards. :+1: More people should focus which permissions their extension or app is using.