Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

[Enhancement] install extensions from Google WebStore #7

Open
Mayurifag opened this issue Jan 1, 2016 · 33 comments
Open

[Enhancement] install extensions from Google WebStore #7

Mayurifag opened this issue Jan 1, 2016 · 33 comments

Comments

@Mayurifag
Copy link

Hello! Would you add some extension to simplier installation extensions from Google WebStore? Would be nice feature! Thanks!

@SethDusek
Copy link

I've whipped up this simple script to download an extension from the store link and open it with inox, then you can just drag and drop the .crx from inox.

https://github.com/SethDusek/extension-downloader

Usage: python downloader.py YOURLINKHERE

The link is a store link such as https://chrome.google.com/webstore/detail/scriptsafe/oiigbmnaadbkfbmpbfijlflahbdbdgdf

@hasufell
Copy link

doesn't seem to work for postman, it tells me I can only install it from the webstore

@MrAmnesiac
Copy link

MrAmnesiac commented May 22, 2016

Hello @SethDusek , it doesn't work on my end.
screenshot from 2016-05-22 02-39-56

@SethDusek
Copy link

@hasufell Once it is downloaded you have to drag and drop the extension.

@hasufell
Copy link

hasufell commented Jul 3, 2016

Once it is downloaded you have to drag and drop the extension.

Obviously. And it doesn't work.

@SethDusek
Copy link

What error do you get? When I wrote that a few months back I tested it out on both stock chromium and inox (on arch)

@hasufell
Copy link

hasufell commented Jul 3, 2016

What error do you get?

What I already said: it tells me I can only install it from the webstore

@SethDusek
Copy link

Huh. Okay, I'll see what I can do

@SethDusek
Copy link

@hasufell Seems to be working for me on latest chromium. http://i.shibe.ml/QmRLtdABPCDRYr9Jn6NHTWwa5j5jBYNHieDj6nzc2GG7bA.webm

I can't test right now on inox as I don't have it built, but I don't see why inox patches would make any difference.

@hasufell
Copy link

I can't test right now on inox as I don't have it built, but I don't see why inox patches would make any difference.

I don't see how testing it on chromium is relevant here. Please test it on inox. It doesn't help to make assumptions.

@SethDusek
Copy link

@MrAmnesiac I've done a little bit of digging into your issue, and I believe you are using the wrong link. For example you are using https://clients2.google.com/service/update2/crx?response=redirect&prodversion=48.0&x=id%3Dapmlngnhgbnjpajelfkmabhkfapgnoai%26installsource%3Dondemand%26uc

when instead you should just be passing the store link to the downloader, which in this case would be https://chrome.google.com/webstore/detail/cloud-to-butt-plus/apmlngnhgbnjpajelfkmabhkfapgnoai

@SethDusek
Copy link

SethDusek commented Jul 13, 2016

@hasufell I got somebody on IRC to test it on arch with the inox-bin package. He says it is working, so I honestly don't know whats wrong here

edit: He also sent a video https://curl.io/get/vewx5hlf/7f337b7733f50adaa89a514e0462dd9453cdf902

@s0r00t
Copy link

s0r00t commented Sep 24, 2016

I've been trying to install the Signal webapp, using the script and manually editing the URL, but the installation fails, telling me that "this element can only be installed from the Web Store", even when drag-dropping in chrome://extensions.

Is it possible to install Signal in Inox?

@SethDusek
Copy link

@s0r00t Why are you manually editing the URL, why not just pass it as an argument to the downloader?

@aolko
Copy link

aolko commented Oct 6, 2016

Windows version (had to use chromium "download" workaround, otherwise extension won't open/drag)

@SethDusek
Copy link

@aolko why is the source code not available?

@aolko
Copy link

aolko commented Oct 6, 2016

@SethDusek it will be a tad later

@aolko
Copy link

aolko commented Oct 7, 2016

added source

@s0r00t
Copy link

s0r00t commented Oct 8, 2016

@SethDusek because that's exactly what the script does.
What I meant is that I tried downloading it through your script, then through manual editing of the URL

@akehsanz
Copy link

Hello
I'm just repeating what all others are waiting for eagerly...
Pls, Pls...
Would you add some extension to simplier installation extensions from Google WebStore?
this would help us use the ungoogled chrome more extensively & with greater privacy...
Thanks!

@akehsanz
Copy link

akehsanz commented Jan 31, 2017

Hello developer !!
I'm just here for a quick reply..
WHAT IS THE SOLUTION TO THIS PROBLEM?
when I've downloaded the .py extension downloader & drag-n-dropped to
chrome://extensions/
it doesnot seem to work, just the errors shows:

Failed to load extension from: [PATH]
Manifest file is missing or unreadable.

@gcarq
Copy link
Owner

gcarq commented Feb 8, 2017

I'm sorry for not being active in this issue. I will look into this the next days.

@gcarq
Copy link
Owner

gcarq commented Feb 10, 2017

I wrote a small "Extension unpacker" which downloads and unpacks extensions from WebStore to make a offline install possible, take a look here: https://github.com/gcarq/inoxunpack

with this you should be able to bypass the WebStore constraints.

Feel free to open PRs.

@xsmile
Copy link
Collaborator

xsmile commented Feb 13, 2017

Would it be theoretically possible to unpack the extension directly to the profile directory of the browser? I imagine there is some kind of database that stores the installed extensions and their settings, which could be edited. This way installations and updates of extensions could be fully automated.

@DragoonAethis
Copy link

AFAIK Chrome explicitly prevents anything external from touching its extensions, to prevent malware (remember the changed homepage and a browser bar or two you didn't ask for while installing that audio converter a minute ago? That's primarily why :P). Even common antivirus software, generally rather invasive, can't install addons fully automatically, and Chrome prompts user on the next start whenever to install something or not.

@xsmile
Copy link
Collaborator

xsmile commented Feb 13, 2017

How does it prevent that? There must be a workaround :)

