拡張機能プロジェクトの構成
Manifest V3ブラウザー拡張機能を構成する標準的なファイルとフォルダーを確認し、それぞれの役割を学びます。
「拡張機能プロジェクトの構成」はCoddyKit上の無料Browser Extensions Development (Chrome & Edge)レッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはBrowser Extensions Development (Chrome & Edge)学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Browser Extensions Development (Chrome & Edge)コースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Extensions Are Just Web Files
An extension is just a bundle of HTML, CSS, JavaScript, and a config file, which the browser loads in a special, extra-capable context.
The manifest.json Heart
Every extension needs a manifest.json at its root — it declares name, version, permissions, and scripts. Without it, the browser ignores the folder.
{
"manifest_version": 3,
"name": "My Extension",
"version": "1.0.0"
}A Typical Folder Structure
Layout is flexible, but a clean folder structure stays maintainable: manifest at root, plus popup, background, content, and icons folders.
The Background Service Worker
In Manifest V3, background logic runs as a service worker. It handles events even with no UI open, but unloads when idle to save memory.
{
"background": {
"service_worker": "background.js"
}
}The Popup Action
The action defines the toolbar button and the popup it opens — itself just a tiny HTML page. The config below shows both fields.
{
"action": {
"default_popup": "popup/popup.html",
"default_title": "Open My Extension"
}
}Content Scripts
Content scripts run inside web pages so your extension can read and modify the DOM. You scope them with URL match patterns.
{
"content_scripts": [{
"matches": ["https://*.example.com/*"],
"js": ["content/main.js"]
}]
}Icons in Multiple Sizes
Provide your icon in several sizes — browsers show it in different places at different resolutions, so it stays crisp everywhere.
{
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
}Declaring Permissions
The permissions array lists the browser APIs you need, like storage or tabs. Request only what you actually use.
{
"permissions": ["storage", "activeTab"]
}Web-Accessible Resources
If a web page must load a file packaged in your extension, list it under web_accessible_resources — otherwise the browser blocks access.
{
"web_accessible_resources": [{
"resources": ["images/logo.png"],
"matches": ["https://*.example.com/*"]
}]
}How Pieces Communicate
Popup, content scripts, and service worker live in separate contexts, so they talk via the messaging API, not shared variables.
chrome.runtime.sendMessage({ type: 'PING' })Keeping It Organized
As it grows, group related files into folders and keep manifest.json lean. A predictable layout makes debugging and store review easier.
Quick Check
Check what you remember about extension structure.
Recap
You toured the building blocks: manifest.json declares all, a service worker runs background, the action drives the popup, content scripts touch pages.
よくある質問
「拡張機能プロジェクトの構成」レッスンは無料ですか?
はい。「拡張機能プロジェクトの構成」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Browser Extensions Development (Chrome & Edge)コースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Browser Extensions Development (Chrome & Edge)コースには全4レッスンが含まれています。
「拡張機能プロジェクトの構成」で何を学びますか?
Manifest V3ブラウザー拡張機能を構成する標準的なファイルとフォルダーを確認し、それぞれの役割を学びます。 ブラウザで直接実行するハンズオンコードでBrowser Extensions Development (Chrome & Edge)を演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Browser Extensions Development (Chrome & Edge)を始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのBrowser Extensions Development (Chrome & Edge)は初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「拡張機能プロジェクトの構成」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このBrowser Extensions Development (Chrome & Edge)レッスンでコードを書いて実行できますか?
はい。すべてのBrowser Extensions Development (Chrome & Edge)レッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- ブラウザー拡張機能とは
- 開発環境のセットアップ
- 初めての「Hello World」拡張機能
- 拡張機能プロジェクトの構成