svg-sprite-loader
Advanced tools
+19
-11
@@ -101,2 +101,18 @@ var Sniffr = require('sniffr'); | ||
| /** | ||
| * Fix for browser (IE, maybe other too) which are throwing 'WrongDocumentError' | ||
| * if you insert an element which is not part of the document | ||
| * @see http://stackoverflow.com/questions/7981100/how-do-i-dynamically-insert-an-svg-image-into-html#7986519 | ||
| * @param {Element} svg | ||
| */ | ||
| function importSvg(svg) { | ||
| try { | ||
| if (document.importNode) { | ||
| return document.importNode(svg, true); | ||
| } | ||
| } catch(e) {} | ||
| return svg; | ||
| } | ||
| /** | ||
| * @type {string} | ||
@@ -196,17 +212,9 @@ */ | ||
| var svg = new DOMParser().parseFromString(svgString, 'image/svg+xml').documentElement; | ||
| var importedSvg = importSvg(svg); | ||
| /** | ||
| * Fix for browser (IE, maybe other too) which are throwing 'WrongDocumentError' | ||
| * if you insert an element which is not part of the document | ||
| * @see http://stackoverflow.com/questions/7981100/how-do-i-dynamically-insert-an-svg-image-into-html#7986519 | ||
| */ | ||
| if (document.importNode) { | ||
| svg = document.importNode(svg, true); | ||
| } | ||
| if (this.browser.name !== 'ie' && this.urlPrefix) { | ||
| baseUrlWorkAround(svg, DEFAULT_URI_PREFIX, this.urlPrefix); | ||
| baseUrlWorkAround(importedSvg, DEFAULT_URI_PREFIX, this.urlPrefix); | ||
| } | ||
| return svg; | ||
| return importedSvg; | ||
| }; | ||
@@ -213,0 +221,0 @@ |
+1
-1
| { | ||
| "name": "svg-sprite-loader", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "description": "SVG sprite webpack loader", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
23985
0.59%550
1.29%