Browse Source

fix css selector when stats bar is empty

Mike L 3 years ago
parent
commit
0e7d41dfc9
4 changed files with 4 additions and 2 deletions
  1. 0 0
      dist/utils.js.map
  2. 2 1
      dist/webshot.js
  3. 0 0
      dist/webshot.js.map
  4. 2 1
      src/webshot.ts

File diff suppressed because it is too large
+ 0 - 0
dist/utils.js.map


+ 2 - 1
dist/webshot.js

@@ -80,7 +80,8 @@ class Webshot extends CallableInstance {
                     })
                         .then(() => page.goto(url, { waitUntil: 'load', timeout: getTimeout() }))
                         .then(() => page.addStyleTag({
-                        content: 'header,#layers{display:none!important}[data-testid="caret"],[role="group"],[data-testid="tweet"]+*>:nth-last-child(2){display:none}',
+                        content: 'header,#layers{display:none!important}' +
+                            '[data-testid="caret"],[role="group"],[data-testid="tweet"]+*>[class*=" "]+div: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}',

File diff suppressed because it is too large
+ 0 - 0
dist/webshot.js.map


+ 2 - 1
src/webshot.ts

@@ -106,7 +106,8 @@ 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,#layers{display:none!important}[data-testid="caret"],[role="group"],[data-testid="tweet"]+*>:nth-last-child(2){display:none}',
+              content: 'header,#layers{display:none!important}' +
+                '[data-testid="caret"],[role="group"],[data-testid="tweet"]+*>[class*=" "]+div: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}',

Some files were not shown because too many files changed in this diff