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

Install chrome extension automatically #6076

Closed
tobiasdiez opened this issue Mar 7, 2020 · 21 comments · Fixed by #6442 or #11924
Closed

Install chrome extension automatically #6076

tobiasdiez opened this issue Mar 7, 2020 · 21 comments · Fixed by #6442 or #11924

Comments

@tobiasdiez
Copy link
Member

It would be nice if the Chrome extension would be automatically installed during the main installation routine.

Shouldn't be that hard to implement: https://developer.chrome.com/extensions/external_extensions
@LyzardKing interested? 😄

(For Firefox something like this is sadly not supported: https://blog.mozilla.org/addons/2019/10/31/firefox-to-discontinue-sideloaded-extensions/)

@koppor
Copy link
Member

koppor commented Apr 14, 2020

If Firefox is installed: Open JabRef extension page in firefox store.

@koppor
Copy link
Member

koppor commented Apr 14, 2020

@LyzardKing Ping? 😇

@calixtus
Copy link
Member

Firefox download page would be something like
https://addons.mozilla.org/de/firefox/addon/jabref/?src=search

@LyzardKing
Copy link
Collaborator

I'll have a look at it! I don't have too much time, but I'll see what I can do :)

@LyzardKing
Copy link
Collaborator

Ok.. I have the correct file, and it works on Chrome.
We need to set a trigger to copy the file in the correct folder (creating it if it doesn't exist).
This can be done on a non snap browser easily with sudo credentials.
Should this be part of the deb install? I can add to the postinstall trigger there.

@LyzardKing
Copy link
Collaborator

The macos part should be the same.. I can test that easily.
The windows implementations requires editing the registry. I have no idea how to do that (my last windows machine was windows 98 a while back) but I'm willing to try if you have any suggestion!

@tobiasdiez
Copy link
Member Author

Perfect. Thanks a lot @LyzardKing!

Yes, the idea was to add these steps to the installation routines as post-actions. For Windows, adding a line similar to

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=\"[INSTALLDIR]jabref.json\"/></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Google\\Chrome\\NativeMessagingHosts\\org.jabref.jabref\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"[INSTALLDIR]jabref-chrome.json\"/></RegistryKey></Component></DirectoryRef><Feature Id=\"BrowserExtension\" Level=\"1\"><ComponentRef Id=\"RegistryJabRefBrowserEntries\" /></Feature></Product>");
should work. I can also have a look at the Windows stuff.

@LyzardKing
Copy link
Collaborator

I opened a branch to test this out.. I only added the postinst/postrm scripts, but I'll start from there.
@tobiasdiez I'll try the windows integration!
I still have to look at the macos implementation in jpackage

@LyzardKing
Copy link
Collaborator

@tobiasdiez
In https://developer.chrome.com/extensions/external_extensions it seems like the current settings should not work in 64bit versions of windows..

Find or create the following key in the registry:

32-bit Windows: HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions
64-bit Windows: HKEY_LOCAL_MACHINE\Software\Wow6432Node\Google\Chrome\Extensions

Am I missing something or should the .wsf be changed? At the moment it only seems to access the 32 bit folders..

@koppor
Copy link
Member

koppor commented Apr 28, 2020

@LyzardKing May I ask about an update? 😇

@LyzardKing
Copy link
Collaborator

Yes sorry...
The linux part seems to work (in the deb...)
I need to test it in a clean vm, but I plan to do that later today.
Regarding the windows part I'm waiting for a reply on the previous comment,regarding 32/64bit paths in regex.
The snap is up next, but the issue is that we should ask for more permissions, and in #6353 the issue of whether to ask for classic (unconfined) snap would be better, to enable the different integrations.
I cannot find (and I unfortunately haven't had too much time to look at it) macos instructions for jpackage.

@tobiasdiez
Copy link
Member Author

Sorry, I've overlooked your comment. The 32-bit folder HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions works fine on my 64bit machine, and so far nobody complained. I would thus leave it as it is right now.

@LyzardKing
Copy link
Collaborator

Ok! I just wanted confirmation that it works, since it shouldn't according to the google website.
I uploaded a branch with the deb part for now.

@LyzardKing
Copy link
Collaborator

Just to recap...
I looked at this again, and I cannot figure out if a .app mac program can have a postinstall trigger.
The only idea I have is to add something in jabref itself on the first run..
But it's a bit of a bodge...
Regarding windows support, It's not too clear to me how the file should be formed.. since I can add the key in the registry, but then I'd need to set a named property...

@Siedlerchr
Copy link
Member

Here is some info on this topic:
https://docs.oracle.com/en/java/javase/14/jpackage/override-jpackage-resources.html#GUID-62412365-821D-4736-A20D-70F2D47136D8

There is a postinstall script for pgk and for dmg you might need to integrate such thing in the dmg scpt. That is some AppleScript. Someone who's got a a mac could add some lines to copy the files

https://github.com/openjdk/jdk/tree/730d0ecf19779457968bc54d99330c47fdc4730e/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources

@koppor koppor removed this from the v5.1 milestone Aug 4, 2020
@Siedlerchr
Copy link
Member

Now we just need it for windows as well. Probably inlcude this in the wix installer scripts.

@LyzardKing
Copy link
Collaborator

I'm not expert... in fact not at all...but could a change like this in the JabRef-post-image.wsf work?
contents = contents.replace("</Product>", "<RegistryKey Root=\"HKMU\" Key=\"Software\\Google\\Chrome\\Extensions\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"bifehkofibaamoeaopjglfkddgkijdlh"/><Property Id=\"update_url\" Value=\"https://clients2.google.com/service/update2/crx\" /></RegistryKey></Product>");

@tobiasdiez You might know how it works..

@tobiasdiez tobiasdiez reopened this Aug 5, 2020
@tobiasdiez
Copy link
Member Author

That looks promising indeed. Not sure when I find the time to try this.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2021

This issue has been inactive for half a year. Since JabRef is constantly evolving this issue may not be relevant any longer and it will be closed in two weeks if no further activity occurs.

As part of an effort to ensure that the JabRef team is focusing on important and valid issues, we would like to ask if you could update the issue if it still persists. This could be in the following form:

  • If there has been a longer discussion, add a short summary of the most important points as a new comment (if not yet existing).
  • Provide further steps or information on how to reproduce this issue.
  • Upvote the initial post if you like to see it implemented soon. Votes are not the only metric that we use to determine the requests that are implemented, however, they do factor into our decision-making process.
  • If all information is provided and still up-to-date, then just add a short comment that the issue is still relevant.

Thank you for your contribution!

koppor pushed a commit that referenced this issue Jun 1, 2022
e740261 Merge pull request #6075 from POBrien333/patch-1048
5251887 Update society-of-biblical-literature-fullnote-bibliography.csl
b4938f4 Update society-of-biblical-literature-1st-edition-fullnote-bibliography.csl
b7afaa1 Update Food and Agriculture Organization of the United Nations to comply with 2022 revision (#6072)
5218a45 Update avian-research.csl (#6076)
627ce4a Merge pull request #5983 from tutam/patch-1
08bd306 Re-indent CSL styles
d97aec7 Update suomen-antropologi-journal-of-the-finnish-anthropological-society.csl
00439b1 Re-indent CSL styles
914a4dc Update suomen-antropologi-journal-of-the-finnish-anthropological-society.csl
ef4ecff Re-indent CSL styles
224b1d3 Update society-of-biblical-literature-1st-edition-fullnote-bibliography.csl
3297912 Update society-of-biblical-literature-1st-edition-fullnote-bibliography.csl
156a850 add title-short to all SBL variants
3f6c407 Merge pull request #6071 from denismaier/fixbernsozanthro
a7b3228 Re-indent CSL styles
d624bda removes abstract from issued macro
f3221f4 Update glossa.csl (#6070)
63c0c6d Rework frontiers-in-ecology-and-the-environment.csl (#6067)
7502061 Bump nokogiri from 1.13.5 to 1.13.6 (#6068)
374238f Bump nokogiri from 1.13.4 to 1.13.5 (#6065)
7b09f4f Create journal-of-occupational-and-environmental-medicine.csl (#6053)
9e7a74b Update revista-ladinia.csl (#6058)
13461e5 Update suomen-antropologi-journal-of-the-finnish-anthropological-society.csl
2e86264 Re-indent CSL styles
98ff3de Update suomen-antropologi-journal-of-the-finnish-anthropological-society.csl
bcab5dc Fix timestamp
76aeb4c Create suomen-antropologi-journal-of-the-finnish-anthropological-society.csl

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: e740261
@koppor koppor moved this to Normal priority in Features & Enhancements Nov 7, 2022
@CraftyDH
Copy link
Contributor

Hi, I would like to work on this issue, could I please be assigned it?

@Siedlerchr
Copy link
Member

for firefox I stumbled across this https://github.com/web-eid/wix-custom-action-firefox-extension-install
Requires a custom to be built first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
6 participants