there is an iframe, embedded in the current page. This page has a return function. When you click back, you find that the content in iframe has changed, and the current page has not returned. Look at the source code in iframe and find that it says:
var listenerBackHandler = {
param: {
isRun: false, //popstate
},
listenerBack: function () {
var state = {
title: "title",
url: "-sharp"
};
window.history.pushState(state, "title", "-sharp");
window.addEventListener("popstate", function (e) {
if (listenerBackHandler.param.isRun) {
window.location.href = setting.nextLink;
}
}, false);
},
//
initBack: function () {
window.addEventListener("pageshow", function () {
listenerBackHandler.param.isRun = false;
setTimeout(function () { listenerBackHandler.param.isRun = true; }, 1000); //1 popstate
listenerBackHandler.listenerBack();
});
}
}
listenerBackHandler.initBack();
some methods have also been checked on the Internet:
for example, restrictions such as sandbox, the new feature of h5, where you need to run his js script, so you can"t use it;
, for example, rewriting the window object in iframe has no effect. no, no, no.
for example, removing his event listener still has no effect.
find a solution.. Thank you!