Преглед изворни кода

hide newly introduced highlight of retweet header

Mike L пре 3 година
родитељ
комит
6b3768519a
2 измењених фајлова са 3 додато и 0 уклоњено
  1. 1 0
      dist/webshot.js
  2. 2 0
      src/webshot.ts

+ 1 - 0
dist/webshot.js

@@ -155,6 +155,7 @@ class Webshot extends CallableInstance {
                     })
                         .then(() => utils_1.chainPromises(morePostProcessings.map(func => () => func(page))))
                         .then(() => util_1.promisify(setTimeout)(getTimeout()))
+                        .then(() => page.evaluate(() => document.activeElement.blur()))
                         .then(() => page.screenshot())
                         .then(screenshot => {
                         new pngjs_1.PNG({

+ 2 - 0
src/webshot.ts

@@ -183,6 +183,8 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
             })
             .then(() => chainPromises(morePostProcessings.map(func => () => func(page))))
             .then(() => promisify(setTimeout)(getTimeout()))
+            // hide highlight of retweet header
+            .then(() => page.evaluate(() => (document.activeElement as unknown as HTMLOrSVGElement).blur()))
             .then(() => page.screenshot())
             .then(screenshot => {
               new PNG({