1 line
27 KiB
Plaintext
1 line
27 KiB
Plaintext
{"version":3,"file":"get-css-data.min.js","sources":["../src/get-urls.js","../src/get-css.js"],"sourcesContent":["/*global XDomainRequest*/\n\n// Functions\n// =============================================================================\n/**\n * Requests one-or-more URLs and returns array of data in order specified.\n * Provides callbacks error and success callbacks for each XMLHttpRequest.\n *\n * @param {array|string} url Single URL or array of URLs to request\n * @param {object} [options] Options object\n * @param {string} [options.mimeType] Overrides MIME type returned by\n * server\n * @param {function} [options.onBeforeSend] Callback before each request is\n * sent. Passes 1) the xhr object, 2) the URL, and 3) the\n * URL index as arguments.\n * @param {function} [options.onSuccess] Callback on xhr success. Passes 1)\n * xhr response text, 2) the URL, and 3) the URL index as\n * arguments.\n * @param {function} [options.onError] Callback on xhr error. Passes 1) the\n * xhr object, 2) the URL, 3) the URL index as arguments.\n * @param {function} [options.onComplete] Callback after all requests have\n * completed. Passes 1) an array of response text for each\n * URL in order provided as an argument.\n */\nfunction getUrls(urls, options = {}) {\n const settings = {\n mimeType : options.mimeType || null,\n onBeforeSend: options.onBeforeSend || Function.prototype,\n onSuccess : options.onSuccess || Function.prototype,\n onError : options.onError || Function.prototype,\n onComplete : options.onComplete || Function.prototype\n };\n const urlArray = Array.isArray(urls) ? urls : [urls];\n const urlQueue = Array.apply(null, Array(urlArray.length)).map(x => null);\n\n // Functions (Private)\n // -------------------------------------------------------------------------\n function isValidCss(text) {\n const isString = typeof text === 'string';\n const isHTML = isString && text.trim().charAt(0) === '<';\n\n return isString && !isHTML;\n }\n\n function onError(xhr, urlIndex) {\n settings.onError(xhr, urlArray[urlIndex], urlIndex);\n }\n\n function onSuccess(responseText, urlIndex) {\n const returnVal = settings.onSuccess(responseText, urlArray[urlIndex], urlIndex);\n\n responseText = returnVal === false ? '' : returnVal || responseText;\n urlQueue[urlIndex] = responseText;\n\n // Complete\n if (urlQueue.indexOf(null) === -1) {\n settings.onComplete(urlQueue);\n }\n }\n\n // Main\n // -------------------------------------------------------------------------\n const parser = document.createElement('a');\n\n urlArray.forEach((url, i) => {\n parser.setAttribute('href', url);\n parser.href = String(parser.href);\n\n const isIElte9 = Boolean(document.all && !window.atob);\n const isIElte9CORS = isIElte9 && parser.host.split(':')[0] !== location.host.split(':')[0];\n\n // IE 9 CORS\n if (isIElte9CORS) {\n const isSameProtocol = parser.protocol === location.protocol;\n\n if (isSameProtocol) {\n const xdr = new XDomainRequest();\n\n // Event handlers must be assigned AFTER xdr.open\n xdr.open('GET', url);\n\n xdr.timeout = 0; // Prevent aborts/timeouts\n xdr.onprogress = Function.prototype; // Prevent aborts/timeouts\n xdr.ontimeout = Function.prototype; // Prevent aborts/timeouts\n xdr.onload = function() {\n const text = xdr.responseText;\n\n if (isValidCss(text)) {\n onSuccess(text, i);\n }\n else {\n onError(xdr, i);\n }\n };\n xdr.onerror = function(err) {\n onError(xdr, i);\n };\n\n // Wrap in setTimeout to fix known issues with XDomainRequest\n // when sending multiple requests\n setTimeout(function() {\n xdr.send();\n }, 0);\n }\n else {\n // eslint-disable-next-line\n console.warn(`Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (${url})`);\n onError(null, i);\n }\n }\n // Other\n else {\n const xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n\n // overrideMimeType method not available in all browsers\n if (settings.mimeType && xhr.overrideMimeType) {\n xhr.overrideMimeType(settings.mimeType);\n }\n\n settings.onBeforeSend(xhr, url, i);\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n const text = xhr.responseText;\n\n // Success\n if (xhr.status < 400 && isValidCss(text)) {\n onSuccess(text, i);\n }\n // Success via file protocol (file://)\n else if (xhr.status === 0 && isValidCss(text)) {\n onSuccess(text, i);\n }\n // Error\n else {\n onError(xhr, i);\n }\n }\n };\n\n xhr.send();\n }\n });\n}\n\n\n// Export\n// =============================================================================\nexport default getUrls;\n","// Dependencies\n// =============================================================================\nimport getUrls from './get-urls';\n\n\n// Functions (Public)\n// =============================================================================\n/**\n * Gets CSS data from <style> and <link> nodes (including @imports), then\n * returns data in order processed by DOM. Allows specifying nodes to\n * include/exclude and filtering CSS data using RegEx.\n *\n * @preserve\n * @param {object} [options] The options object\n * @param {object} [options.rootElement=document] Root element to traverse for\n * <link> and <style> nodes.\n * @param {string} [options.include] CSS selector matching <link> and <style>\n * nodes to include\n * @param {string} [options.exclude] CSS selector matching <link> and <style>\n * nodes to exclude\n * @param {object} [options.filter] Regular expression used to filter node CSS\n * data. Each block of CSS data is tested against the filter,\n * and only matching data is included.\n * @param {boolean} [options.skipDisabled=true] Determines if disabled\n * stylesheets will be skipped while collecting CSS data.\n * @param {boolean} [options.useCSSOM=false] Determines if CSS data will be\n * collected from a stylesheet's runtime values instead of its\n * text content. This is required to get accurate CSS data\n * when a stylesheet has been modified using the deleteRule()\n * or insertRule() methods because these modifications will\n * not be reflected in the stylesheet's text content.\n * @param {function} [options.onBeforeSend] Callback before XHR is sent. Passes\n * 1) the XHR object, 2) source node reference, and 3) the\n * source URL as arguments.\n * @param {function} [options.onSuccess] Callback on each CSS node read. Passes\n * 1) CSS text, 2) source node reference, and 3) the source\n * URL as arguments.\n * @param {function} [options.onError] Callback on each error. Passes 1) the XHR\n * object for inspection, 2) soure node reference, and 3) the\n * source URL that failed (either a <link> href or an @import)\n * as arguments\n * @param {function} [options.onComplete] Callback after all nodes have been\n * processed. Passes 1) concatenated CSS text, 2) an array of\n * CSS text in DOM order, and 3) an array of nodes in DOM\n * order as arguments.\n *\n * @example\n *\n * getCssData({\n * rootElement : document,\n * include : 'style,link[rel=\"stylesheet\"]',\n * exclude : '[href=\"skip.css\"]',\n * filter : /red/,\n * skipDisabled: true,\n * useCSSOM : false,\n * onBeforeSend(xhr, node, url) {\n * // ...\n * }\n * onSuccess(cssText, node, url) {\n * // ...\n * }\n * onError(xhr, node, url) {\n * // ...\n * },\n * onComplete(cssText, cssArray, nodeArray) {\n * // ...\n * }\n * });\n */\nfunction getCssData(options) {\n const regex = {\n // CSS comments\n cssComments: /\\/\\*[\\s\\S]+?\\*\\//g,\n // CSS @import rules ($1: url)\n cssImports : /(?:@import\\s*)(?:url\\(\\s*)?(?:['\"])([^'\"]*)(?:['\"])(?:\\s*\\))?(?:[^;]*;)/g\n };\n const settings = {\n rootElement : options.rootElement || document,\n include : options.include || 'style,link[rel=\"stylesheet\"]',\n exclude : options.exclude || null,\n filter : options.filter || null,\n skipDisabled: options.skipDisabled !== false,\n useCSSOM : options.useCSSOM || false,\n onBeforeSend: options.onBeforeSend || Function.prototype,\n onSuccess : options.onSuccess || Function.prototype,\n onError : options.onError || Function.prototype,\n onComplete : options.onComplete || Function.prototype\n };\n const sourceNodes = Array.apply(null, settings.rootElement.querySelectorAll(settings.include)).filter(node => !matchesSelector(node, settings.exclude));\n const cssArray = Array.apply(null, Array(sourceNodes.length)).map(x => null);\n\n /**\n * Handles the onComplete() callback after verifying that all CSS has been\n * processed.\n */\n function handleComplete() {\n const isComplete = cssArray.indexOf(null) === -1;\n\n if (isComplete) {\n // Remove skipped nodes/css\n cssArray\n .reduce((skipIndices, value, i) => {\n if (value === '') {\n skipIndices.push(i);\n }\n\n return skipIndices;\n }, [])\n .reverse()\n .forEach(skipIndex => [sourceNodes, cssArray].forEach(arr => arr.splice(skipIndex, 1)));\n\n const cssText = cssArray.join('');\n\n settings.onComplete(cssText, cssArray, sourceNodes);\n }\n }\n\n /**\n * Processes CSS text, updates cssArray, and triggers handleComplete()\n * 1. Passes CSS to resolveImports\n * 2. Triggers onError() callback for each @import error\n * 3. Tests resolved CSS against (optional) RegEx filter\n * 4. Triggers onSuccess() callback and accepts modified cssText as return\n * 5. Inserts final CSS into cssArray\n * 6. Triggers handleComplete() after processing is complete\n *\n * @param {string} cssText CSS text to be processed\n * @param {number} cssIndex cssArray index to store final CSS\n * @param {object} node CSS source <link> or <style> node\n * @param {string} sourceUrl The URL containing the source node\n */\n function handleSuccess(cssText, cssIndex, node, sourceUrl) {\n const returnVal = settings.onSuccess(cssText, node, sourceUrl);\n\n cssText = returnVal !== undefined && Boolean(returnVal) === false ? '' : returnVal || cssText;\n\n resolveImports(cssText, node, sourceUrl, function(resolvedCssText, errorData) {\n if (cssArray[cssIndex] === null) {\n // Trigger onError for each error item\n errorData.forEach(data => settings.onError(data.xhr, node, data.url));\n\n // Filter: Pass\n if (!settings.filter || settings.filter.test(resolvedCssText)) {\n cssArray[cssIndex] = resolvedCssText;\n }\n // Filter: Fail\n else {\n cssArray[cssIndex] = '';\n }\n\n handleComplete();\n }\n });\n }\n\n /**\n * Parses CSS and returns an object containing @import related data.\n *\n * @param {any} cssText CSS text to be processed\n * @param {any} baseUrl Base URL used to resolve relative @import URLs\n * @param {any} [ignoreRules=[]]\n * @returns {object}\n */\n function parseImportData(cssText, baseUrl, ignoreRules = []) {\n const importData = {};\n\n // @import rules\n // Ex: @import \"file.css\";\n importData.rules = (cssText\n // Remove comments to avoid processing @import in comments\n .replace(regex.cssComments, '')\n // Find all @import rules\n .match(regex.cssImports)\n // Force empty array if no match\n || [])\n // Remove rules found in ignoreRules array\n .filter(rule => ignoreRules.indexOf(rule) === -1);\n\n // @import urls\n // Ex: file.css\n importData.urls = importData.rules.map(rule => rule.replace(regex.cssImports, '$1'));\n\n // Absolute @import urls\n // Ex: /path/to/file.css\n importData.absoluteUrls = importData.urls.map(url => getFullUrl(url, baseUrl));\n\n // Absolute @import rules\n // Ex: @import \"/path/to/file.css\";\n importData.absoluteRules = importData.rules.map((rule, i) => {\n const oldUrl = importData.urls[i];\n const newUrl = getFullUrl(importData.absoluteUrls[i], baseUrl);\n\n return rule.replace(oldUrl, newUrl);\n });\n\n return importData;\n }\n\n /**\n * Recursively parses CSS for @import rules, fetches data for each import\n * URL, replaces the @rule the fetched data, then returns the resolved CSS\n * via a callback function.\n *\n * @param {string} cssText CSS text to be processed\n * @param {object} node CSS source <link> or <style> node\n * @param {string} baseUrl Base URL used to resolve relative @import URLs\n * @param {function} callbackFn Callback function to trigger on complete.\n * Passes 1) the resolves CSS and 2) an array of error\n * objects as arguments.\n */\n function resolveImports(cssText, node, baseUrl, callbackFn, __errorData = [], __errorRules = []) {\n const importData = parseImportData(cssText, baseUrl, __errorRules);\n\n // Has @imports\n if (importData.rules.length) {\n getUrls(importData.absoluteUrls, {\n onBeforeSend(xhr, url, urlIndex) {\n settings.onBeforeSend(xhr, node, url);\n },\n onSuccess(cssText, url, urlIndex) {\n const returnVal = settings.onSuccess(cssText, node, url);\n\n cssText = returnVal === false ? '' : returnVal || cssText;\n\n const responseImportData = parseImportData(cssText, url, __errorRules);\n\n // Replace relative @import rules with absolute rules\n responseImportData.rules.forEach((rule, i) => {\n cssText = cssText.replace(rule, responseImportData.absoluteRules[i]);\n });\n\n return cssText;\n },\n onError(xhr, url, urlIndex) {\n __errorData.push({ xhr, url });\n __errorRules.push(importData.rules[urlIndex]);\n\n resolveImports(cssText, node, baseUrl, callbackFn, __errorData, __errorRules);\n },\n onComplete(responseArray) {\n responseArray.forEach((importText, i) => {\n cssText = cssText.replace(importData.rules[i], importText);\n });\n\n resolveImports(cssText, node, baseUrl, callbackFn, __errorData, __errorRules);\n }\n });\n }\n // No @imports\n else {\n callbackFn(cssText, __errorData);\n }\n }\n\n // Main\n // -------------------------------------------------------------------------\n if (sourceNodes.length) {\n sourceNodes.forEach((node, i) => {\n const linkHref = node.getAttribute('href');\n const linkRel = node.getAttribute('rel');\n const isLink = node.nodeName.toLowerCase() === 'link' && linkHref && linkRel && linkRel.toLowerCase().indexOf('stylesheet') !== -1;\n const isSkip = settings.skipDisabled === false ? false : node.disabled;\n const isStyle = node.nodeName.toLowerCase() === 'style';\n\n if (isLink && !isSkip) {\n const isURIScheme = linkHref.indexOf('data:text/css') !== -1;\n\n if (isURIScheme) {\n let cssText = decodeURIComponent(linkHref.substring(linkHref.indexOf(',') + 1));\n\n if (settings.useCSSOM) {\n cssText = Array.apply(null, node.sheet.cssRules)\n .map(rule => rule.cssText)\n .join('');\n }\n \n handleSuccess(cssText, i, node, location.href);\n } else {\n getUrls(linkHref, {\n mimeType: 'text/css',\n onBeforeSend(xhr, url, urlIndex) {\n settings.onBeforeSend(xhr, node, url);\n },\n onSuccess(cssText, url, urlIndex) {\n // Convert relative linkHref to absolute url\n const sourceUrl = getFullUrl(linkHref);\n \n handleSuccess(cssText, i, node, sourceUrl);\n },\n onError(xhr, url, urlIndex) {\n cssArray[i] = '';\n settings.onError(xhr, node, url);\n handleComplete();\n }\n });\n }\n }\n else if (isStyle && !isSkip) {\n let cssText = node.textContent;\n\n if (settings.useCSSOM) {\n cssText = Array.apply(null, node.sheet.cssRules)\n .map(rule => rule.cssText)\n .join('');\n }\n\n handleSuccess(cssText, i, node, location.href);\n }\n else {\n cssArray[i] = '';\n handleComplete();\n }\n });\n }\n else {\n settings.onComplete('', []);\n }\n}\n\n\n// Functions (Private)\n// =============================================================================\n/**\n * Returns fully qualified URL from relative URL and (optional) base URL\n *\n * @param {any} url\n * @param {any} base\n * @returns\n */\nfunction getFullUrl(url, base) {\n const d = document.implementation.createHTMLDocument('');\n const b = d.createElement('base');\n const a = d.createElement('a');\n\n d.head.appendChild(b);\n d.body.appendChild(a);\n b.href = base || document.baseURI || (document.querySelector('base') || {}).href || location.href;\n a.href = url;\n\n return a.href;\n}\n\n/**\n * Ponyfill for native Element.matches method\n *\n * @param {object} elm The element to test\n * @param {string} selector The CSS selector to test against\n * @returns {boolean}\n */\nfunction matchesSelector(elm, selector) {\n /* istanbul ignore next */\n const matches = elm.matches || elm.matchesSelector || elm.webkitMatchesSelector || elm.mozMatchesSelector || elm.msMatchesSelector || elm.oMatchesSelector;\n\n return matches.call(elm, selector);\n}\n\n\n// Export\n// =============================================================================\nexport default getCssData;\n"],"names":["getUrls","urls","options","settings","mimeType","onBeforeSend","Function","prototype","onSuccess","onError","onComplete","urlArray","Array","isArray","urlQueue","apply","length","map","x","isValidCss","text","isString","isHTML","trim","charAt","xhr","urlIndex","responseText","returnVal","indexOf","parser","document","createElement","forEach","url","i","setAttribute","href","String","Boolean","all","window","atob","host","split","location","protocol","xdr","XDomainRequest","open","timeout","onprogress","ontimeout","onload","onerror","err","setTimeout","send","console","warn","concat","XMLHttpRequest","overrideMimeType","onreadystatechange","readyState","status","getFullUrl","base","d","implementation","createHTMLDocument","b","a","head","appendChild","body","baseURI","querySelector","regex","rootElement","include","exclude","filter","skipDisabled","useCSSOM","sourceNodes","querySelectorAll","node","elm","selector","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","call","cssArray","handleComplete","reduce","skipIndices","value","push","reverse","skipIndex","arr","splice","cssText","join","handleSuccess","cssIndex","sourceUrl","resolveImports","undefined","resolvedCssText","errorData","data","test","parseImportData","baseUrl","ignoreRules","importData","rules","replace","match","rule","absoluteUrls","absoluteRules","oldUrl","newUrl","callbackFn","__errorData","__errorRules","responseImportData","responseArray","importText","linkHref","getAttribute","linkRel","isLink","nodeName","toLowerCase","isSkip","disabled","isStyle","decodeURIComponent","substring","sheet","cssRules","textContent"],"mappings":";;;;;;;2OAwBA,SAASA,EAAQC,GAAMC,IAAAA,yDAAU,GACvBC,EAAW,CACbC,SAAcF,EAAQE,UAAgB,KACtCC,aAAcH,EAAQG,cAAgBC,SAASC,UAC/CC,UAAcN,EAAQM,WAAgBF,SAASC,UAC/CE,QAAcP,EAAQO,SAAgBH,SAASC,UAC/CG,WAAcR,EAAQQ,YAAgBJ,SAASC,WAE7CI,EAAWC,MAAMC,QAAQZ,GAAQA,EAAO,CAACA,GACzCa,EAAWF,MAAMG,MAAM,KAAMH,MAAMD,EAASK,SAASC,KAAI,SAAAC,GAAC,OAAI,QAI3DC,SAAAA,EAAWC,GAChB,IAAMC,EAA2B,iBAATD,EAClBE,EAASD,GAAsC,MAA1BD,EAAKG,OAAOC,OAAO,GAEvCH,OAAAA,IAAaC,EAGxB,SAASb,EAAQgB,EAAKC,GAClBvB,EAASM,QAAQgB,EAAKd,EAASe,GAAWA,GAG9C,SAASlB,EAAUmB,EAAcD,GAC7B,IAAME,EAAYzB,EAASK,UAAUmB,EAAchB,EAASe,GAAWA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