-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Implement native messaging #3246
Conversation
Technicaly I understand nearly nothing of what you are doing here. :) But If you need help with testing something I am your man. |
…to nativeMessaging
You useing "native messaging via powershell script" now? This doesn't run on Linux I think. |
Yes, for the moment I use a powershell script since the java version was way to unstable. The script itself is very simple /~https://github.com/JabRef/jabref/pull/3246/files#diff-5ec2abbb42e242133d0073e06942954c and essentially only converts console stream input to a command line parameter for JabRef. So something similar should be possible without problems using a bash script. A first working prototyp should be ready this week. Stay tuned! |
Sure, all progress is there in form of old commits. The version at b24b599 worked in principle. |
Maybe we can adapt the install instructions from here? |
@Siedlerchr well, this is the current state. The instructions at /~https://github.com/JabRef/JabFox#installation-and-configuration work but they seem kinda cumbersome and I think the installer should automate them. |
Implemented the three Install4J requirements in HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts. |
There is an Architecture Violation:
|
@tobiasdiez You wrote I should try out the new version. I assume you mean I should test it on Debian? This is not possible currently because there is a JabRef-Java-Bug specific to Debian unstable. But I will give you feedback as soon as possible. |
@buhtz Just ensure that openjdk-jre-8 and openjfx are installed. Ensure that java8 is used to start the jar. I assume, you don't want to compile JabRef for yourself (refs JabRef#135), but just execute the JAR. @buhtz You could also try to create a snapcraft image (see #3121). However, this is work in progress and needs patience and testing. The devteam currently has no Ubuntu installation running and the time to get the snapcraft image working. |
@koppor Thanks for your hints. But this standard-hints are not working with Debian unstable. The problem is known by the Debianoids and they working on it. It is debian specific and not the fault of JabRef or some of the java components. I don't post bug-numbers here because there are a dozen of them. ;) |
@tobiasdiez I am not sure if I understand the steps correct. I tried to test Windows 7 with JabRef 3.8. Now I see this is not possible of course because your AddOn is based on JabRef 4.x. Currently I have no way to upgrade to 4.x because this would corrupt my library on debian unstable based systems where 4.x is not available currently. But I have some questions about the test. Point "Make sure that the correct file name of the JabRef .jar file is specified in JabRef.ps1 under $jabRefJarFileName.". Do you mean line number 14? How should the syntax look like? Could you specifiy this (with an example) for peoople not aware of powershell syntax. What is the I have to install the JabFox addon first, right? But it is not available for Firefox Quantum. How should I deal with this? |
OT: @buhtz I skimmed through the latest reports I thought they are about building JabRef from source not just running the JAR using a JRE8. Especially #893251 reads like the user there tries to compile JabRef instead of just running a (binary) JAR from http://builds.jabref.org/ (e.g., http://builds.jabref.org/nativeMessaging/JabRef--nativeMessaging--latest.jar) by typing OT2: Reading https://casept.github.io/post/install-snapcraft-on-debian/, I think snapcraft can really be used on Debian unstable. @buhtz @buhtz As far as I understand the implementation, we need your help in converting the |
@koppor I am using JabRef 3.8. The structure of the bib file is modfied automatic and without notification to the user when you open a with 3.8 generated bib-file witha 4.x JabRef. (what IMO is a bug!) I have to wait until JabRef 4.x is available on Debian unstable. This depends on the package maintainer there. Snapcraft/Snappy is absolute no choice because of several reasons. Before I can convert a script I have to understand what is going on here. I have absolutly no idea how this AddOn is working and for what this files are. @tobiasdiez If you really need my help I would suggest you contact me by mail in our native language. ;) |
@koppor Thanks a lot! You are my personal hero of the day 😃 So this PR is now really ready for review @buhtz Thanks a lot for your offer. I'll write you a mail tomorrow (or the next days, depending on when I find the time). JabRef/JabRef-Browser-Extension#48 contains a bit more information on what has to be done, but is still sparse. OT: When migrating from 3.8 to 4.2, JabRef indeed changes how groups are stored and, moreover, renames |
jabref.install4j
Outdated
</object> | ||
</void> | ||
<void property="value"> | ||
<string>/ve /d "${installer:sys.installationDir}\jabref.json" /f</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koppor This generates a key with a value /ve /d "C:\Program Files\JabRef\jabref.json" /f
. However, there actually should be a folder org.jabref.jabref
with key Default
and only the path as value.
It would be nice if you could fix this since this is the last issue that currently prevents merging this PR. Thanks!
See JabRef/JabRef-Browser-Extension#50.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I was in a hurry when copy'n'pasting your requirements.
RegKey fixed. Current travis error:
|
Thanks a lot for fixing the installer @koppor! For some reason, some of the remote tests were failing on travis from time to time. I've no idea why and hence disabled these tests on travis now. |
Maybe, because of parallel builds running on the same machine. |
This PR implements
Native Messaging
so that JabRef is able to talk to Firefox and Chrome (or other browser) extensions #1284.I tried around a lot with directly implementing native messaging using Java. It worked in principle but was really unstable (everything JabRef wrote in the command line made crashed Firefox). Thus, in the end, I went for a simple powershell script that handles the "native messaging" stuff and converts it to simple command line arguments. As a positive side effect, you can now specify Bibtex code for import directly as a command line argument.
I also took the opportunity to slightly improve the code concerning with the remote listener (the old version didn't allowed arguments with line breaks to be passed).
The installation routine still needs to be automated and this is where I need help. @Siedlerchr @koppor could you please have a look at the following things:
JabRef.exe
..jar
file is specified inJabRef.ps1
under$jabRefJarFileName
.REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\org.jabref.jabref" /ve /d "C:\path\to\jabref.json" /f
from the console (with the correct path to thejabref.json
file).Things that may be improved in the future:
gradle localizationUpdate
?