Kaynağa Gözat

fix not catching error from inside page.route()

Mike L 3 yıl önce
ebeveyn
işleme
5375ebc4ac
2 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 1 1
      dist/webshot.js
  2. 1 1
      src/webshot.ts

+ 1 - 1
dist/webshot.js

@@ -82,7 +82,7 @@ class Webshot extends CallableInstance {
                         width: width / zoomFactor,
                         height: height / zoomFactor,
                     })
-                        .then(() => page.route('*:\/\/video.twimg.com\/**', route => { route.abort(); }))
+                        .then(() => page.route('*:\/\/video.twimg.com\/**', route => route.abort()))
                         .then(goto)
                         .then(() => Promise.race([
                         page.waitForSelector('article', { state: 'attached', timeout: getTimeout() }),

+ 1 - 1
src/webshot.ts

@@ -106,7 +106,7 @@ class Webshot extends CallableInstance<[Tweet[], (...args) => void, number], Pro
             width: width / zoomFactor,
             height: height / zoomFactor,
           })
-            .then(() => page.route('*:\/\/video.twimg.com\/**', route => { route.abort(); }))
+            .then(() => page.route('*:\/\/video.twimg.com\/**', route => route.abort()))
             .then(goto)
             .then(() => Promise.race([
               page.waitForSelector('article', {state: 'attached', timeout: getTimeout()}),