The whole parent page of the iframe jump page in Wechat has also been redirected.

Wechat"s ios environment
an H5 web page is embedded with an iframe, to implement Wechat login without refresh, because Wechat will jump after login authorization, so put the official Wechat login page into an iframe. But I found that when the page in the iframe jumps, the whole page actually jumps, and according to reason, all the operations within the iframe are separate, should not affect the parent page, how to solve this problem?

Apr.05,2021

Wechat Development team: ha ha, small sample, dare to play tricks in front of me



written in vue on the web end
Why does Wechat only jump in iframe


this is really not good, I also have a return jump in iframe, which will refresh the parent page, but Android and chrome will not


.

there must be this code in Wechat's authorized web page:

if(top !== self){
top.location.href = location.href;
} 

this is to prevent iframe references.


have you solved it?

Menu