Skip to content

Commit

Permalink
Fix get image
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkdream committed Jul 21, 2023
1 parent be3c643 commit e411f76
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions weread_exporter/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,25 @@ let canvasContextHandler = {
}
that.data.markdown += args[0];
that.data.lastPos = [args[1], args[2]];
} else if (name == "drawImage") {

} else if (name === "restore") {
scrollTo(0, document.body.scrollHeight);
if (that.data.highlightMode) {
that.data.markdown += "`";
that.data.highlightMode = false;
}
that.checkElement(that.data.lastPos[1], that.data.lastPos[1] + 200);
setTimeout(function () {
let imgList = getImgElemList();
if (imgList.length > that.data.imgList.length) {
console.log("Found new images", that.data.imgList.length, "=>", imgList.length);
for (let i = that.data.imgList.length; i < imgList.length; i++) {
that.data.markdown += "\n\n![](" + imgList[i][2] + ")\n";
}
}
}, 1000);

} else if (name === "clearRect") {
that.clearCanvasCache();
} else {
Expand Down

0 comments on commit e411f76

Please sign in to comment.