Giter Club home page Giter Club logo

extension-manifest-converter's Introduction

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 unpacked directory
  • an extension zip file
  • just a manifest.json file.

After using the tool, complete the conversion using instructions in the Migrate to Manifest V3 guide. This tool makes the conversions listed below. To make completion of the upgrading easier, the titles and bullets below roughly correspond to the wording of the headings and items in the migration guide's checklist.

Updates to the manifest

  • Changes the manifest version number.
  • Updates the host permissions.

Updates that migrate to a service worker

  • Upgrades the "background" field in the manifest.

Updates to API calls

  • Replaces tabs.executeScript() with scripting.executeScript(). (If necessary, also adds scripting to the permissions array in the manifest.json.)
  • Replaces tabs.insertCSS() with scripting.insertCSS(). You will still need to [replace tabs.removeCSS() with scripting.removeCSS()](https://developer.chrome.com/docs/extensions/migrating/api-calls/#replace-insertcss-removecss). (If necessary, also adds scripting to the permissions array in manifest.json.)
  • Replaces Browser Actions and Page Actions with Actions and makes related changes to the manifest.

Improvement to extension security

  • Updates the content security policy.

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 the DOM.

Installation

To use this tool, follow 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. Clone this repo using the below command.

    git clone https://github.com/GoogleChromeLabs/extension-manifest-converter
  3. cd into the cloned project directory.

  4. Execute the test command.

    python3 emc.py

    The tool logs basic usage information to the console.

Usage

  • Convert a directory

    python3 emc.py dir/path/
  • Convert a manifest file

    python3 emc.py manifest.json
  • Convert a .zip file

    python3 emc.py extension.zip

License

Apache 2.0

This is not an official Google product.

extension-manifest-converter's People

Contributors

jpmedley avatar solomonkinard avatar tyraeldlee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.