console
const iframe = document.querySelector('iframe');
// 等待加载完成再操作
iframe.onload = function(){
// iframe内部window对象
const innerWin = iframe.contentWindow;
// iframe内部document
const innerDoc = iframe.contentDocument || innerWin.document;
// 修改iframe内内容
innerDoc.body.style.background = '#f5f5f5';
};
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<!-- 移动端自适应 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>全屏Iframe</title>
<style>
/* 清除默认内外边距 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
overflow: hidden; /* 隐藏滚动条 */
}
/* iframe100%铺满 */
iframe {
width: 100%;
height: 100%;
border: none; /* 去掉默认边框 */
display: block;
}
</style>
</head>
<body>
<!-- 修改src为你需要嵌入的地址 -->
<iframe src="https://i3app.aisanwei.cn/fapi/#/giseditorapi?scene=resources://scenes/1c6818c187e9f802.scene"></iframe>
</body>
</html>