Browser Extensions Development (Chrome & Edge) · Lezione

Comprendere la struttura di Manifest V3

Esplori in dettaglio il file manifest.json, apprendendo i campi obbligatori e le configurazioni comuni di Manifest V3.

Lezione 1 di 411 passaggi

Comprendere la struttura di Manifest V3 è una lezione Browser Extensions Development (Chrome & Edge) gratuita su CoddyKit. Questa è la lezione 1 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Browser Extensions Development (Chrome & Edge), e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Browser Extensions Development (Chrome & Edge) include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

The Blueprint of Your Extension

Every browser extension starts with a core configuration file called manifest.json. Think of it as the blueprint or identity card for your extension.

This file tells the browser everything it needs to know: its name, version, what permissions it needs, and which files make up its different parts.

Introducing Manifest V3

Manifest V3 is the latest version of the extension platform, bringing significant changes focused on security, privacy, and performance.

All new extensions must use Manifest V3, and existing extensions are migrating. Understanding its structure is crucial for modern extension development.

Required Field: manifest_version

The manifest_version field is mandatory and tells the browser which set of APIs and security features your extension expects.

  • For Manifest V3, this value must always be 3.
  • It's the very first declaration in your manifest.json file.

Required Fields: name and version

These two fields are also essential for every extension:

  • name: This is the user-visible name of your extension. It appears in the browser's extension management page and in the web store.
  • version: This specifies the version of your extension, typically following semantic versioning (e.g., "1.0.0"). It helps users track updates.

Your First Manifest File

Let's see the absolute minimum needed for a valid Manifest V3 file. This simple JSON structure is the foundation for any extension you build.

{
  "manifest_version": 3,
  "name": "My Basic Extension",
  "version": "1.0"
}

Optional Field: description

While not strictly required, adding a description is highly recommended. It provides a short summary of what your extension does.

This description is visible to users in the browser's extension management page and is crucial for your listing in the Chrome Web Store or Edge Add-ons store.

Optional Field: icons

The icons field allows you to define images that represent your extension. Browsers use different sizes for various UI contexts:

  • Toolbar buttons (16x16, 24x24, 32x32 pixels)
  • Extension management page (48x48 pixels)
  • Web store listing (128x128 pixels)

Always provide a 128x128 icon for store listings.

Optional Field: action

The action field defines the behavior of your extension's toolbar button, often called the 'browser action' button. This is the icon next to the address bar.

It commonly points to an HTML file (a "popup") that appears when the button is clicked, allowing for quick user interaction with your extension's UI.

A More Detailed Manifest

Let's expand our manifest to include a description, icons, and an action popup. This gives your extension a clear identity and a basic interactive element.

{
  "manifest_version": 3,
  "name": "My Awesome Extension",
  "version": "1.0",
  "description": "A simple extension to do awesome things!",
  "icons": {
    "16": "icons/icon16.png",
    "48": "icons/icon48.png",
    "128": "icons/icon128.png"
  },
  "action": {
    "default_popup": "popup.html",
    "default_icon": {
      "16": "icons/icon16.png",
      "24": "icons/icon24.png",
      "32": "icons/icon32.png"
    },
    "default_title": "Click to open!"
  }
}

Quick Check on Manifest Fields

Based on what you've learned, identify the fields that are absolutely required in a Manifest V3 manifest.json file.

Manifest V3: Your Extension's Identity

We've explored the fundamental role of the manifest.json file, understanding it as the blueprint for your browser extension.

  • You learned about the three critical required fields: manifest_version (always 3), name, and version.
  • We also touched upon important optional fields like description, icons, and action, which define your extension's appearance and basic user interface.

Mastering the manifest file is the first step to building powerful and compliant browser extensions!

Gratis per iniziare

Impara JavaScript con un tutor IA — gratis

Scrivi ed esegui vero codice nel tuo browser, ricevi aiuto istantaneo da un tutor IA disponibile 24/7, e riprendi da dove hai lasciato sul web o nell'app.

Corsi
12
Lezioni
48

Domande Frequenti

La lezione «Comprendere la struttura di Manifest V3» è gratuita?

Sì — il testo completo di «Comprendere la struttura di Manifest V3» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Browser Extensions Development (Chrome & Edge), passa a CoddyKit PRO. Il corso Browser Extensions Development (Chrome & Edge) include 4 lezioni in totale.

Cosa imparerò in «Comprendere la struttura di Manifest V3»?

Esplori in dettaglio il file manifest.json, apprendendo i campi obbligatori e le configurazioni comuni di Manifest V3. Eserciti Browser Extensions Development (Chrome & Edge) con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Browser Extensions Development (Chrome & Edge)?

Non è richiesta alcuna esperienza precedente. Browser Extensions Development (Chrome & Edge) su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 1 di 4.

Quanto tempo richiede la lezione «Comprendere la struttura di Manifest V3»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Browser Extensions Development (Chrome & Edge)?

Sì. Ogni lezione Browser Extensions Development (Chrome & Edge) include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Comprendere la struttura di Manifest V3
  2. Service worker in background
  3. Permessi e corrispondenza degli host
  4. Action, icone e pulsante della barra degli strumenti
← Torna a Browser Extensions Development (Chrome & Edge)