What are chrome extensions?

It is a small program to modify the experience or add functionality to the chrome browser. They are created using web technology like HTML, CSS, JavaScript, etc.
The main aim of an extension is to serve a single purpose around which the whole program is built, although it can have multiple components but they should help in accomplishing the main purpose of the program.
An extension should have the minimal interface or it can extend to a web page also but main focus is to provide good functionality with less overhead.
Extension are zipped into a in .crx package, the user needs to download the package and install it. Chrome extension is published in the Chrome web store.

Some example of chrome extension is:

  • Password manager
  • Ads blocker
  • Adding to-do lists or notes to Chrome
  • Making it easier to copy text from a site

Let’s create a simple extension just to demonstrate the working procedure:



  • Every extension require a manifest file
    First, create a manifest.json file

     {
        "name": "Hello Extensions",
        "description" : "Base Level Extension",
        "version": "1.0",
        "manifest_version": 2
      }
  • Then, for demonstration we will add an icon to the extension which will on being clicked open a web page created by us.
    Add this inside the file

    "browser_action": {
          "default_popup": "hello.html",
          "default_icon": "icon.png"
        }   
    
  • Then add this to include a shortcut to display the HTML page
    "commands": {
          "_execute_browser_action": {
            "suggested_key": {
              "default": "Ctrl+Shift+F"
            },
            "description": "Opens hello.html"
          }
        }
    



My Personal Notes arrow_drop_up


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.