|
@@ -112,7 +112,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
// hide header, "more options" button, like and retweet count
|
|
// hide header, "more options" button, like and retweet count
|
|
.then(() => page.addStyleTag({
|
|
.then(() => page.addStyleTag({
|
|
content: 'header,#layers{display:none!important}article{background-color:transparent!important}' +
|
|
content: 'header,#layers{display:none!important}article{background-color:transparent!important}' +
|
|
- '[data-testid="caret"],[role="group"],[data-testid="tweet"]+*>[class*=" "]+div:nth-last-child(2){display:none}',
|
|
|
|
|
|
+ '[data-testid="caret"],[role="group"],[data-testid="tweet"] [class*=" "]+:last-child>*+[class*=" "]~div{display:none}',
|
|
}))
|
|
}))
|
|
.then(() => page.addStyleTag({
|
|
.then(() => page.addStyleTag({
|
|
content: '*{font-family:-apple-system,".Helvetica Neue DeskInterface",Hiragino Sans,Hiragino Sans GB,sans-serif!important}',
|
|
content: '*{font-family:-apple-system,".Helvetica Neue DeskInterface",Hiragino Sans,Hiragino Sans GB,sans-serif!important}',
|
|
@@ -151,7 +151,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
if (handle === null) throw new puppeteer.errors.TimeoutError();
|
|
if (handle === null) throw new puppeteer.errors.TimeoutError();
|
|
return handle.evaluate(div => {
|
|
return handle.evaluate(div => {
|
|
try {
|
|
try {
|
|
- const selector = '[data-testid="tweet"]>:nth-child(2)>:first-child a';
|
|
|
|
|
|
+ const selector = '[data-testid="tweet"] :nth-child(2)>:first-child a';
|
|
const getProfileUrl = () => (div.querySelector<HTMLAnchorElement>(selector) || {href: ''}).href;
|
|
const getProfileUrl = () => (div.querySelector<HTMLAnchorElement>(selector) || {href: ''}).href;
|
|
const ownerProfileUrl = getProfileUrl();
|
|
const ownerProfileUrl = getProfileUrl();
|
|
// eslint-disable-next-line no-cond-assign
|
|
// eslint-disable-next-line no-cond-assign
|