andy-portmen / open-in

Send URLs from one browser to another one
http://add0n.com/open-in.html
172 stars 113 forks source link

Chromium Snap version on Ubuntu - Check Connection Status Fails #61

Open ryanerwin opened 3 years ago

ryanerwin commented 3 years ago

The default version of Chromium on Ubuntu these days is the Snap version doesn't use the NativeMessagingHosts folder the same was as regular (native, unsandboxed) Chromium. So access to ~/.config/chromium/NativeMessagingHosts/com.add0n.node.json and to the ~/.config/com.add0n.node/run.sh do not work with the snap.

There's no way to simply convert a strict (normal) mode snap to classic (thus providing normal file and process access) so the easiest solution is probably to use native (non snap packaged) Chromium...

https://forum.snapcraft.io/t/system-files-under-mozilla-native-mestsaging-hosts/13627/46

The simplest solution for now is to get rid of the snap and switch to deb provided directly from Google Chrome:

https://www.google.com/chrome/?platform=linux

Hopefully there is a good alternative... Ungoogled Chromium may also be an option, but the install process is more involved.

https://github.com/ungoogled-software/ungoogled-chromium-debian

andy-portmen commented 2 years ago

Currently there is no workaround to get the Snap version to work.

https://github.com/andy-portmen/native-client/issues/108

michas79de commented 9 months ago

I've built my workaround for opened tabs with AutoKey, which I already had installed:

I made a new script, triggered by the hotkey <alt>+<ctrl>+c, e.g., triggered only in Firefox (window filter "Navigator.firefox"):

# Enter script code
keyboard.send_keys("<alt>+s")
time.sleep(0.1)
keyboard.send_keys("<ctrl>+c")
time.sleep(0.1)
text = clipboard.get_clipboard()
time.sleep(0.1)
system.exec_command("chromium %s" % text, getOutput=False)

It activates the address bar, copies the URL and run chromium with the URL as argument - exactly what I need. (I tried also putting some JavaScript as inline code javascript:(function(){...;})(); as fav in the fav bar just for a mouse click instead of the hotkey, but there seems to be security policies, forbidding Firefox interactions with the outside environment.)

Opening (not already opened) links into Chromium won't do this way, but should be possible with a few adoptions, i think