[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,91 +2,183 @@
|
||||
id: wiki-2026-0508-browser
|
||||
title: Browser
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-BROW-001]
|
||||
aliases: [Web Browser, Browser Internals, Rendering Engine]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.95
|
||||
tags: [auto-reinforced, browser, web-access, rendering-engine, internet-infrastructure, client-side]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [browser, web, rendering, javascript, networking]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: C++/Rust
|
||||
framework: Chromium/Gecko/WebKit
|
||||
---
|
||||
|
||||
# [[Browser|Browser]]
|
||||
# Browser
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "인터넷 세상의 망원경이자 창: 서버로부터 전송받은 복잡한 코드(HTML, CSS, JS)를 인간이 보고 즐길 수 있는 아름다운 화면으로 실시간으로 번역하여 우주보다 넓은 웹의 바다를 항해하게 해주는 도구."
|
||||
## 매 한 줄
|
||||
> **"매 browser = networking stack + parsing + rendering + JS engine + sandbox 의 거대한 OS-like 시스템."**. 매 2026 현재 Chromium-derived (Chrome, Edge, Brave, Arc) 가 ~70% market share, Firefox/Gecko 와 Safari/WebKit 이 나머지. 매 process-per-site isolation, GPU-accelerated compositing, V8 의 Sparkplug+Maglev+TurboFan tier 가 modern baseline.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
웹 브라우저(Web Browser)는 인터넷상에 존재하는 정보를 검색하고 표시하며 사용자와 상호작용하는 소프트웨어입니다.
|
||||
## 매 핵심
|
||||
|
||||
1. **핵심 기능**:
|
||||
* **Rendering**: 코드를 해석하여 픽셀로 변환. ([[Visual-Effects-VFX|Visual-Effects-VFX]]와 맥락 공유)
|
||||
* **Execution**: [[JavaScript|JavaScript]] 엔진(예: V8)을 통해 복잡한 웹 앱 구동.
|
||||
* **Caching & Persistence**: 방문 기록, 쿠키 등을 저장하여 성능 향상 및 보안 유지.
|
||||
2. **OS로서의 브라우저**:
|
||||
* 현대 브라우저는 단순한 문서 뷰어를 넘어, 오피스, 게임, AI 도구들이 실행되는 '온라인 운영체제' 역할을 수행함.
|
||||
### 매 multi-process architecture
|
||||
- **Browser process**: 매 UI, networking, IPC orchestration.
|
||||
- **Renderer process**: 매 site-per-process — Blink + V8.
|
||||
- **GPU process**: 매 compositing, WebGL/WebGPU.
|
||||
- **Network service**: 매 별도 process — credential isolation.
|
||||
- **Utility processes**: 매 audio, video decode, storage.
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌**: 과거 브라우저 정책은 단순 정보 조희(Read-only) 중심이었으나, 현대 정책은 사용자의 데이터 주권을 지키고 AI 에이전트가 직접 웹을 탐색하며 작업을 수행하는 '에이전틱 브라우징 정책'으로 진화함(RL Update).
|
||||
- **정책 변화(RL Update)**: 서드파티 쿠키 차단 정책(Cookieless) 등 개인정보 보호 정책이 강화됨에 따라, 브라우저가 사용자 익명성을 보장하는 동시에 광고 성과를 측정하는 새로운 추적 차단 정책과 표준이 수립됨.
|
||||
### 매 rendering pipeline
|
||||
1. **Parse** HTML → DOM.
|
||||
2. **Parse** CSS → CSSOM.
|
||||
3. **Style** — match rules → ComputedStyle.
|
||||
4. **Layout** — geometry computation.
|
||||
5. **Paint** — layer 별 display list.
|
||||
6. **Composite** — GPU 가 layer 합성.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Backend|Backend]], [[API-Key-Management|API-Key-Management]], [[Availability-and-Persistence|Availability-and-Persistence]], [[Visual-Effects-VFX|Visual-Effects-VFX]], [[Technical-Architecture|Technical-Architecture]]
|
||||
- **Modern Tech/Tools**: [[Chrome|Chrome]], Firefox, Safari, [[Chromium|Chromium]]-based browsers, [[WebAssembly|WebAssembly]] (Wasm).
|
||||
---
|
||||
### 매 JS engine tiers (V8)
|
||||
- **Ignition** (interpreter) → **Sparkplug** (baseline JIT) → **Maglev** (mid-tier) → **TurboFan** (optimizing JIT).
|
||||
- 매 hot function 만 점진적 promotion.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 응용
|
||||
1. **Web app development**: 매 performance budgeting.
|
||||
2. **Extension / DevTools**: 매 internal API.
|
||||
3. **Embedded webview**: 매 Electron, Tauri, CEF.
|
||||
4. **Headless**: 매 Puppeteer, Playwright scraping/test.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### Performance: Critical Rendering Path
|
||||
```html
|
||||
<!-- inline above-the-fold CSS, defer non-critical -->
|
||||
<style>/* critical CSS here */</style>
|
||||
<link rel="preload" href="/fonts/main.woff2" as="font" crossorigin>
|
||||
<link rel="stylesheet" href="/non-critical.css" media="print" onload="this.media='all'">
|
||||
<script type="module" src="/app.js" defer></script>
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### Avoid layout thrash
|
||||
```javascript
|
||||
// BAD — read/write/read/write triggers sync layouts
|
||||
boxes.forEach(b => {
|
||||
const w = b.offsetWidth; // forces layout
|
||||
b.style.width = (w * 2) + 'px'; // invalidates
|
||||
});
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
// GOOD — batch reads then writes
|
||||
const widths = boxes.map(b => b.offsetWidth);
|
||||
boxes.forEach((b, i) => b.style.width = (widths[i] * 2) + 'px');
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Service worker — offline + cache
|
||||
```javascript
|
||||
// sw.js
|
||||
self.addEventListener('install', e => {
|
||||
e.waitUntil(caches.open('v1').then(c => c.addAll([
|
||||
'/', '/app.js', '/styles.css'
|
||||
])));
|
||||
});
|
||||
self.addEventListener('fetch', e => {
|
||||
e.respondWith(
|
||||
caches.match(e.request).then(r => r || fetch(e.request))
|
||||
);
|
||||
});
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### Intersection observer (lazy load)
|
||||
```javascript
|
||||
const io = new IntersectionObserver(entries => {
|
||||
for (const e of entries) {
|
||||
if (e.isIntersecting) {
|
||||
e.target.src = e.target.dataset.src;
|
||||
io.unobserve(e.target);
|
||||
}
|
||||
}
|
||||
}, { rootMargin: '200px' });
|
||||
document.querySelectorAll('img[data-src]').forEach(img => io.observe(img));
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### Web Workers — off-main-thread
|
||||
```javascript
|
||||
// main.js
|
||||
const w = new Worker('worker.js', { type: 'module' });
|
||||
w.postMessage({ buffer: bigArray }, [bigArray.buffer]); // transfer, not copy
|
||||
w.onmessage = e => console.log(e.data);
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
// worker.js
|
||||
onmessage = e => {
|
||||
const result = heavyCompute(e.data.buffer);
|
||||
postMessage(result);
|
||||
};
|
||||
```
|
||||
|
||||
### Performance API — measure real users
|
||||
```javascript
|
||||
new PerformanceObserver(list => {
|
||||
for (const entry of list.getEntries()) {
|
||||
if (entry.name === 'LCP') sendBeacon('lcp', entry.startTime);
|
||||
if (entry.entryType === 'layout-shift') sendBeacon('cls', entry.value);
|
||||
if (entry.entryType === 'event') sendBeacon('inp', entry.duration);
|
||||
}
|
||||
}).observe({ type: 'largest-contentful-paint', buffered: true });
|
||||
```
|
||||
|
||||
### CSP header
|
||||
```http
|
||||
Content-Security-Policy: default-src 'self'; script-src 'self' 'sha256-AbCd...';
|
||||
style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; frame-ancestors 'none';
|
||||
```
|
||||
|
||||
### WebGPU compute (modern)
|
||||
```javascript
|
||||
const adapter = await navigator.gpu.requestAdapter();
|
||||
const device = await adapter.requestDevice();
|
||||
const shader = device.createShaderModule({ code: `
|
||||
@group(0) @binding(0) var<storage, read_write> v: array<f32>;
|
||||
@compute @workgroup_size(64) fn main(@builtin(global_invocation_id) g: vec3u) {
|
||||
v[g.x] = v[g.x] * 2.0;
|
||||
}`});
|
||||
// ... pipeline + dispatch
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Hydration TTI 느림 | islands / partial hydration (Astro, Qwik) |
|
||||
| Heavy compute on UI thread | Web Worker / WebAssembly |
|
||||
| Repeated tiny renders | requestAnimationFrame batch |
|
||||
| Need GPU for ML inference | WebGPU + ONNX Runtime Web |
|
||||
| Cross-origin embed | iframe + CSP frame-ancestors |
|
||||
|
||||
**기본값**: HTTP/3 + service worker cache + defer non-critical JS + Web Vitals monitoring.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Web_Platform]] · [[Operating_System]]
|
||||
- 변형: [[Chromium]] · [[Gecko]] · [[WebKit]] · [[Servo]]
|
||||
- 응용: [[Single_Page_Application]] · [[PWA]] · [[Electron]]
|
||||
- Adjacent: [[V8]] · [[WebAssembly]] · [[WebGPU]] · [[Service_Worker]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: web perf 최적화, browser API 선택, rendering pipeline 디버깅.
|
||||
**언제 X**: server-side rendering 내부 (Node/Bun 영역).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **document.write**: 매 parser blocking — 절대 X.
|
||||
- **Synchronous XHR**: 매 main thread freeze — deprecated.
|
||||
- **Layout thrash loop**: 매 read-write 교차 → forced sync layouts.
|
||||
- **Massive bundle (>1MB JS)**: 매 mobile TTI 폭망 — code splitting 필수.
|
||||
- **Too many compositor layers**: 매 will-change 남발 → GPU memory exhaustion.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (web.dev/architecture, Chromium design docs 2024, V8 blog 2025).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — multi-process arch, rendering pipeline, modern web APIs |
|
||||
|
||||
Reference in New Issue
Block a user