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

Bookmarklet to download extensions from Chrome Web Store #869

Closed
biziclop opened this issue Nov 21, 2019 · 9 comments
Closed

Bookmarklet to download extensions from Chrome Web Store #869

biziclop opened this issue Nov 21, 2019 · 9 comments

Comments

@biziclop
Copy link

biziclop commented Nov 21, 2019

Is your feature request related to a problem? Please describe.
I needed a simple and clean solution to install extensions easier from the Store.

Describe the solution you'd like
Based on the wiki instructions I made this:
javascript:location.href='https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion='+(navigator.appVersion.match(/Chrome\/(\S+)/)[1])+'&x=id%'+'3D'+(location.pathname.split('/').pop())+'%'+'26installsource%'+'3Dondemand%'+'26uc';

So first I set the chrome://flags/#extension-mime-request-handling flag to "Always prompt for install", restarted UngooChromium, went to the webstore page, clicked on the bookmarklet, and boom.

Describe alternatives you've considered
There is already a website and an extension, but my bookmarklet is simpler :)
#767 (comment) #734

@Eloston
Copy link
Member

Eloston commented Nov 24, 2019

I like this, except apparently it's possible to not have the app ID as the last path element. Most of the time this should be fine, so I'll add this. Thanks!

@biziclop
Copy link
Author

Hi, thanks for adding it. :)

But do you happen to have an example url which is different than these? I haven't found other url schemes:
https://chrome.google.com/webstore/detail/EXTENSIONID
https://chrome.google.com/webstore/detail/EXTNAME/EXTENSIONID
https://chrome.google.com/webstore/detail/EXTNAME/EXTENSIONID?hl=en

@Eloston
Copy link
Member

Eloston commented Nov 25, 2019

@biziclop You won't get there by any normal means, but it's possible to add path elements yourself. These path elements won't be removed after you visit the CWS. If the extension is being linked from somewhere else, it's possible (but unlikely) that the URL may contain unwanted path elements.

@biziclop
Copy link
Author

Thanks for your answer.

I found another solution, by finding the 'report' link, which is available even for Google's own cr*p:
document.querySelector('a[href^="https://chrome.google.com/webstore/report/"]').pathname.match(/[^\/]+\/*$/)[0]

Full bookmarklet:
javascript:location.href='https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion='+(navigator.appVersion.match(/Chrome\/(\S+)/)[1])+'&x=id%'+'3D'+(document.querySelector('a[href^="https://chrome.google.com/webstore/report/"]').pathname.match(/[^\/]+\/*$/)[0])+'%'+'26installsource%'+'3Dondemand%'+'26uc';

Eloston added a commit to ungoogled-software/ungoogled-chromium-wiki that referenced this issue Nov 26, 2019
@Clebersonc
Copy link

A simple solution is to go to this site that extracts the source code from crx, for some reason on windows when I drag crx in the extensions tab nothing happens.

https://crxextractor.com/

@Oymate
Copy link

Oymate commented Nov 25, 2020

@Clebersonc you need to unpack it to get the source code, the unzip the folder somewhere.
Then load the unpacked extension in extension part.

@qpwo
Copy link

qpwo commented Nov 14, 2021

Old issue but just want to say I think it would help this project a lot if the bookmarklet came pre-installed

@PF4Public
Copy link
Contributor

@qpwo There exist more convenient ways nowadays: https://github.com/NeverDecaf/chromium-web-store

@Testla
Copy link

Testla commented Oct 6, 2024

The Chrome Web Store page changed sometime after mid-September, which broke the bookmarklet.

The report link element now looks like this:

<a href="./detail/cjpalhdlnbpafiamejdnhcphjbkeiagm/report" target="_blank" class="X4yNFb">Report a concern</a>

One possible fix:

document.querySelector('a[href$="/report"]').pathname.split('/')[2]
javascript:location.href='https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion='+(navigator.appVersion.match(/Chrome\/(\S+)/)[1])+'&x=id%'+'3D'+(document.querySelector('a[href$="/report"]').pathname.split('/')[2])+'%'+'26installsource%'+'3Dondemand%'+'26uc';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants