Pierwsze rozszerzenie „Hello World”
Utwórz minimalne rozszerzenie „Hello World”, poznając plik manifestu, podstawową strukturę i sposób ładowania rozszerzenia w przeglądarce.
Pierwsze rozszerzenie „Hello World” to bezpłatna lekcja Browser Extensions Development (Chrome & Edge) na CoddyKit. To lekcja 3 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Browser Extensions Development (Chrome & Edge), a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Browser Extensions Development (Chrome & Edge) zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
Your First Extension: Hello World
Time to build your first extension — a classic Hello World popup that greets you when you click its toolbar icon. The core Manifest V3 shape.
Core Extension Components
Every extension needs a few key files: manifest.json (the blueprint), popup.html (the popup content), and an icon. We'll build them step by step.
Manifest.json: The Blueprint
The manifest.json is the most important file — JSON metadata like name, version, and permissions, in the structure Manifest V3 expects.
Essential Manifest Fields
Start your manifest with three required fields: manifest_version 3, a name, and a version. The snippet below shows the minimal shape.
{ "manifest_version": 3,
"name": "Hello World Extension",
"version": "1.0"
}Adding Description & Icons
Add a description and an icons map so users understand and recognize your extension. Provide several sizes like 16, 48, and 128 pixels.
{ "manifest_version": 3,
"name": "Hello World Extension",
"version": "1.0",
"description": "A simple 'Hello World' extension for CoddyKit.",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
}
}Defining the Popup with 'action'
The action field defines the toolbar button: default_popup points to your popup HTML, and default_icon sets the toolbar image.
{ "manifest_version": 3,
"name": "Hello World Extension",
"version": "1.0",
"description": "A simple 'Hello World' extension for CoddyKit.",
"icons": { "16": "icon16.png" },
"action": {
"default_popup": "popup.html",
"default_icon": { "16": "icon16.png" }
}
}Creating popup.html
Create popup.html — a plain HTML file holding your Hello World message. Keep it small and light, since it shows in a tiny popup window.
<!DOCTYPE html>
<html>
<head>
<title>Hello World Popup</title>
<style>
body { font-family: sans-serif; padding: 15px; width: 150px; }
h1 { font-size: 1.2em; color: #333; margin: 0; }
</style>
</head>
<body>
<h1>Hello, CoddyKit!</h1>
</body>
</html>Your Extension's Folder Structure
Your folder should now hold manifest.json, popup.html, and the icons, all directly inside — a clean layout the browser can load correctly.
Loading Your Extension (Chrome)
Load it in Chrome or Edge: open chrome://extensions, flip on Developer mode, click Load unpacked, and pick your folder. It joins the list!
Test Your New Extension!
Spot your extension's icon in the toolbar and click it — a popup appears reading "Hello, CoddyKit!" from your popup.html. First extension done!
Quick Check: Manifest V3
Which field is absolutely essential to declare the manifest format version in manifest.json for a Manifest V3 extension?
Recap: Your First Extension
You built and loaded a real extension: a manifest with key fields, an action popup, a popup.html, all run via Developer mode. Keep tinkering!
Ucz się JavaScript dzięki korepetycjom AI — za darmo
Pisz i uruchamiaj kod w przeglądarce, otrzymuj natychmiastową pomoc od korepetytora AI dostępnego 24/7 i kontynuuj naukę w sieci lub w aplikacji.
- Kursy
- 12
- Lekcje
- 48
Często zadawane pytania
Czy lekcja „Pierwsze rozszerzenie „Hello World”” jest bezpłatna?
Tak — pełny tekst „Pierwsze rozszerzenie „Hello World”” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Browser Extensions Development (Chrome & Edge), przejdź na CoddyKit PRO. Kurs Browser Extensions Development (Chrome & Edge) zawiera 4 lekcji w sumie.
Co nauczysz się w „Pierwsze rozszerzenie „Hello World””?
Utwórz minimalne rozszerzenie „Hello World”, poznając plik manifestu, podstawową strukturę i sposób ładowania rozszerzenia w przeglądarce. Ćwiczysz Browser Extensions Development (Chrome & Edge) z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć Browser Extensions Development (Chrome & Edge)?
Nie wymagamy żadnego doświadczenia. Browser Extensions Development (Chrome & Edge) w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 3 z 4.
Ile czasu zajmuje lekcja „Pierwsze rozszerzenie „Hello World””?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji Browser Extensions Development (Chrome & Edge)?
Tak. Każda lekcja Browser Extensions Development (Chrome & Edge) zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Czym są rozszerzenia przeglądarki
- Konfiguracja środowiska programistycznego
- Pierwsze rozszerzenie „Hello World”
- Anatomia projektu rozszerzenia