Closed luckman212 closed 3 years ago
Hi @NomarCub -- I have been working on this for a bit. Please help me clean this up if you have any ideas!
Hi! I'd also like to have this feature, but I don't have much free time for this now, and this is not within my expertise. But I'll help as I can. Before merging the following should be addressed:
let
or const
instead of var
as
or <>
)The plugin doesn't load for me on Android, here's the error:
Plugin failure: copy-url-in-preview TypeError: Cannot destructure property 'clipboard' of 'require(...)' as it is undefined.
at anonymous (eval at <anonymous> (app.js:1), <anonymous>:10:9)
at t.<anonymous> (app.js:1)
at app.js:1
at Object.next (app.js:1)
at s (app.js:1)
Ok @NomarCub I'll try to clean those up a bit. This was more of a POC to see if copy image was possible. I don't have an Android device to test with but I will see if I get the same errors on iOS and try to fix.
I think I'm on the right path but I'm hitting a wall on this and have posted to the Developers/API forum asking for some help. I'm continuing to try!
Fixing right click → copy image function in plugin - Developers & API - Obsidian Forum
Update: rewritten PR #3 is up... should be quite a bit better than the ugliness above (thanks @sissilab)
feature add: right click to copy image to clipboard
This is some very hacky code. 😱 I'm sorry.
Notes
contents.copyImageAt(x,y)
-- (see here) is the right solution?Related research links:
thank you: https://stackoverflow.com/questions/17124053/node-js-get-image-from-web-and-encode-with-base64