Initialization sequence
- Read
document.currentScript, resolve the workspace runtime base and installwindow.dynamite. - Drain queued commands.
trackcalls may wait for a visitor runtime; the queue is bounded at 50 pending track commands. - Wait for
DOMContentLoadedif necessary. - Skip live initialization if an extension preview is taking ownership, a visitor runtime already exists, consent is denied, or required consent is absent.
- Request
GET /site?features=editorial-v3&path=…, with omitted credentials and a 1,800 ms fetch timeout. - Require the response’s origin to equal
location.originand its mode to belive. - Install visitor storage, activity observers, target adapters, navigation hooks, measurement and optional enrichment.
- Flush queued tracking and report the installation path and revision to
/installed.
Requests you will see
The installer uses JSON bodies with a CORS-safelisted
text/plain;charset=UTF-8 content type for public posts. Requests omit cookies/credentials to Dynamite. The runtime validates the site’s exact origin; a copied snippet on another origin does not grant access.
Page lifecycle and stability
On a registered path, the runtime binds only targets whose selector resolves to one element. It records the registered page/product view, determines experiment membership, checks eligibility, and requests a decision when there is a choice to make. The current automatic browser budget is 1,800 ms from navigation start, including time before the decision request. Loading the script late can consume that budget. For SPA navigations the clock starts at the route change. The normal server decision budget is 1,500 ms. These are cutoffs, not expected latency. Live automatic changes stop when the visitor has already interacted on that path. A receipt arriving after navigation, a visitor reset, the deadline, or an interaction is not applied. Native ordering and editorial placements have additional visibility/focus guards. Behavior normally informs the next navigation or an explicit internal refresh. A new click is not an instruction to repeatedly repaint the current page. Connected enrichment completion updates context but does not automatically rerun the current decision.Navigation and teardown
The runtime observespushState, replaceState, popstate, back/forward cache restoration and path changes. It schedules route binding on the next animation frame; a 250 ms path check supports isolated extension contexts. Matching uses location.pathname, not a generic URL rule engine. Ordinary pages must be explicitly registered; editorial templates have their own resolver.
On navigation, old requests are canceled and old bindings restored/destroyed. On teardown, listeners, observers, styles and tracking are removed and original content restored. There is no general mutation-observer adapter that waits indefinitely for arbitrary framework hydration.
Caching and updates
An already-open page retains its installed runtime and configuration. Publishing, pausing or rolling back is not a push update to every open tab. Reload/navigate and verify the returned revision. Keep APIs compatible with cached scripts.
Content Security Policy
Permit the actual script origin in your site’sscript-src, the API origin in connect-src, and approved image origins in img-src. Component styling includes injected/inline CSS; check your existing style-src policy against the runtime. Do not weaken a restrictive policy without review; this build has no general merchant nonce configuration. Use the browser console and Network panel to identify blocked resources.
Source: installer, runtime, navigation, runtime routes.