obsidian-advanced-uri icon indicating copy to clipboard operation
obsidian-advanced-uri copied to clipboard

Doesn't work correctly in Linux

Open athyfr opened this issue 1 year ago • 3 comments

I've tried to use this with ReadItLater and the Obsidian Web Clipper browser extension, but it doesn't seem to do anything when the URI is passed to it. I know I configured the browser extension as instructed, but it doesn't work.

This is related to the following issue on the Web Clipper: Issue 11 on Obsidian Web Clipper

EDIT: I'm using a Linux distro (NixOS) along with the Firefox fork Librewolf, and while the changes in the browser shouldn't change anything, the web clipper issue describes that this is specific to Linux.

athyfr avatar Sep 12 '24 23:09 athyfr

Same here.

slarrain avatar Sep 14 '24 17:09 slarrain

Please elaborate your situation more. Is Obsidian already open? If not does Obsidian start? Does the Browser ask you to launch the uri or have you clicked to always allow opening Obsidian uris. Please share the content of the console (CTRL+SHIFT+I) after executing the uri from the browser. If it does not contain the uri and the parsed query parameters, the issues does not lie in this plugin. Do the default Obsidian uris work?

Vinzent03 avatar Sep 15 '24 15:09 Vinzent03

When I have obsidian closed and use the web clipping shortcut, it launches obsidian as expected (without saving site)

This URI from the docs seems to work (running directly from Obsidian): [This here is shown](obsidian://adv-uri?filepath=Home%20Index%2Ftoday)

Testing, the ReadItLater URI save link seems to work when run directly in Obsidian: [Save webpage from clipboard](obsidian://advanced-uri?commandname=ReadItLater%3A%20Save%20clipboard) or [Save webpage from clipboard](obsidian://advanced-uri?vault=Obsidian%20Vault&commandname=ReadItLater%3A%20Save%20clipboard)

Checking the console, I found the following error (after running with browser extension link):

app.js:1 Obsidian Developer Console
node:electron/js2c/renderer_init:2 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
  Policy set or a policy with "unsafe-eval" enabled. This exposes users of
  this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.
warnAboutInsecureCSP @ node:electron/js2c/renderer_init:2
app.js:1 Received URL action Object
app.js:1 Uncaught (in promise) Error: Request failed, status 403
    at new t (app.js:1:2030716)
    at vK (app.js:1:2030908)
    at app.js:1:2031587
    at app.js:1:237138
    at Object.next (app.js:1:237243)
    at a (app.js:1:235961)
app.js:1 Received URL action Objectaction: "adv-uri"filepath: "Home Index/today.md"[[Prototype]]: Object
app.js:1 Received URL action Objectaction: "advanced-uri"commandname: "ReadItLater: Save clipboard"vault: "Obsidian Vault"[[Prototype]]: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()__proto__: (...)get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()
plugin:obsidian-read-it-later:146 Uncaught (in promise) DOMException: Failed to execute 'readText' on 'Clipboard': Document is not focused.
    at Rt.processClipboard (plugin:obsidian-read-it-later:146:2908)
    at Object.callback (plugin:obsidian-read-it-later:146:2444)
    at te.handleCommand (plugin:obsidian-advanced-uri:10:604)
    at ge.chooseHandler (plugin:obsidian-advanced-uri:14:6726)
    at ge.onUriCall (plugin:obsidian-advanced-uri:14:6436)
    at eval (plugin:obsidian-advanced-uri:14:4534)
    at t (app://obsidian.md/app.js:1:2281449)
    at <anonymous>:1:52
    at node:electron/js2c/renderer_init:2:16470
    at IpcRendererInternal.<anonymous> (node:electron/js2c/renderer_init:2:10723)

The error seems to be coming from ReadItLater! I'll open an issue there as well: Issue 173 on ReadItLater

athyfr avatar Sep 16 '24 15:09 athyfr

I'm not a Linux user so I can't confirm by myself, but Obsidian's official help page says:

Register Obsidian URI

On Windows and macOS, running the app once should be sufficient to register the Obsidian URI protocol on your computer.

On Linux, it is a much more involved process:

  1. Ensure you create a obsidian.desktop file. See here for details.
  2. Ensure that your desktop file specifies the Exec field as Exec=executable %u. The %u is used to pass the obsidian:// URIs to the app.
  3. If you're using the AppImage installer, you may have to unpack it using Obsidian-x.y.z.AppImage --appimage-extract. Then make sure the Exec directive points to the unpacked executable.

Does this sound relevant?

It's also mentioned in the troubleshooting page of Obsidian Web Clipper (https://help.obsidian.md/web-clipper/troubleshoot#Linux):

Linux

Obsidian does not open

RyotaUshio avatar Oct 24 '25 03:10 RyotaUshio

I've migrated away from Obsidian, so I'll close the issue. If anyone else is experiencing the issue, they can reopen it.

athyfr avatar Oct 24 '25 04:10 athyfr

@athyfr I think only you and the maintainers can reopen this issue so I'd suggest keeping it open.

RyotaUshio avatar Oct 24 '25 06:10 RyotaUshio

@athyfr I think only you and the maintainers can reopen this issue so I'd suggest keeping it open.

Alright.

athyfr avatar Oct 24 '25 06:10 athyfr