obsidian-advanced-uri
obsidian-advanced-uri copied to clipboard
exception when involved from markdownload
When I try to send a page from my browser to Obsidian using markdownload, advanced URI shows this error in the console:
ncaught (in promise) DOMException: Failed to execute 'readText' on 'Clipboard': Document is not focused.
at eval (plugin:obsidian-advanced-uri:4764:53)
at t (app://obsidian.md/app.js:1:2296691)
at
Seems like it requires the app to be focused for the clipboard's content to be accessed. Shouldn't the launch of the uri focus the app? I haven't used markdownload, though.
I have the same issue.
I can reproduce using a uri like:
obsidian://advanced-uri?vault=Myvault&clipboard=true&mode=new&filepath=90 - Web Clippings/test.md
This is the uri that markdownload is triggering
If I remove the clipboard query parameter the page gets created (without content as expected, but without errors).
I tried with both, Obsidian already open or closed.
Seems like it requires the app to be focused for the clipboard's content to be accessed. Shouldn't the launch of the uri focus the app? I haven't used markdownload, though.
I am not sure if it will be helpful but I dig their code for this line: https://github.com/deathau/markdownload/blob/7e8cc1a2156a5b413db133677641c3f8a23cd39d/src/contentScript/contentScript.js#L106
Bug behavior:
- If Obsidian is closed, clicking on "Send to Obsidian" option in MarkDownload works perfect
- If Obsidian is opened, it's switching focus from browser to obsidian but nothing is happening
- If Obsidian is opened, and after clicking "Send to Obsidian" I focus on the app really fast, it works again