Like the title, for example, if my page wants to embed baidu.com, is there any other way besides using iframe tags?
Origin of the problem: My project is nested in the android webview, but when I embed sina.com, qq.com, etc.; the webview will be forcibly occupied by these webpages.
Screenshots are as follows:
①Normal situation:
②Occupied status:
③Supplement:
var iframe = '<p style="width: 100%; height: 100%;position:relative;"> <iframe src="' + this.data.itemData.url + '" style="width: 100%; height: 100%;" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" border="0" frameborder="0">如果长时间未加载,请检查网络状况或网址!</iframe><p' + '>';
$this.appDom.html(iframe);
The reason has been found: As the respondent said, "There are many websites that don't like to be iframed and will use various means to jump out.", such as the code of a news website
<!-- 反运营商劫持 S -->
<style type="text/css">
html {
display:none;
}
</style>
<script>
if( self == top ) {
document.documentElement.style.display = 'block' ;
} else {
top.location = self.location ;
}
</script>
The solution has not been found yet
Open webview on Android can be plural, communicate with the App to see.