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

Add chromium json for browser integration #5571

Merged
merged 4 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "org.jabref.jabref",
"description": "JabRef",
"path": "/opt/jabref/lib/jabrefHost.py",
"type": "stdio",
"allowed_origins": [
"chrome-extension://hbngbnhgegoecdhfmndifldiaonjdgbn/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the key needs to be changed as soon as the extension is published to the chorme store, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never submitted a chrome extension, but I think that this key will work for the tests (web-ext run), and we could add another one for the "release" version..
but I might be wrong and the "published" key could work for the unreleased version as well, I'm not sure about that..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll try to publish a (preliminary) version to the Chrome store and then update the ID.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The firefox extension needs updating as well, to reflect the name change (and thus the id change)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chrome key: bifehkofibaamoeaopjglfkddgkijdlh

I cannot update the Firefox addon right now, because then it does no longer work with JabRef 4.3.1. Thus, this has to wait until 5.0 is released.

]
}
5 changes: 3 additions & 2 deletions buildres/linux/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ set -e

case "$1" in
configure)
INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts"
install -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH/org.jabref.jabref.json
install -D -m0755 /opt/jabref/lib/native-messaging-host/firefox/org.jabref.jabref.json /usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json
install -D -m0755 /opt/jabref/lib/native-messaging-host/chromium/org.jabref.jabref.json /etc/chromium/native-messaging-hosts/org.jabref.jabref.json
install -D -m0755 /opt/jabref/lib/native-messaging-host/chromium/org.jabref.jabref.json /etc/opt/chrome/native-messaging-hosts/org.jabref.jabref.json
DESKTOP_COMMANDS_INSTALL
;;

Expand Down
14 changes: 9 additions & 5 deletions buildres/linux/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ set -e
# <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
NATIVE_MESSAGING_JSON="/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json"
if [ -e $NATIVE_MESSAGING_JSON ] && grep --quiet '"path": "/opt' $NATIVE_MESSAGING_JSON; then
rm $NATIVE_MESSAGING_JSON
fi
for NATIVE_MESSAGING_JSON in "/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json"\
"/etc/chromium/native-messaging-hosts/org.jabref.jabref.json"\
"/etc/opt/chrome/native-messaging-hosts/org.jabref.jabref.json"; do
if [ -e $NATIVE_MESSAGING_JSON ] && grep --quiet '"path": "/opt' $NATIVE_MESSAGING_JSON; then
echo $NATIVE_MESSAGING_JSON
fi
done
;;

*)
Expand All @@ -30,4 +34,4 @@ case "$1" in
;;
esac

exit 0
exit 0