diff --git a/README.md b/README.md
index 69ab92a2..b86e0688 100644
--- a/README.md
+++ b/README.md
@@ -179,6 +179,7 @@ key is `urls`. Other optional options are:
* `timeout` - Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout.
* `ignoreCSSErrors` - By default, any CSS parsing error throws an error in `minimalcss`. If you know it's safe to ignore (for example, third-party CSS resources), set this to `true`.
* `ignoreJSErrors` - By default, any JavaScript error encountered by puppeteer
+* `ignoreRequestErrors` - When CSS files return 404 or another request error `minimalcss` will ignore this instead of throwing an error.
will be thrown by `minimalcss`. If you know it's safe to ignore errors (for example, on
third-party webpages), set this to `true`.
* `styletags` - If set to `true`, on-page `` tags are parsed along with external stylesheets. By default, only external stylesheets are parsed.
diff --git a/src/run.js b/src/run.js
index 196a098a..ccf4556b 100644
--- a/src/run.js
+++ b/src/run.js
@@ -244,9 +244,13 @@ const processPage = ({
const responseUrl = response.url();
const resourceType = response.request().resourceType();
if (response.status() >= 400) {
- return safeReject(
- new Error(`${response.status()} on ${responseUrl}`)
- );
+ if (options.ignoreRequestErrors) {
+ skippedUrls.add(responseUrl);
+ } else {
+ return safeReject(
+ new Error(`${response.status()} on ${responseUrl}`)
+ );
+ }
} else if (response.status() >= 300 && response.status() !== 304) {
// If the 'Location' header points to a relative URL,
// convert it to an absolute URL.
@@ -405,7 +409,7 @@ const processPage = ({
/**
*
- * @param {{ urls: Array