--- id: web-origin-trial-platform title: Origin Trials / Platform APIs — modern browser category: Coding status: draft source_trust_level: B verification_status: conceptual created_at: 2026-05-09 updated_at: 2026-05-09 tags: [web, browser, vibe-coding] tech_stack: { language: "TS", applicable_to: ["Frontend"] } applied_in: [] aliases: [origin trial, Chrome flags, platform API, Web Bundles, FedCM, Topics API, Storage Buckets] --- # Origin Trials / Modern Platform APIs > Browser 의 새 API 가 origin trial 식 (early access). **FedCM, Topics, Storage Buckets, Compute Pressure, Document PIP**. ## 📖 핵심 개념 - Origin trial: 6 month-1 year, opt-in. - Token 가 specific origin 만. - Browser flag: 개발자 전용. - 진짜 launch 가 모든 user. ## 💻 코드 패턴 ### Origin trial 등록 ```html Origin-Trial: YOUR_TOKEN_HERE ``` → Chrome / Edge developer site 가 token 발급. ### FedCM (Federated Credential Management) ```ts // Sign in with Google (modern) const credential = await navigator.credentials.get({ identity: { providers: [{ configURL: 'https://accounts.google.com/gsi/fedcm.json', clientId: 'YOUR_CLIENT_ID', }], }, }) as IdentityCredential; const token = credential.token; ``` → 3rd-party cookie 종료 의 답. ### Topics API (privacy ad) ```ts // Browser 가 user 의 interest topic 자동 추론. const topics = await document.browsingTopics(); // → ['/Sports/Soccer', '/News/Politics'] ``` → 3rd-party cookie 의 ad alternative. ETP / Privacy Sandbox. ### Storage Buckets ```ts // 기존: localStorage / IndexedDB 가 1 origin 의 1 storage. // 새: 매 bucket 의 own quota / persistence. const bucket = await navigator.storageBuckets.open('user-data', { durability: 'strict', persisted: true, }); const idb = bucket.indexedDB; const cache = await bucket.caches.open('v1'); ``` → Per-feature storage. Eviction 따로. ### Compute Pressure ```ts const observer = new PressureObserver((records) => { for (const r of records) { console.log(r.source, r.state); // 'cpu', 'nominal' / 'fair' / 'serious' / 'critical' } }); await observer.observe('cpu', { sampleInterval: 1000 }); ``` → "User 가 CPU 가 hot" → quality ↓. Video call / game 친화. ### Document Picture-in-Picture ```ts const pipWindow = await documentPictureInPicture.requestWindow({ width: 400, height: 300, }); pipWindow.document.body.appendChild(myElement); ``` → HTML 가 PIP. Video 만 X (전 element). Video call, music player. ### Web Bundles (resource bundle) ```html ``` → 1 file 가 multiple resource. Subresource cache 친화. ### Speculation rules (preload navigation) ```html ``` → Anchor hover 시 prerender. Click = instant. ### Anchor positioning (CSS) ```css .tooltip { position: absolute; position-anchor: --my-button; top: anchor(bottom); left: anchor(center); } #my-button { anchor-name: --my-button; } ``` → Floating UI 의 native (Chrome 125+). ### View timeline (scroll animation) ```css @keyframes fade-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .fade { animation: fade-in linear; animation-timeline: view(); animation-range: entry 0% cover 50%; } ``` → Scroll 위치 따라 animation. JS 없음. ### Container queries (modern) ```css .card { container-type: inline-size; container-name: card; } @container card (min-width: 400px) { .title { font-size: 2rem; } } ``` → Media query 가 container 의 size. ### View Transitions (cross-doc, MPA) ```html ``` ```css @view-transition { navigation: auto; } ``` → MPA 가 SPA 같은 transition. → [[Web_View_Transitions_Cross_Doc]]. ### CSS @scope ```css @scope (.card) to (.children) { h2 { color: blue; } } ``` → CSS-in-JS 의 native alternative. ### CSS nesting ```css .card { padding: 16px; & h2 { font-size: 1.5rem; } &:hover { background: #eee; } } ``` → Sass 비슷, native. ### Popover API ```html