clipper(web): add fallback height & width for web clip(#3766)

This commit is contained in:
Muhammad Ali
2023-11-18 08:26:03 +05:00
committed by Ammar Ahmed
parent 3c876cb1d8
commit 3873758fe5
2 changed files with 12 additions and 3 deletions

View File

@@ -55,8 +55,16 @@ function attachMessagePort() {
message.area === "full-page" &&
(message.mode === "complete" || message.mode === "screenshot");
return {
height: sizeable ? document.body.clientHeight : 0,
width: sizeable ? document.body.clientWidth : 0,
height: sizeable
? document.body.clientHeight ||
document.firstElementChild?.scrollHeight ||
1080
: 0,
width: sizeable
? document.body.clientWidth ||
document.firstElementChild?.scrollWidth ||
1920
: 0,
data: await clip(request)
};
}

View File

@@ -25,7 +25,8 @@
"scripts": {
"build": "tsc && yarn webpack -c webpack.config.js",
"test": "playwright test",
"postinstall": "patch-package"
"postinstall": "patch-package",
"watch": "tsc --watch"
},
"bugs": {
"url": "https://github.com/streetwriters/notesnook/issues"