|
@@ -1861,6 +1861,7 @@ const handleHomeworkSubmit = async () => {
|
|
|
const screenSlides = document.querySelectorAll('.viewer-canvas .screen-slide')
|
|
const screenSlides = document.querySelectorAll('.viewer-canvas .screen-slide')
|
|
|
let iframeElement: HTMLIFrameElement | null = null
|
|
let iframeElement: HTMLIFrameElement | null = null
|
|
|
let iframeBody: HTMLElement | null = null
|
|
let iframeBody: HTMLElement | null = null
|
|
|
|
|
+ let iframehtml: HTMLElement | null = null
|
|
|
|
|
|
|
|
// 获取iframe元素
|
|
// 获取iframe元素
|
|
|
if (
|
|
if (
|
|
@@ -1897,6 +1898,7 @@ const handleHomeworkSubmit = async () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
iframeBody = iframeElement.contentWindow.document.body as HTMLElement
|
|
iframeBody = iframeElement.contentWindow.document.body as HTMLElement
|
|
|
|
|
+ iframehtml = iframeElement.contentWindow.document.getElementsByTagName("html")[0] as HTMLElement
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
message.error(lang.ssFailedGetIframeBody)
|
|
message.error(lang.ssFailedGetIframeBody)
|
|
@@ -1906,8 +1908,8 @@ const handleHomeworkSubmit = async () => {
|
|
|
try {
|
|
try {
|
|
|
const a = iframeBody.getElementsByTagName('img')
|
|
const a = iframeBody.getElementsByTagName('img')
|
|
|
const b = iframeBody.getElementsByTagName('video')
|
|
const b = iframeBody.getElementsByTagName('video')
|
|
|
- iframeBody.style.width = '100vw'
|
|
|
|
|
- iframeBody.style.height = '100vh'
|
|
|
|
|
|
|
+ iframeBody.style.cssText += 'width:100%;height:100%;position:absolute;top:0;left:0;'
|
|
|
|
|
+ iframehtml.style.cssText += 'width:100%;height:100%;position:absolute;top:0;left:0;'
|
|
|
for (let i = 0;i < a.length;i++) {
|
|
for (let i = 0;i < a.length;i++) {
|
|
|
a[i].crossOrigin = 'anonymous'
|
|
a[i].crossOrigin = 'anonymous'
|
|
|
}
|
|
}
|