|
@@ -132,12 +132,22 @@ class Webshot extends CallableInstance<[LazyMediaItem[], (...args) => void, numb
|
|
// hide header, "more options" button, like and retweet count
|
|
// hide header, "more options" button, like and retweet count
|
|
.then(() => page.addStyleTag({content:
|
|
.then(() => page.addStyleTag({content:
|
|
'nav,footer,header+div,header+div+div>div>div+div,header div div div+div,' +
|
|
'nav,footer,header+div,header+div+div>div>div+div,header div div div+div,' +
|
|
- 'article section,article section+div>ul>:not(div),article section+div~div,article button,canvas{display:none!important} ' +
|
|
|
|
|
|
+ 'article section,article section+div>ul>:not(div),article button,canvas{display:none!important} ' +
|
|
'section+div{overflow:hidden} section+*>*{position:relative!important} article{border-bottom:1px solid!important}',
|
|
'section+div{overflow:hidden} section+*>*{position:relative!important} article{border-bottom:1px solid!important}',
|
|
}))
|
|
}))
|
|
.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}',
|
|
}))
|
|
}))
|
|
|
|
+ .then(() => page.evaluate(() => {
|
|
|
|
+ let time: HTMLTimeElement;
|
|
|
|
+ time = document.querySelector('div>div>time');
|
|
|
|
+ if (time) time.parentElement.parentElement.style.display = 'none';
|
|
|
|
+ time = document.querySelector('article section~div>a>time');
|
|
|
|
+ if (time) {
|
|
|
|
+ time.innerHTML = time.title + ' ' + new Date(time.dateTime).toLocaleTimeString().slice(0, -3);
|
|
|
|
+ time.parentElement.parentElement.style.margin = '-24px 0 12px';
|
|
|
|
+ }
|
|
|
|
+ }))
|
|
.then(() => page.screenshot())
|
|
.then(() => page.screenshot())
|
|
.then(screenshot => {
|
|
.then(screenshot => {
|
|
new PNG({
|
|
new PNG({
|