Load unpacked Chrome extension programmatically

前端 未结 4 2297
广开言路
广开言路 2021-02-14 00:31

Is it possible to load and unload unpacked Chrome extensions from the Command Line?

4条回答
  •  萌比男神i
    2021-02-14 00:56

    3 ways install/use Chrome extensions offline:


    Method A: Drag & Drop (Simple)

    • Drag & drop ABP.crx on: chrome://extensions to install

    Pros: Installs web & non-westore extensions

    Cons: Google quickly & permanently disables non-webstore extensions


    Method B: Load unzipped extension/7zip to unzip/ABP used as example

    • UnZip ABP.crx: C:\ABP
    • Load 1: Shortcut: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --load-extension="C:\ABP"
    • Load 2: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --load-extension="C:\ABP,C:\IEtab"

    Pros: Permanently enables non-webstore extensions, so long as your using custom shortcut

    Cons: Extensions only load via custom shortcut

    ~~~~~~~~~~~~~~~ 3 fixes for extracted extension errors: ~~~~~~~~~~~~~~~

    • Won't load: Create shortcut to folder containing manifest file, for example: akkmfdhlogbapbcgojknhfgppcionopk\5.4.7_0

    • Metadata: Extension\delete _metadata folder

    • Disabled: Open manifest.json with notepad & locate:

    "name": "MSG_appName",

    "offline_enabled": true,

    Create: "offline_enabled": true, if it doesn't exist


    Method C: WinRar SFX (Mass install local/non-local profile apps)

    Chrome extracts all plugins to: %LocalAppData%\Google\User Data\Default\Extensions

    Extensions list by web-store ID. Example: ABP=cfhdojbkjhnklbpkdaibdccddilifddb

    ABP needs 3 files: Some extensions may only require 2

    • Install all plugins needed, remove all not needed. Exit Chrome.
    • Backup: %LocalAppData%\Google to: C:\Backup\Google
    • Copy: %LocalAppData%\Google\Chrome\User Data\Default\Extensions to: C:\Google\Chrome\User Data\Default\Extensions
    • Copy: %LocalAppData%\Google\Chrome\User Data\Default\secure preferences to: C:\Google\Chrome\User Data\Default\secure preferences
    • Copy: %LocalAppData%\Google\Chrome\User Data\Default\Local Extension Settings to: C:\Google\Chrome\User Data\Default\Local Extension Settings
    • Create WinRar SFX: Extract C:\Google to: %LocalAppData%\Google

    (ABP stores settings: %LocalAppData%\Google\User Data\Default\Local Extension Settings)

    Pros: Mass install web & non-webstore apps, from local/nonlocal pc's

    Cons: Google quickly & permanently disables non-webstore extensions

    When SFX imports secure preferences file, it replaces old extensions/settings with imported

    Restore Chrome Backup:

    • Exit Chrome & delete %LocalAppData%\Google\Chrome
    • Copy C:\Backup\Google to: %LocalAppData%\Google
    • Launch Chrome

提交回复
热议问题