|
@@ -106,7 +106,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
|
.then(() => page.goto(url, {waitUntil: 'load', timeout: getTimeout()}))
|
|
|
// hide header, "more options" button, like and retweet count
|
|
|
.then(() => page.addStyleTag({
|
|
|
- content: 'header{display:none!important}[data-testid="caret"],[data-testid="tweet"]+*>:nth-last-child(-n+2){display:none}',
|
|
|
+ content: 'header,#layers{display:none!important}[data-testid="caret"],[role="group"],[data-testid="tweet"]+*>:nth-last-child(2){display:none}',
|
|
|
}))
|
|
|
.then(() => page.addStyleTag({
|
|
|
content: '*{font-family:-apple-system,".Helvetica Neue DeskInterface",Hiragino Sans,Hiragino Sans GB,sans-serif!important}',
|
|
@@ -172,17 +172,12 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
|
const idx = (x: number, y: number) => (this.width * y + x) << 2;
|
|
|
let boundary: number = null;
|
|
|
const x = zoomFactor * 2;
|
|
|
- for (let y = 0; y < this.height; y += zoomFactor) {
|
|
|
+ for (let y = x; y < this.height; y += zoomFactor) {
|
|
|
if (
|
|
|
- this.data[idx(x, y)] !== 255 &&
|
|
|
+ this.data[idx(x, y)] !== this.data[idx(x, y - zoomFactor)] &&
|
|
|
this.data[idx(x, y)] === this.data[idx(x + zoomFactor * 10, y)]
|
|
|
) {
|
|
|
- if (this.data[idx(x, y + 18 * zoomFactor)] !== 255) {
|
|
|
- // footer kicks in
|
|
|
- boundary = null;
|
|
|
- } else {
|
|
|
- boundary = y;
|
|
|
- }
|
|
|
+ boundary = y;
|
|
|
break;
|
|
|
}
|
|
|
}
|