Skip to main content

Convert existing Chrome extensions to Manifest V3

Project description

Extension Manifest Converter

PyPI pre-commit.ci status

Maintainability Test Coverage

ghcr latest ghcr size


Original(~2021): GoogleChromeLabs/extension-manifest-converter


Extension Manifest Converter is an open source tool that helps convert existing Chrome extensions to Manifest V3. Use it to convert an entire directory, extension zip file, or just a manifest.json file. All expected changes are applied to manifest.json.

Features

  • Performs conversions on
    • unpacked extension directories
    • zip files containing an extension
    • manifest.json
  • General manifest.json conversions
    • Updates manifest_version field
    • Converts between host permissions declared in permissions or optional_permissions in MV2 and host_permissions in MV3
    • Converts between a content_security_policy string in MV2 and content_security_policy object withextension_pages and sandbox properties in MV3
    • Converts between background.scripts in MV2 and background service workers background.service_worker in MV3
  • Scripting API conversions
    • Converts chrome.tabs.executeScript in MV2 to chrome.scripting.executeScript in MV3. If necessary, also adds scripting to the permissions array in manifest.json.
    • Converts chrome.tabs.insertCSS in Mv2 to chrome.scripting.insertCSS in MV3. If necessary, also adds scripting to the permissions array in manifest.json.
  • Action API conversions
    • Converts calls to chrome.browserAction and chrome.pageAction in MV2 into chrome.action in MV3
    • Converts browser_action and page_action manifest entries in MV2 into action in MV3

Limitations

This tool aims to simplify the MV3 conversion; it does not fully automate the process. Only search and replace changes are applied to .js files.

This tool does not:

  • update any service worker code that relies on a DOM

Installation

To use this tool, you'll need to set it up by following the steps below.

  1. Make sure Python 3 is installed.

    python3 --version
    

    If you don't see a version number, follow your OS's guidance to install Python 3 or visit https://www.python.org/downloads/ to download a recent release.

  2. Install emc command.

    pip install git+https://github.com/eggplants/extension-manifest-converter
    # or
    pip install extension-manifest-converter
    
  3. Execute the test command.

    emc
    

    The tool should log basic usage information to the console.

Usage

  • Convert a directory

    emc dir/path/
    
  • Convert a manifest file

    emc manifest.json
    
  • Convert a .zip file

    emc extension.zip
    

License

Apache 2.0

This is not an official Google product.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extension_manifest_converter-1.0.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file extension_manifest_converter-1.0.0.tar.gz.

File metadata

File hashes

Hashes for extension_manifest_converter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7562f836d13e3bba41df0e08ddcb170896b19cff6c8449fce6a9d94c1771263e
MD5 603e294055d293abb6add4dcca8e74bc
BLAKE2b-256 2b135ef61faf358267e705ae3f17d822f26fb3f3abddd8559fbe9dba7aa1cf2c

See more details on using hashes here.

File details

Details for the file extension_manifest_converter-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for extension_manifest_converter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f512082cdd4f26379b095c1347a2f569f522f02e9dc4f62402d8ca4d97395da
MD5 b879521598369acbc85c72febf32fee3
BLAKE2b-256 e84bf474917e682a9cdf06113a8848756ff66c0706fd46d8e63b632414257f37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page