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

Stuck on Send to JabRef with MacOS #177

Closed
FilipeMaia opened this issue Jun 4, 2020 · 39 comments
Closed

Stuck on Send to JabRef with MacOS #177

FilipeMaia opened this issue Jun 4, 2020 · 39 comments
Labels
status:jabref A bug or issue that depends on a change to JabRef itself status:waiting-for-feedback type:bug

Comments

@FilipeMaia
Copy link

I'm on MacOS 10.13.5 with JabRef 5.0 and Chrome 81.0.4044.138.
I've installed the extension from https://chrome.google.com/webstore/detail/jabref-browser-extension/bifehkofibaamoeaopjglfkddgkijdlh/
When using it, e.g. on https://www.nature.com/articles/s41598-020-65225-4 it gets stuck on Send to JabRef...
Looking into the developer console I see:
TypeError: Cannot read property 'items' of null at chrome-extension://bifehkofibaamoeaopjglfkddgkijdlh/Zotero/translate_item.js:134

@tobiasdiez
Copy link
Member

I think currently there is a problem with the setup on MacOS.

As a workaround, you can follow the guidelines for the manual install: https://docs.jabref.org/collect/jabref-browser-extension#mac-os using this file:
https://github.com/JabRef/jabref/pull/6442/files#diff-d99aa77716bf8252215c6e3a02faf611
and replace the Firefox-specific parts by the paths outlined here: https://developer.chrome.com/apps/nativeMessaging

@LyzardKing is this fixed with JabRef/jabref#6442 ?

@tobiasdiez tobiasdiez added status:jabref A bug or issue that depends on a change to JabRef itself type:bug labels Jun 5, 2020
@LyzardKing
Copy link
Collaborator

Not having a mac to test this on does not simplify things...
@FilipeMaia Do you install from the .dmg or .pkg files?
There might be a difference in the way macos exposes the path variable.
JabRef/jabref#6442 is a different issue, but this might help with that as well

@FilipeMaia
Copy link
Author

From .pkg.
Any more information I can give to help with debugging?

@LyzardKing
Copy link
Collaborator

Is there any file in /Library/Google/Chrome/NativeMessagingHosts?

@LyzardKing
Copy link
Collaborator

specifically org.jabref.jabref.json

@FilipeMaia
Copy link
Author

No there isn't. Neither in ~/Library/Application Support/Google/Chrome/NativeMessagingHosts

@FilipeMaia
Copy link
Author

The installation instructions mention ~/Library/Application Support/Mozilla/NativeMessagingHosts/. Is that correct?

@FilipeMaia
Copy link
Author

I also noticed that org.jabref.jabref.json from the instructions page links to the Linux section of the tree and mentions a /opt/jabref/lib/jabrefHost.py which is not there nor could I find it anywhere.

@FilipeMaia
Copy link
Author

FilipeMaia commented Jun 6, 2020

@tobiasdiez I tried to follow your suggestion but nothing really changed. I imagine the fact that /opt/jabref/lib/jabrefHost.py does not exist must be a problem.

@tobiasdiez
Copy link
Member

Can you try to create the /opt/jabref/lib/jabrefHost.py file by downloading https://github.com/JabRef/jabref/blob/master/buildres/linux/jabrefHost.py.
Moreover, put https://github.com/JabRef/jabref/blob/1a546922787160ed447d3a6f63f068916e17e225/buildres/mac/native-messaging-host/chromium/org.jabref.jabref.json into ~/Library/Application Support/Google/Chrome/NativeMessagingHosts.

This assumes that the JabRef executable is in /opt/jabref/bin/JabRef. If this is not the case, then every occurrence of /opt/jabref/ (in the above instructions as well as in the json file) needs to be replaced by the right path.

I'm sorry for the inconvenience. Appearently you are the first mac user that tries the extension for Chrome ;-)

@FilipeMaia
Copy link
Author

No problem, thanks for the help :).
There is no /opt/jabref. JabRef is installed in /Applications/JabRef.app/ as most MacOS apps.
I'll try to download the file as suggested an see what I can do with the paths.

@FilipeMaia
Copy link
Author

So I downloaded the jabrefHost.py into /Applications/JabRef.app/Contents/runtime/Contents/Home/lib and made it executable. I then edited to change the shebang to point to my python3 which is in /usr/local/bin/python3.
I finally edited org.jabref.jabref.json to point to the location in /Applications. And it now works!
But clearly this should be improved...

@LyzardKing
Copy link
Collaborator

... I'm looking at it in the previously mentioned PR, it wasn't it's main point, but it's probably a question of linking the correct files in the new buildres/mac folder

@LyzardKing
Copy link
Collaborator

With the latest push on the PR (JabRef/jabref#6442) the correct files should be included in the macos build.
The issue now is mostly with the install command, to copy the system files.. but it's a step in the right direction.
No more fiddling with the linux files in macos...hopefully we can keep the two separate (mostly)

@AriSchlesinger
Copy link

AriSchlesinger commented Sep 2, 2020

Similar issue with Firefox on Mac
fixed locally following similar strategy to @FilipeMaia

updated jabrefHost.pylocated at /Applications/JabRef.app/Contents/Resources to point hashbang to /usr/local/bin/python3 (where python3 will be installed using Homebrew)
made jabrefHost.py executable.

created new folder NativeMessagingHosts at path /Users/ *yourUser* /Library/Application Support/Mozilla
downloaded org.jabref.jabref.json into this folder
finally edited org.jabref.jabref.json path to point to the executable located in Applications/JabRef.app/Contents/Resources

thx for the breadcrumbs :)

