Skip to content

emka.web.id

menulis pengetahuan – merekam peradaban

Menu
  • Home
  • Tutorial
  • Search
Menu

How to Create Google Chrome Extension, Part 1

Posted on December 17, 2012

This tutorial walks you through creating a simple extension. You’ll add an icon to Google Chrome that, when clicked, displays an automatically generated page. The icon and page will look something like this:

a window with a grid of images related to 'Hello World'

You can develop extensions using any release of Google Chrome, on Windows, Mac, or Linux. Extensions you develop on one platform should run without change on every platform Chrome supports.

Create and load an extension

The extension we’ll walk through creating here is a Browser Action, which adds a button to Chrome’s toolbar whose behavior you can control.

  1. Create a folder somewhere on your computer to contain your extension’s code.
  2. Inside your extension’s folder, create a text file called manifest.json, and fill it with the following code:
    [sourcecode]{
    "name": "My First Extension",
    "version": "1.0",
    "manifest_version": 2,
    "description": "The first extension that I made.",
    "browser_action": {
    "default_icon": "icon.png"
    },
    "permissions": [
    "http://api.flickr.com/"
    ]
    }[/sourcecode]
  3. Copy this icon to the same folder:
    Download icon.png
  4. Load the extension.
    1. Bring up the extensions management page by clicking the wrench icon  and choosing Tools > Extensions.
    2. If Developer mode has a + by it, click the + to add developer information to the page. The + changes to a -, and more buttons and information appear.
    3. Click the Load unpacked extension button. A file dialog appears.
    4. In the file dialog, navigate to your extension’s folder and click OK.

If your extension is valid, its icon appears next to the address bar, and information about the extension appears in the extensions page, as the following screenshot shows.

Add code to the extension

In this step, you’ll make your extension do something besides just look good.

  1. Edit manifest.json to add the following line:
    [sourcecode]…
    "browser_action": {
    "default_icon": "icon.png"<b>,
    "default_popup": "popup.html"</b>
    },
    …[/sourcecode]
    Inside your extension’s folder, create two text files called popup.html and popup.js. Add the following code to these files:

    HTML code (popup.html) and JavaScript code (popup.js) for hello_world

  2. Return to the extensions management page, and click the Reload button to load the new version of the extension.
  3. Click the extension’s icon. A popup should appear that displays the contents of popup.html.

It should look something like this:

a popup with a grid of images related to HELLO WORLD

If you don’t see the popup, try the instructions again, following them exactly. Don’t try loading an HTML file that isn’t in the extension’s folder — it won’t work!

 

