Skip to content

Commit

Permalink
Make render function work on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
no-gravity authored Apr 15, 2024
1 parent ec47bf6 commit 5fcb695
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,18 @@
update();
}

async function render() {
function render() {
outWin= window.open()
outWin.focus();
_render(outWin);
}

async function _render(outWin) {
let inny=document.querySelector("iframe").contentDocument.body;
let dataUrl = await domtoimage.toPng(inny);
let w = window.open();
w.location.href=dataUrl;
let img = document.createElement('img');
img.src = dataUrl;
outWin.document.body.appendChild(img);
}

dataArea=document.getElementById("data");
Expand Down

0 comments on commit 5fcb695

Please sign in to comment.