@Eloston
Copy link
Contributor

Eloston commented Feb 13, 2017

There's a mechanism in Debian's Chromium that allows for system-installed extensions. I think it is a part of the Chromium code. It should be easy to modify to allow the mechanism to work relative to the profile directory I suppose. But this won't work with extensions that aren't installed this way.

AFAIK, most files in the profile directory are JSON or SQLite files. It shouldn't be too hard to modify it if you want to do that.

I think a better solution is to have an extension that takes care of this; i.e. notify the users and perform the update (if that is simple enough to do). Update checking and notifications should be possible with the current Chrome APIs.

@gcarq
Copy link
Owner

gcarq commented Feb 13, 2017

@Eloston Do you have a link to the Debian's Chromium project where the extensions are included?

FYI it creates a new entries in ~/.config/inox/<UserProfile>/Preferences if a unpacked extension is installed (ublock origin in this case), but there are a lot of additional properties which aren't provided by the manifest.json

            "<some-id>": {
                "active_permissions": {
                    "api": [
                        "contextMenus",
                        "privacy",
                        "storage",
                        "tabs",
                        "unlimitedStorage",
                        "webNavigation",
                        "webRequest",
                        "webRequestBlocking"
                    ],
                    "explicit_host": [
                        "http://*/*",
                        "https://*/*"
                    ],
                    "manifest_permissions": [],
                    "scriptable_host": [
                        "http://*/*",
                        "https://*/*"
                    ]
                },
                "commands": {},
                "content_settings": [],
                "creation_flags": 38,
                "events": [],
                "extension_can_script_all_urls": true,
                "from_bookmark": false,
                "from_webstore": false,
                "granted_permissions": {
                    "api": [
                        "contextMenus",
                        "privacy",
                        "storage",
                        "tabs",
                        "unlimitedStorage",
                        "webNavigation",
                        "webRequest",
                        "webRequestBlocking"
                    ],
                    "explicit_host": [
                        "http://*/*",
                        "https://*/*"
                    ],
                    "manifest_permissions": [],
                    "scriptable_host": [
                        "http://*/*",
                        "https://*/*"
                    ]
                },
                "incognito_content_settings": [],
                "incognito_preferences": {},
                "initial_keybindings_set": true,
                "install_time": "13131476020325255",
                "location": 4,
                "never_activated_since_loaded": true,
                "newAllowFileAccess": true,
                "path": "/home/test/.inoxunpack/cjpalhdlnbpafiamejdnhcphjbkeiagm",
                "preferences": {
                    "enable_a_ping": false,
                    "net.network_prediction_options": 2
                },
                "regular_only_preferences": {},
                "state": 1,
                "was_installed_by_default": false,
                "was_installed_by_oem": false
            }

Another thing worth mentioning is the extension-content-verification flag, which is a good entry point to find the relevant verification code and it would make an install possible without unpacking.

This flag can be used to turn on verification that the contents of the files on disk for extensions from the webstore match what they're expected to be. This can be used to turn on this feature if it would not otherwise have been turned on, but cannot be used to turn it off (because this setting can be tampered with by malware). #extension-content-verification

More information: http://superuser.com/questions/848664/can-i-disable-chromes-extension-content-verification

My plan is also to create a browser extension to take care of this, but until a robust solution is found python it is.

@Eloston
Copy link
Contributor

Eloston commented Feb 14, 2017

@gcarq I was referring to this mechanism: https://developer.chrome.com/extensions/external_extensions

@gcarq
Copy link
Owner

gcarq commented Feb 15, 2017

@Eloston Is debian shipping some extensions per default? that mechanism doesn't load local .crx files.

@Eloston
Copy link
Contributor

Eloston commented Feb 15, 2017

@gcarq You're right, it doesn't load local crx files. The mechanism is for allowing packages to provide extensions to the webbrowser, like it is done for Firefox in Debian. Is there a reason you want to leave the crx file intact?

@Pu-Anlai
Copy link

If anyone's interested, here's my take on a Python script for installing extensions from the Webstore and keeping them updated.

@xsmile
Copy link
Collaborator

xsmile commented Mar 21, 2018

Here is yet another tool for keeping extensions up-to-date: chromexup. It focuses on automatic updates and should work in Linux with systemd, in macOS with launchd and in Windows with task scheduler.

In Windows Chromium doesn't load locally placed external extensions unless an update server URL is provided, so sadly no use case here.

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

No branches or pull requests