flathub / org.jabref.jabref

https://flathub.org/apps/details/org.jabref.jabref
4 stars 1 forks source link

Getting firefox jabref extension to work #15

Closed State-Of-Joshing-Gentle-Peevishness closed 1 year ago

State-Of-Joshing-Gentle-Peevishness commented 3 years ago

Hei, I hope this is the correct place for my issue. I have installed jabref 5.2 as flatpak. I now want the browser extension for firefox https://docs.jabref.org/collect/jabref-browser-extension. For the snap version are special connect commands, but how about the flatpak version? The file org.jabref.jabref.json I downloaded and placed as per instructions in the mozilla folder is looking for the file "/opt/jabref/lib/jabrefHost.py" but that doesn't seem to be at that path when the flatpak version is installed? Where is that file, I cannot find it? sudo find / jabrefHost.py find: ‘jabrefHost.py’: No such file or directory Running on Linux Mint

LyzardKing commented 3 years ago

For now to use the flatpak version you have to manually download a file and save it where you want. The file is https://raw.githubusercontent.com/JabRef/jabref/master/buildres/linux/jabrefHost.py

After that you need to create in .mozilla/native-messaging-hosts a file called org.jabref.jabref.json and in it copy the following, replacing the path with the one in which you saved the script:

{
  "name": "org.jabref.jabref",
  "description": "JabRef",
  "path": "path to the file jabrefHost.py",
  "type": "stdio",
  "allowed_extensions": [
    "browserextension@jabref.org",
    "@jabfox"
  ]
}
LyzardKing commented 3 years ago

I'll build a script to automate this, then figure out a way to include it in the flatpak..

State-Of-Joshing-Gentle-Peevishness commented 3 years ago

Awesome, this worked! If anyone else needs this workaround, the jabrefHost.py script needs to be executable.

Jesse-Millwood commented 3 years ago

Has anyone tried with Firefox also as a flatpak? I tried putting an executable version of that jabrefHost.py in a location under my home directory. The jabref plugin still says "Error while sending to JabRef". When I go to the JabRef extension's preferences it says Status: Attempt to post message on disconnected port Websocket status: client not started I did put the json file in my $HOME/.mozilla directory. I'm not sure if the flatpak Firefox uses a different directory.

LyzardKing commented 3 years ago

I think that the flatpak version of firefox uses a different directory.. and you would have to run the script via flatpak-exec (it might not be the correct command...) I plan to look into it soon(ish)

LyzardKing commented 1 year ago

This now works with the firefox and jabref flatpak, although atm it needs extra permissions on the firefox side. The documentation has been updated at https://docs.jabref.org/collect/jabref-browser-extension