Terbaru

  • Inilah 6 Langkah Tembus 5.000 Follower di X, Gini Caranya Supaya Akun Kalian Nggak Stuck Lagi!
  • SEO LinkedIn: Inilah Alasan Kenapa LinkedIn Ads Lebih Efektif Buat Bisnis B2B Dibanding Platform Lain
  • Inilah Alasan Kenapa Kolom Komentar YouTube Kalian Sering Menghilang Secara Misterius!
  • Cara Kelola Auto-Posting Semua Media Sosial Kalian Pakai Metricool
  • Studi Kasus Sukses Instagram Maria Wendt Dapat 12 Juta View Instagram Per Bulan
  • ZenBook S16, Vivobook Pro 15 OLED, ProArt PX13, dan ROG Zephyrus G14, Laptop Bagus dengan Layar OLED!
  • Caranya Ngebangun Website Directory dengan Traffic Tinggi dalam Seminggu!
  • Cara Mengembangkan Channel YouTube Shorts Tanpa Wajah
  • Inilah Cara Menghitung Diskon Baju Lebaran Biar Nggak Bingung Saat Belanja di Mall!
  • Cara Jitu Ngebangun Bisnis SaaS di Era AI Pakai Strategi Agentic Workflow
  • Inilah Rincian Gaji Polri Lulusan Baru 2026, Cek Perbedaan Jalur Akpol, Bintara, dan Tamtama Sebelum Daftar!
  • Inilah 5 Channel YouTube Membosankan yang Diam-diam Menghasilkan Banyak Uang
  • Inilah Cara Pakai Google Maps Offline Biar Mudik Lebaran 2026 Nggak Nyasar Meski Tanpa Sinyal!
  • Inilah Alasan Mahkamah Agung Tolak Kasasi Google, Denda Rp202,5 Miliar Resmi Menanti Akibat Praktik Monopoli
  • Inilah Cara Daftar dan Syarat SPMB SMK Boarding Jawa Tengah 2026, Sekolah Gratis Sampai Lulus!
  • Inilah Daftar Sekolah Kedinasan 2026 untuk Lulusan SMK, Bisa Kuliah Gratis dan Berpeluang Besar Langsung Jadi CPNS!
  • Inilah Pajak TER: Skema Baru PPh 21 yang Nggak Bikin Pusing, Begini Cara Hitungnya!
  • Inilah Jadwal Resmi Jam Buka Tol Jogja-Solo Segmen Prambanan-Purwomartani Saat Mudik Lebaran 2026
  • Inilah Cara Mendapatkan Witherbloom di Fisch Roblox, Rahasia Menangkap Ikan Paling Sulit di Toxic Grove!
  • Kenapa Indomart Point Bisa Kalahkan Bisnis Kafe?
  • Inilah Cara Mendapatkan Rotten Seed di Fisch Roblox, Lokasi Rahasia di Toxic Grove Buat Unlock Toxic Lotus!
  • Inilah Cara Zakat Crypto Kalian Bisa Jadi Pengurang Pajak Berdasarkan Aturan Resmi Pemerintah!
  • Inilah Perbandingan Airwallex vs Payoneer 2026: Jangan Sampai Profit Kalian Ludes Gara-Gara Biaya Admin!
  • Inilah Roadmap 7 Tahap Bangun Bisnis Digital dari Nol Biar Nggak Cuma Putar-Putar di Tempat!
  • Inilah Cara Tetap Gajian dari YouTube Meski View Masih Ratusan, Penasaran?
  • Inilah Alasan Akun TikTok Affiliate GMV 270 Juta Kena Banned Permanen!
  • Inilah Bahaya Astute Beta Server APK, Jangan Sembarang Klik Link Download FF Kipas 2026!
  • Inilah Bahaya Nonton Film di LK21 dan IndoXXI, Awas Data Pribadi dan Saldo Rekening Kalian Bisa Ludes!
  • Inilah Kronologi & Video Lengkap Kasus Sejoli Tambelangan Sampang Viral, Ternyata Gini Awal Mulanya!
  • Inilah Alasan Kenapa Koin Nego Neko Shopee Nggak Bisa Dipakai Bayar Full dan Cara Rahasia Dapetinnya!
  • What is Microsoft Visual C++ Redistributable and How to Fix Common Errors?
  • What is the 99% Deletion Bug? Understanding and Fixing Windows 11 File Errors
  • How to Add a Password to WhatsApp for Extra Security
  • How to Recover Lost Windows Passwords with a Decryptor Tool
  • How to Fix Python Not Working in VS Code Terminal: A Troubleshooting Guide
  • How to Training Your Own YOLO26 Object Detection Model!
  • How to Build a Full-Stack Mobile App in Minutes with YouWare AI
  • How to Create Consistent Characters and Cinematic AI Video Production with Seedance
  • How to Find Your Next Viral Product Using PiPiAds AI Like a Pro!
  • Create Your Own Netflix-Style Documentaries Using AIQORA in Minutes!
  • Apa itu Spear-Phishing via npm? Ini Pengertian dan Cara Kerjanya yang Makin Licin
  • Apa Itu Predator Spyware? Ini Pengertian dan Kontroversi Penghapusan Sanksinya
  • Mengenal Apa itu TONESHELL: Backdoor Berbahaya dari Kelompok Mustang Panda
  • Siapa itu Kelompok Hacker Silver Fox?
  • Apa itu CVE-2025-52691 SmarterMail? Celah Keamanan Paling Berbahaya Tahun 2025

©2026 emka.web.id | Design: Newspaperly WordPress Theme