const state = { page_id: 1, user_id: 5 };
const url = "hello-world.html";
history.pushState(state, "", url);History: pushState() method / notebook
History: pushState() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const url = new URL(location);
url.searchParams.set("foo", "bar");
history.pushState({}, "", url);