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 all commits
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://bifehkofibaamoeaopjglfkddgkijdlh/"
]
}
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
4 changes: 2 additions & 2 deletions buildres/windows/JabRef-post-image.wsf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
var contents = wxsFile.ReadAll();
wxsFile.Close();

// Add registry values for JabFox
contents = contents.replace("</Product>", "<DirectoryRef Id=\"TARGETDIR\"><Component Id=\"RegistryJabFoxEntries\" Guid=\"b6bc55ad-905c-4258-89b1-8b37abbe559c\" Win64=\"yes\"><RegistryKey Root=\"HKMU\" Key=\"SOFTWARE\\Mozilla\\NativeMessagingHosts\\org.jabref.jabref\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"[APPLICATIONFOLDER]jabref.json\"/></RegistryKey></Component></DirectoryRef><Feature Id=\"JabFox\" Level=\"1\"><ComponentRef Id=\"RegistryJabFoxEntries\" /></Feature></Product>");
// Add registry values for JabRef Browser Extension
contents = contents.replace("</Product>", "<DirectoryRef Id=\"TARGETDIR\"><Component Id=\"RegistryJabRefBrowserEntries\" Guid=\"b6bc55ad-905c-4258-89b1-8b37abbe559c\" Win64=\"yes\"><RegistryKey Root=\"HKMU\" Key=\"SOFTWARE\\Mozilla\\NativeMessagingHosts\\org.jabref.jabref\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"[APPLICATIONFOLDER]jabref.json\"/></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Google\\Chrome\\NativeMessagingHosts\\org.jabref.jabref\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"[APPLICATIONFOLDER]jabref-chrome.json\"/></RegistryKey></Component></DirectoryRef><Feature Id=\"JabFox\" Level=\"1\"><ComponentRef Id=\"RegistryJabFoxEntries\" /></Feature></Product>");

// Specify correct icon in Add/Remove Programs
contents = contents.replace("</Product>", "<Property Id=\"ARPPRODUCTICON\" Value=\"DesktopIcon.exe\" /></Product>");
Expand Down