Open cdloh opened 3 weeks ago
On my iPhone the title is properly fetched from Safari if I tap the URL and copy, but not if I do Share>Copy. Note that I get the "Allow copy" warning which might be part of the problem. Either way works with Firefox.
On my iPhone the title is properly fetched from Safari if I tap the URL and copy, but not if I do Share>Copy.
Same on my iPhone and iPad.
Hi love the plugin and regularlly use it but for some reason it's super inconsistent on iOS and for the life of me I can't figure out why. I've tracked a few things down and will note them below
clipboardData.getData("text/plain");
isnull
or blank string sometimes I can't figure out why this is but swapping tonavigator.clipboard.readText()
fixes this and is always consistent. However if weawait
on thereadText
here it then causes the text to get over ridden on selection :(Steps to reproduce this
Open safari and browser to a URL
Click Share and then Copy
Open Obsidian and Paste into a note
Pasting a link appears to automatically parse it into a URL causing the
shouldPreserveSelectionAsTitle
option to trigger even though before the paste event we didn't have anything selected Adding a check to see if the selected text is the same as the paste text fixes thisIt's worth noting that sometimes this isn't even an issue! I don't know what causes the inconsistency at all. For example if I copy a URL within obsidian and then paste it again the clipboardData is consistent.