Skip to content

Commit

Permalink
Comment out Puppeteer 1.8.0 breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterchan committed Sep 10, 2018
1 parent a74c874 commit bc47118
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ const fetchContent = async (pageURL) => {
// Ensure that only whitelisted URLs and GET method is allowed
if (!whitelistRegExp.test(url) || method.toLowerCase() !== 'get' || /^(font|media|websocket|manifest)$/i.test(resourceType)) {
request.abort();
/* Puppeteer 1.8.0 breaks this
} else if (resourceType.toLowerCase() === 'image') {
request.continue({
url: 'data:image/gif;base64,R0lGODlhAQABAID/AP///wAAACwAAAAAAQABAAACAkQBADs=',
});
*/
} else {
request.continue();
}
Expand Down Expand Up @@ -263,7 +265,7 @@ require('http').createServer(async (req, res) => {
res.end(`Oops. Something is wrong.\n\n${message}`);

// Handle websocket not opened error
if (/not opened/i.test(message) && browser) {
if (/not open/i.test(message) && browser) {
console.error('Web socket failed');
try {
// Sometimes it tries to close an already closed browser
Expand Down

0 comments on commit bc47118

Please sign in to comment.