Emulation
Glossary
Section titled “Glossary”- Captured Headers - Headers that are captured in the Header rewriter, before they are rewritten. These headers are then sent to the client, so that they can be used for emulation, since you can’t rewrite the origin to a proxified origin. Not all forms of emulation require this, sometimes you need to emulate in the SW as is the case with policies, such as cache and referrer. In rare cases, you can use client APIs in the sandboxer to emulate this behavior without needing knowledge of the existing policies set by the headers.
Types of Emulation
Section titled “Types of Emulation”Everything, which needs to be emulated includes: errors for all major browsers, Nested SWs, caching, and every security policy.
Referrer Policy Chain Tracking
Section titled “Referrer Policy Chain Tracking”History State Emulation
Section titled “History State Emulation”Error Emulation
Section titled “Error Emulation”The proxy can be revealed
Proxy Tags (Scramtags)
Section titled “Proxy Tags (Scramtags)”Sub-resource Integrity Emulation
Section titled “Sub-resource Integrity Emulation”This requires cooperation with the HTML rewriter or interceptor and the service worker.
Security Policy Emulation
Section titled “Security Policy Emulation”Many security policy emulation types depend on each other
Nested SW -> CSP emulation
-> - meaning depends on here
CORS Emulation
Section titled “CORS Emulation”Cache Emulation
Section titled “Cache Emulation”Nested SWs
Section titled “Nested SWs”This refers to an interception-focused method of emulation, where you:
- Create a fake API for the Navigator SW API
- Communicate with message listeners on the SW, which will bundle. By bundle I mean resolving the
importScripts
in classic scripts and ESM in module scripts.