@MingLin-home
Copy link

I have the same issue. JabRef 5.1, installed by DMG. Not lucky enough to make it work...

@LyzardKing
Copy link
Collaborator

@AriSchlesinger @FilipeMaia
Could you test something? Try replacing the hashbang with:
#!/usr/bin/env python3
This should fetch the correct python version without hardcoding it.
Thanks

@LyzardKing
Copy link
Collaborator

@MingLin-home
Can you verify that the file jabrefHost.py exists in /Applications/JabRef.app/Contents/Resources?
Also try changing the first line as described in the previous comment.

@clecap
Copy link

clecap commented Sep 20, 2020

Same problem here on MacOS 10.15.6

JabRef 5.1 installed via DMG.

jabrefHost.py confirmed in JabRef.app/Contents/Resources

shebang is /usr/bin/python3

/usr/bin/python3 is installed

org.jabref.jabref.json is in NativeMessagingHosts

In Firefox: Extension does not show up
In Chrome: Extension throws ERR_FILE_NOT_FOUND

@kddjenejfkffksd
Copy link

First time trying JabRef at all but No luck on Brave either.

  1. Installed dmg,
  2. placed the newer ~/Library/Application\ Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.jabref.jabref.json,
  3. changed jabrefHost.py shebang to /usr/bin/env python3
  4. and copied it on /Applications/JabRef.app/Contents/runtime/Contents/Home/lib because I don't know what I'm doing.

But all I ever got was ERR_FILE_NOT_FOUND.

@LyzardKing
Copy link
Collaborator

LyzardKing commented Oct 2, 2020

@clecap "org.jabref.jabref.json is in NativeMessagingHosts". In what folders?
It should be in:
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/<name>.json for chrome (and brave @coughingmouse )
~/Library/Application Support/Mozilla/NativeMessagingHosts/<name>.json for firefox.

Let me know if those paths work.

@kddjenejfkffksd
Copy link

kddjenejfkffksd commented Oct 2, 2020

@LyzardKing Why should it be placed in a Google folder for Brave? I don't even have Chrome installed.

I did copy the json file onto the directory to see if it works, just to be clear, to no avail.

@LyzardKing
Copy link
Collaborator

Brave (and many other browsers) are chrome-based, so they often use the same folder structure as chrome..
There are many issues (by looking at different support tickets on extensions) like the following:
browserpass/browserpass-native#43 (comment)
They seem to point to inconsistencies with the folder structure in brave.

Another path to try is: ~/Library/Application Support/Chromium/NativeMessagingHosts/

@clecap
Copy link

clecap commented Oct 2, 2020 via email

@AriSchlesinger
Copy link

Heads up, in Firefox, it appears in the URL bar:

Screen Shot 2020-10-02 at 11 55 45

@AriSchlesinger
Copy link

AriSchlesinger commented Oct 2, 2020

Have you all made the file jabrefHost.py executable?

(see link below on creating an executable if you are unsure)
https://stackoverflow.com/questions/36564320/how-to-make-python-script-executable-on-osx

@AriSchlesinger
Copy link

@AriSchlesinger @FilipeMaia
Could you test something? Try replacing the hashbang with:
#!/usr/bin/env python3
This should fetch the correct python version without hardcoding it.
Thanks

I am fairly certain I tried this with no luck.

@LyzardKing
Copy link
Collaborator

@AriSchlesinger
Thanks for the testing...
Does it work with #! /usr/bin/python3?

@clecap
Copy link

clecap commented Oct 14, 2020

Yes, jabrefHost.py, which is in the JabRef.app Contents folder, is executable.

/usr/bin/env python3 or /usr/bin/python3 makes no difference in the reaction. ERR_FILE_NOT_FOUND error.

@tobiasdiez
Copy link
Member

Does this error still occurs? I don't have a mac, so I sadly cannot test this. @LyzardKing @Siedlerchr can you reproduce the ERR_FILE_NOT_FOUND error?

@Siedlerchr
Copy link
Member

Firefox and jabref latest dev version on Mac I do not have any issues

@LyzardKing
Copy link
Collaborator

@Siedlerchr does it work with the system version of python3? Without installing from other sources like brew?

@Siedlerchr
Copy link
Member

Good question, I may have installed python3 form another source:
Python 3.9.0 (default, Nov 21 2020, 14:55:42)

@LyzardKing
Copy link
Collaborator

what do you get if you run which python3 in the terminal?

@Siedlerchr
Copy link
Member

/usr/local/bin/python3

@LyzardKing
Copy link
Collaborator

As far as I can tell that should be the version pulled from the python website...
brew should install in a /cellar/... dir, and the system version should be in /ust/bin/python3...
The strange thing is that the env shebang doesn't work...

@Siedlerchr
Copy link
Member

hm, I only found this thread here https://stackoverflow.com/questions/52969383/shebang-line-for-python-does-not-work-at-all
maybe something with permissions?

@tobiasdiez
Copy link
Member

So it seems this is fixed now, right?

@clecap
Copy link

clecap commented Jan 31, 2021

@tobiasdiez thank you for coming back on this.

I installed JabRef and the extension from a completely new download to test it.

Result: I cannot test this error as now there is a new error which does not let me test this effect any longer. I get stuck at "searching bibliographic data" and get a "cannot read property of configOptions of undefined" error in the browser console. See my new issue.

Sorry for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:jabref A bug or issue that depends on a change to JabRef itself status:waiting-for-feedback type:bug
Projects
None yet
Development

No branches or pull requests

8 participants