|
@@ -138,6 +138,7 @@ enum ImageType {
|
|
|
type FuseImageRet = { type: ImageType, blob: Blob | null }
|
|
|
const getFuseImage = async (iframe: HTMLIFrameElement) => {
|
|
|
const iframeElement = iframe.contentWindow?.document.documentElement
|
|
|
+
|
|
|
if (!iframeElement) {
|
|
|
return null
|
|
|
}
|
|
@@ -147,7 +148,11 @@ const getFuseImage = async (iframe: HTMLIFrameElement) => {
|
|
|
const fuseCnavas = targetWindow.document.querySelector('.scene-canvas > canvas') as HTMLElement
|
|
|
|
|
|
if (fuseCnavas) {
|
|
|
- return domScreenshot(fuseCnavas).then(blob => ({ type: ImageType.FUSE, blob }))
|
|
|
+ const dataURL = await targetWindow.sdk.screenshot(540, 390)
|
|
|
+ const res = await fetch(dataURL)
|
|
|
+ const blob = await res.blob()
|
|
|
+ return { type: ImageType.FUSE, blob }
|
|
|
+ // return domScreenshot(fuseCnavas).then(blob => ({ type: ImageType.FUSE, blob }))
|
|
|
}
|
|
|
const isLaser = targetWindow.document.querySelector('.laser-layer')
|
|
|
|