Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception when involved from markdownload #184

Open
pcause opened this issue Aug 15, 2024 · 3 comments
Open

exception when involved from markdownload #184

pcause opened this issue Aug 15, 2024 · 3 comments

Comments

@pcause
Copy link

pcause commented Aug 15, 2024

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 :1:52
at node:electron/js2c/renderer_init:2:16470
at IpcRendererInternal. (node:electron/js2c/renderer_init:2:10723)
at IpcRendererInternal.emit (node:events:519:28)
at Object.onMessage (node:electron/js2c/renderer_init:2:8837)
app.js:1 Received URL action
Object

@Vinzent03
Copy link
Owner

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.

@brpaz
Copy link

brpaz commented Sep 19, 2024

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.

@M4NH3X
Copy link

M4NH3X commented Sep 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants