diff --git a/lib/css.js b/lib/css.js index bdcbe3e..821a36d 100644 --- a/lib/css.js +++ b/lib/css.js @@ -15,7 +15,19 @@ const callbacks = (elementString, cssText, options = {}) => { } const css = async ($, options) => { - const styleSheetElements = $('link[rel="stylesheet"]') + const styleSheetElements = $('link[rel="stylesheet"]').filter(function () { + const href = $(this).attr('href') + const whitelist = [ + 'cloud.typography.com', + 'fast.fonts.net', + 'fonts.googleapis.com', + 'use.typekit.net', + 'maxcdn.bootstrapcdn.com', + 'use.fontawesome.com', + ] + + !whitelist.find((url) => href.includes(url)) + }) const styleElements = $('style') const urlElms = Array.from(styleSheetElements).map((node, i) => { const $element = cheerio.load(node)