Build an onRequestChange listener that keeps a page's address equal to the inspector's request, writing through the history and location the host passes.
Each text the inspector reports, as formatAutoMovieInspectorAddress writes it, becomes the address's query: the path and the fragment are kept, the empty request clears the query, and history.replaceState writes it with the entry's own state, so editing the request adds no history entry. A text equal to the current query writes nothing. The library reaches no global: a host that passes no listener keeps its address untouched.
constonRequestChange = createAutoMovieInspectorAddressWriter({ location, history });
Build an
onRequestChangelistener that keeps a page's address equal to the inspector's request, writing through thehistoryandlocationthe host passes.Each text the inspector reports, as
formatAutoMovieInspectorAddresswrites it, becomes the address's query: the path and the fragment are kept, the empty request clears the query, andhistory.replaceStatewrites it with the entry's own state, so editing the request adds no history entry. A text equal to the current query writes nothing. The library reaches no global: a host that passes no listener keeps its address untouched.