C.W.K.
Stream
Lesson 03 of 06 · published

Install, Reload, Update — dev loop

~8 min · install-workflow, load-unpacked, developer-mode, chrome-extensions-page, clipdeck, hands-on

Level 0Extension 입덕
0 XP0/54 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete
"chrome://extensions 가 extension 개발의 출입구야. Dev mode 가 폴더를 가리키면 Chrome 이 그 자리에서 read — rebuild 단계 없음, packaging round-trip 없음. Iteration loop 가 그래서 짧아."

Extension 은 어디에서 load 돼?

모든 Chrome extension 은 — Web Store 에서 install 됐든, 개발자 build 에서 sideload 됐든, disk 에서 unpacked 됐든 — chrome://extensions 페이지에 등재돼. 그 페이지가 Chrome 의 extension control plane: toggle / reload / inspect / remove / errors 확인을 다 거기서 해.

개발할 때 중요한 스위치는 딱 하나: 오른쪽 위 Developer mode. 켜면 버튼 셋이 떠 — Load unpacked / Pack extension / Update. 그 중 Load unpacked 가 iteration loop 를 굴리는 버튼.

Load Unpacked: 세 단계

Lesson 2 에서 만든 clipdeck/ 디렉토리 (manifest 가 들어 있는) 에서 시작:

  1. chrome://extensions 열기.
  2. Developer mode 켜기 (오른쪽 위 toggle).
  3. Load unpacked 클릭 → clipdeck/ 폴더 선택.

Chrome 이 manifest.json 을 그 자리에서 읽어. Parse 깨끗하면 extension card 가 떠 — ID (32 hex 자, unpacked 의 경우 폴더 path 기반), Name ("ClipDeck"), Version ("0.1.0"), Description, 그리고 Details / Remove / Errors 버튼 줄. ClipDeck 아이콘이 toolbar 에도 보여 — 지금 클릭은 아무 일도 안 일어나 (popup.html 이 아직 없어; Lesson 4 의 일).

Manifest parse 실패하면 카드에 빨간 Errors 표시. 클릭하면 JSON parse error, 빠진 field, Chrome 이 못 찾은 파일 등 표시. manifest 고치고, 카드의 reload (↻) 버튼 클릭, Chrome 이 디렉토리 다시 read.

Reload 버튼

Reload 버튼이 dev loop 의 심장. manifest.json / background.js / popup.html / popup.js / 그 외 어떤 extension 파일이든 수정했으면 reload 클릭. Chrome 이 즉시 새 파일 집어 와.

두 가지 refresh 패턴 기억:

  • Extension chrome (popup / side panel / background / options page): reload 버튼만으로 충분. Popup 은 닫았다 다시 열고, side panel 은 다음 열림 때 re-mount.
  • Content script: extension reload 한 다음 추가로 content script 가 injected 된 host page 도 refresh 해. Chrome 이 소급해서 re-inject 하지 않아 — content script 는 page load 때만 실행돼.

두 번째 패턴은 누구나 한 번은 잊어버려. 처음 잊고 content-script 로그가 조용해진 걸 본 다음부터 muscle memory 돼.

Update lifecycle

Web Store extension 은 Chrome 이 몇 시간마다 update check 해서 silently 적용. Unpacked extension 은 네가 update — reload 버튼 update.

manifest 의 version"0.1.0" 에서 "0.2.0" 으로 bump 하고 reload 하면, Chrome 이 chrome.runtime.onInstalled 를 reason "update" 로 fire. 그게 migration 의 hook — storage schema bump, stale entries clear, 새 alarms 설정. Track 2 가 이걸 본격적으로 wire 해; 지금은 hook 존재한다는 것만.

Errors panel

모든 extension card 에 Errors 버튼 있어 (errors 있을 때만 보임). 클릭하면:

  • manifest parse 실패
  • service worker exception (timestamp + stack trace)
  • 페이지별 content script exception
  • permission warning

Errors panel 은 sticky — clear 하거나 reload 하기 전까지 errors 누적. 빡세게 iterate 할 때는 각 테스트 전에 clear 해서 최신 noise 만 보이게.

Load unpacked + reload 버튼 = extension dev loop. 이거 익히면 iteration 속도가 어떤 컴파일 언어 dev cycle 도 이김.
chrome://extensions 를 dev 중에는 dedicated tab 으로 pin 해놔. 한 세션에 수십 번 들어가 — pin 된 tab 으로 가는 keystroke 가 URL 입력보다 싸. Cmd+1 ~ Cmd+9 로 pin tab 위치별 점프.

ClipDeck 첫 load

Lesson 2 의 exercise 따라했으면 clipdeck/ 폴더에 manifest.json 과 placeholder 아이콘 셋 있음. 이걸 지금 load 하면 ClipDeck 이 진짜 Chrome extension 으로 존재 — sandbox 됨, 등재됨, toolbar 아이콘 + stable extension ID 까지. Popup 은 비어 있음; Lesson 4 가 채워. 근데 lifecycle 은 이미 손에 들어옴: edit / reload / 필요시 host page refresh / 반복.

Code

chrome.runtime.onInstalled — 첫 install vs update hook (Track 2 preview)·javascript
// Future preview — Track 2 wires this up. Lives in background.js.
chrome.runtime.onInstalled.addListener((details) => {
  if (details.reason === "install") {
    console.log("ClipDeck installed for the first time");
    // initialize default storage, set up alarms, etc.
  } else if (details.reason === "update") {
    const fromVersion = details.previousVersion;
    const toVersion = chrome.runtime.getManifest().version;
    console.log(`ClipDeck updated from ${fromVersion} to ${toVersion}`);
    // migrate storage schema if needed
  }
});

External links

Exercise

Lesson 2 에서 만든 clipdeck/ 디렉토리 (manifest.json + 아이콘 PNG 셋) 를 chrome://extensions → Developer mode → Load unpacked 로 load. Extension card 떠야 함: ID / Name / Version / Description / Manifest version (3 이어야 함) 메모. ClipDeck 아이콘 Chrome toolbar 에 보여? 클릭하면? (예상: 아무 일도 안 일어남 — popup.html 아직 없음, Lesson 4 의 일.) Errors panel — 비어 있나, warning 있나? 이제 manifest.json 편집: version 을 "0.1.0" → "0.2.0" 바꾸고 저장, 카드의 reload (↻) 버튼 클릭. 카드의 version field 가 업데이트되는 거 봐. 그게 dev loop 전체.
Hint
Load 실패하면 Errors panel 이 이유 설명 — 대개 JSON typo 또는 빠진 icon path. 아이콘이 load 됐는데 toolbar 아이콘이 generic (puzzle piece) 으로 보이면 icons.16 가 valid 한 16×16 PNG 가리키는지 확인. Chrome 은 16-px 아이콘이 없거나 못 읽으면 puzzle piece 로 fallback.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고
💛 by 피파warm

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.