pdf / kdeconnect-chrome-extension

A browser extension to send pages and content from your browser to connected KDE Connect devices.
https://chrome.google.com/webstore/detail/kde-connect/ofmplbbfigookafjahpeepbggpofdhbo
MIT License
233 stars 29 forks source link

Setting up on chromium in Linux Mint 20 #36

Open Coolwhipit opened 4 years ago

Coolwhipit commented 4 years ago

Describe the bug Installed chromium with snapd, after re-enabling/installing on Mint 20, to /home/snap directory. Downloaded native host and tried to set up by both pointing to chromium and pointing to custom path "/home/snap/chromium/NativeMessagingHosts". KDE connect extension continues to say "error: Can not connect to native host" "error: No version response recieved from native host"

Smartphone (please complete the following information):

Additional context I have never used the extension with previous linux mint distros, so I am not sure if this is a mint problem in general...or a mint 20/snap problem.

pdf commented 4 years ago

This is almost certainly a snap-related problem. IIRC snaps have some sort of isolation by default, where they can only access certain paths. I have no idea where a snap-installed chromium expects to find its native messaging hosts (in a non-snap install, the system path is usually /etc/chromium/native-messaging-hosts/), but if you can work that out, and place the two files there, you will then need to edit the com.0xc0dedbad.kdeconnect_chrome.json file and update the path field to point to the right location. However, I don't know if snaps behave like a chroot - if they do you would have to trim off the snap prefix from the absolute path outside the snap.

Coolwhipit commented 4 years ago

I already put the files at said location "/home/user/snap/chromium/nativemessaginghosts" and the Jason file points to the right location...what do you mean trim off trim off the snap prefix? Where do I do that?

On Wed, Jul 15, 2020, 1:04 AM Peter Fern notifications@github.com wrote:

This is almost certainly a snap-related problem. IIRC snaps have some sort of isolation by default, where they can only access certain paths. I have no idea where a snap-installed chromium expects to find its native messaging hosts (in a non-snap install, the system path is usually /etc/chromium/native-messaging-hosts/), but if you can work that out, and place the two files there, you will then need to edit the com.0xc0dedbad.kdeconnect_chrome.json file and update the path field to point to the right location. However, I don't know if snaps behave like a chroot - if they do you would have to trim off the snap prefix from the absolute path outside the snap.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pdf/kdeconnect-chrome-extension/issues/36#issuecomment-658547512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQJGIEKG4DOSAGCEO2BUGKDR3U2FFANCNFSM4O2EITZA .

pdf commented 4 years ago

I already put the files at said location "/home/user/snap/chromium/nativemessaginghosts"

Are you certain that's where chromium expects to find it? I don't know enough about snaps, or where chromium expects to find its configuration data in this particular snap setup, but that directory structure and path being correct would surprise me greatly. Do you have any documentation or anything that says this is where it should be?

what do you mean trim off trim off the snap prefix?

This would only apply if snaps behave like a chroot, I don't know if they do or not.

Coolwhipit commented 4 years ago

I'm sure that's right because I backed up my chromium install/profile before updating from mint 19 to 20, knowing mint would no longer come with snapd, after re-enabling and installing snap I downloaded chromium like normal and that's where it went and restoring my backup at that location worked fine.... Apparently in mint 20 anything you install through snap we'll just go to a snap folder in your home directory

On Thu, Jul 16, 2020, 9:20 AM Peter Fern notifications@github.com wrote:

I already put the files at said location "/home/user/snap/chromium/nativemessaginghosts"

Are you certain that's where chromium expects to find it? I don't know enough about snaps, or where chromium expects to find its configuration data in this particular snap setup, but that directory structure and path being correct would surprise me greatly. Do you have any documentation or anything that says this is where it should be?

what do you mean trim off trim off the snap prefix?

This would only apply if snaps behave like a chroot, I don't know if they do or not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pdf/kdeconnect-chrome-extension/issues/36#issuecomment-659406609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQJGIENNZY4OIF4MDHZPHDLR335BPANCNFSM4O2EITZA .

Coolwhipit commented 4 years ago

Of course it could just be finding the profile there and creating folders and files in the normal locations in the root directory, other than installing chromium I don't know how much snap has to do with it... When I get home I'll look to see if there is another native messaging host folder somewhere else

On Thu, Jul 16, 2020, 12:19 PM Patrick Vickery virtual.pav@gmail.com wrote:

I'm sure that's right because I backed up my chromium install/profile before updating from mint 19 to 20, knowing mint would no longer come with snapd, after re-enabling and installing snap I downloaded chromium like normal and that's where it went and restoring my backup at that location worked fine.... Apparently in mint 20 anything you install through snap we'll just go to a snap folder in your home directory

On Thu, Jul 16, 2020, 9:20 AM Peter Fern notifications@github.com wrote:

I already put the files at said location "/home/user/snap/chromium/nativemessaginghosts"

Are you certain that's where chromium expects to find it? I don't know enough about snaps, or where chromium expects to find its configuration data in this particular snap setup, but that directory structure and path being correct would surprise me greatly. Do you have any documentation or anything that says this is where it should be?

what do you mean trim off trim off the snap prefix?

This would only apply if snaps behave like a chroot, I don't know if they do or not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pdf/kdeconnect-chrome-extension/issues/36#issuecomment-659406609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQJGIENNZY4OIF4MDHZPHDLR335BPANCNFSM4O2EITZA .

toxix commented 4 years ago

Hey,

I got it running with snap on ubuntu. Was getting a similar error than @Coolwhipit .

Looks like the location for chromium needs to be adjusted to install it together with snap?

 $ ./kdeconnect-chrome-extension -install                                                                                                                                                      
Browser Selection
Select browser(s) for native host installation (Space to select, Enter to confirm):
  ◯  Chrome/Opera
  ◯  Chromium
  ◯  Vivaldi
  ◯  Firefox
> ◉  Custom
Enter the destination native messaging hosts path: /home/$HOME/snap/chromium/common/chromium/NativeMessagingHosts/
Done.

While replacing $HOME with your user name.