Chrome onpopstate / pushState bug?

前端 未结 2 1385
你的背包
你的背包 2021-01-05 09:18

First of all I\'m not entirely sure what I\'m doing or expecting is right. There doesn\'t seem to be much documentation about this, but what I\'ve read suggests that this sh

2条回答
  •  梦毁少年i
    2021-01-05 09:53

    if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1 !== true) {
        runpopState();
    }
    
    function runpopState() {
        alert("POP STATE");
    }
    
    window.onpopstate = function () {
        runpopState();
    };
    

    Until they fix the bug, a solution like this will suffice.

提交回复
热议问题