inox-patchset icon indicating copy to clipboard operation
inox-patchset copied to clipboard

[Enhancement] install extensions from Google WebStore

Open Mayurifag opened this issue 9 years ago • 33 comments

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

Mayurifag avatar Jan 01 '16 20:01 Mayurifag

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

SethDusek avatar Jan 10 '16 01:01 SethDusek

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

hasufell avatar May 20 '16 12:05 hasufell

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

MrAmnesiac avatar May 22 '16 01:05 MrAmnesiac

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

SethDusek avatar Jul 03 '16 14:07 SethDusek

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

Obviously. And it doesn't work.

hasufell avatar Jul 03 '16 14:07 hasufell

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)

SethDusek avatar Jul 03 '16 14:07 SethDusek

What error do you get?

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

hasufell avatar Jul 03 '16 14:07 hasufell

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

SethDusek avatar Jul 03 '16 14:07 SethDusek

@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.

SethDusek avatar Jul 12 '16 06:07 SethDusek

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.

hasufell avatar Jul 12 '16 19:07 hasufell

@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 avatar Jul 13 '16 05:07 SethDusek

@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

SethDusek avatar Jul 13 '16 06:07 SethDusek

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?

s0r00t avatar Sep 24 '16 14:09 s0r00t

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

SethDusek avatar Oct 01 '16 13:10 SethDusek

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

aolko avatar Oct 06 '16 07:10 aolko

@aolko why is the source code not available?

SethDusek avatar Oct 06 '16 11:10 SethDusek

@SethDusek it will be a tad later

aolko avatar Oct 06 '16 13:10 aolko

added source

aolko avatar Oct 07 '16 08:10 aolko

@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

s0r00t avatar Oct 08 '16 13:10 s0r00t

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 avatar Jan 31 '17 10:01 akehsanz

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.

akehsanz avatar Jan 31 '17 10:01 akehsanz

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

gcarq avatar Feb 08 '17 22:02 gcarq

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.

gcarq avatar Feb 10 '17 00:02 gcarq

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.

xsmile avatar Feb 13 '17 01:02 xsmile

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.

DragoonAethis avatar Feb 13 '17 02:02 DragoonAethis

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

xsmile avatar Feb 13 '17 02:02 xsmile

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.

Eloston avatar Feb 13 '17 07:02 Eloston

@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.

gcarq avatar Feb 13 '17 16:02 gcarq

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

Eloston avatar Feb 14 '17 20:02 Eloston

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

gcarq avatar Feb 15 '17 10:02 gcarq