The execution of location.reload after history.replaceState replacement still produces a history.

< H1 > go straight to the code description < / H1 > < H2 > before refresh < / H2 >
console.log(history.length);  // :1

history.replaceState(null,null,"?a=1"); //  ?b=1

location.reload();
< H2 > after refresh < / H2 >
console.log(history.length); // :2

Test environment: android8.0.0 WKWebview kernel is chrome

there is no problem under the ios environment. Do you want to know if there is a separate processing or convention for android? Ask for the guidance of the Great God

Mar.23,2021

your code should be inaccurate and failed to reproduce the problem

Menu