Chrome Extension (Manifest V3) Dev: Service

๐Ÿ’ก Chrome Extension (Manifest V3) Dev: Service โ€” Executive Summary

Technical architectural analysis, practical configuration manifests, and deployment instructions for Chrome Extension (Manifest V3) Dev: Service.

Sample
  • manifest.json
json
{
    "manifest_version": 3,
    "name": "My First Extension",
    "version": "1.0",
    "description": "ํด๋ฆญํ•˜๋ฉด ์ธ์‚ฌ๋ฅผ ๊ฑด๋„ค๋Š” ํŒ์—… ํ”„๋กœ๊ทธ๋žจ",
    "action": {
      "default_popup": "popup.html"
    },
    "permissions": ["activeTab"]
  }
  • popup.html
html
<!DOCTYPE html>
  <html lang="ko">
  <head>
    <meta charset="UTF-8">
    <style>
      body { width: 200px; padding: 10px; font-family: sans-serif; text-align: center; }
      button { background: #4ecb99; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
    </style>
  </head>
  <body>
    <h3>Hello Extension!</h3>
    <button id="btn">ํด๋ฆญํ•ด๋ด</button>
    <script src="popup.js"></script>
  </body>
  </html>
  • popup.js
javascript
document.getElementById('btn').addEventListener('click', () => {
    alert('๋ฐ˜๊ฐ‘์Šต๋‹ˆ๋‹ค! ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ์ด ์ •์ƒ ์ž‘๋™ ์ค‘์ž…๋‹ˆ๋‹ค.');
  });
Exec
Create source
bash
mkdir chrome-extension-test
cd chrome-extension-test

cat <<EOF > manifest.json
{
  "manifest_version": 3,
  "name": "My First Extension",
  "version": "1.0",
  "description": "ํด๋ฆญํ•˜๋ฉด ์ธ์‚ฌ๋ฅผ ๊ฑด๋„ค๋Š” ํŒ์—… ํ”„๋กœ๊ทธ๋žจ",
  "action": {
    "default_popup": "popup.html"
  },
  "permissions": ["activeTab"]
}
EOF

cat <<EOF > popup.html
<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <style>
    body { width: 200px; padding: 10px; font-family: sans-serif; text-align: center; }
    button { background: #4ecb99; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
  </style>
</head>
<body>
  <h3>Hello Extension!</h3>
  <button id="btn">ํด๋ฆญํ•ด๋ด</button>
  <script src="popup.js"></script>
</body>
</html>
EOF

cat <<EOF > popup.js
document.getElementById('btn').addEventListener('click', () => {
  alert('๋ฐ˜๊ฐ‘์Šต๋‹ˆ๋‹ค! ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ์ด ์ •์ƒ ์ž‘๋™ ์ค‘์ž…๋‹ˆ๋‹ค.');
});
EOF
Register extension
  1. After connecting to chrome://extensions/, turn on developer mode
  2. Select Load unpacked extension and select source directory
Compress extension
  1. After connecting to chrome://extensions/, turn on developer mode
  2. Select Compress extension and select source directory
  3. output: .crx, .pem

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *