diff --git a/README.md b/README.md index b7f21223..00456a81 100644 --- a/README.md +++ b/README.md @@ -170,9 +170,10 @@ on the root node. #### adjustClonedNode -A function that will be invoked on each node as they are cloned. Useful to adjust nodes in any way needed before the conversion. -Note that this be invoked before the onclone callback. -The handler gets the original node, the cloned node, and a boolean that says if we've cloned the children already (so you can handle either before or after) +A function that will be invoked on each node as they are cloned. Useful to adjust nodes in +any way needed before the conversion. Note that this be invoked before the onclone +callback. The handler gets the original node, the cloned node, and a boolean that says if +we've cloned the children already (so you can handle either before or after) Sample use: @@ -180,18 +181,23 @@ Sample use: if (!after && clone.id === 'element') { clone.style.transform = 'translateY(100px)'; } - return clone; + return clone; } ``` -const wrapper = document.getElementById('wrapper'); -const blob = domtoimage.toBlob(wrapper, { adjustClonedNode: adjustClone}); +const wrapper = document.getElementById('wrapper'); const blob = +domtoimage.toBlob(wrapper, { adjustClonedNode: adjustClone}); #### onclone -A function taking the cloned and modified DOM node as argument. It allows to make final adjustements to the elements before rendering, on the whole clone, after all elements have been individually cloned. Note that this will be invoked after all the onclone callbacks have been fired. +A function taking the cloned and modified DOM node as argument. It allows to make final +adjustements to the elements before rendering, on the whole clone, after all elements have +been individually cloned. Note that this will be invoked after all the onclone callbacks +have been fired. -The cloned DOM might differ a lot from the original DOM, for example canvas will be replaced with image tags, some class might have changed, the style are inlined. It can be useful to log the clone to get a better senses of the transformations. +The cloned DOM might differ a lot from the original DOM, for example canvas will be +replaced with image tags, some class might have changed, the style are inlined. It can be +useful to log the clone to get a better senses of the transformations. #### bgcolor @@ -386,7 +392,8 @@ DOLCIMASCOLO (packaging), Zee (ZM) @zm-cttae (many major updates), Joshua Walsh @nstuyvesant (fixes), King Wang @eachmawzw (CORS image proxy), TMM Schmit @tmmschmit (useCredentialsFilters), Aravind @codesculpture (fix overridden props), Shi Wenyu @cWenyu (shadow slot fix), David Burns @davidburns573 and Yujia Cheng @YujiaCheng1996 (font copy -optional), Julien Dorra @juliendorra (documentation) +optional), Julien Dorra @juliendorra (documentation), Sean Zhang @SeanZhang-eaton (regex +fixes) ## License diff --git a/dist/dom-to-image-more.min.js b/dist/dom-to-image-more.min.js index 9297681a..152a81b8 100644 --- a/dist/dom-to-image-more.min.js +++ b/dist/dom-to-image-more.min.js @@ -1,3 +1,3 @@ /*! dom-to-image-more 12-09-2024 */ -(l=>{let f=(()=>{let e=0;return{escape:function(e){return e.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(t){if(t.toBlob)return new Promise(function(e){t.toBlob(e)});return(r=>new Promise(function(e){var t=u(r.toDataURL().split(",")[1]),n=t.length,o=new Uint8Array(n);for(let e=0;e0<=s.search(e)).length),a.impl.options.useCredentials&&(r.withCredentials=!0),a.impl.options.corsImg&&0===s.indexOf("http")&&-1===s.indexOf(window.location.origin)){var i="POST"===(a.impl.options.corsImg.method||"GET").toUpperCase()?"POST":"GET";r.open(i,(a.impl.options.corsImg.url||"").replace("#{cors}",s),!0);let t=!1,n=a.impl.options.corsImg.headers||{},o=(Object.keys(n).forEach(function(e){-1!==n[e].indexOf("application/json")&&(t=!0),r.setRequestHeader(e,n[e])}),(e=>{try{return JSON.parse(JSON.stringify(e))}catch(e){l("corsImg.data is missing or invalid:"+e.toString())}})(a.impl.options.corsImg.data||""));Object.keys(o).forEach(function(e){"string"==typeof o[e]&&(o[e]=o[e].replace("#{cors}",s))}),r.send(t?JSON.stringify(o):o)}else r.open("GET",s,!0),r.send();let n;function l(e){console.error(e),t("")}a.impl.options.imagePlaceholder&&(i=a.impl.options.imagePlaceholder.split(/,/))&&i[1]&&(n=i[1])}));return e.promise},uid:function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++},delay:function(n){return function(t){return new Promise(function(e){setTimeout(function(){e(t)},n)})}},asArray:function(t){var n=[],o=t.length;for(let e=0;e{let o=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,o,r){if(!e(t))return Promise.resolve(t);return Promise.resolve(t).then(n).then(function(e){let n=Promise.resolve(t);return e.forEach(function(t){n=n.then(function(e){return i(e,t,o,r)})}),n})},shouldProcess:e,impl:{readUrls:n,inline:i}};function e(e){return-1!==e.search(o)}function n(e){for(var t,n=[];null!==(t=o.exec(e));)n.push(t[1]);return n.filter(function(e){return!f.isDataUrl(e)})}function i(n,o,t,e){return Promise.resolve(o).then(function(e){return t?f.resolveUrl(e,t):e}).then(e||f.getAndEncode).then(function(e){return n.replace((t=o,new RegExp(`(url\\(['"]?)(${f.escape(t)})(['"]?\\))`,"g")),`$1${e}$3`);var t})}})(),e={resolveAll:function(){return t().then(function(e){return Promise.all(e.map(function(e){return e.resolve()}))}).then(function(e){return e.join("\n")})},impl:{readAll:t}};function t(){return Promise.resolve(f.asArray(document.styleSheets)).then(function(e){let n=[];return e.forEach(function(t){var e=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(e,"cssRules"))try{f.asArray(t.cssRules||[]).forEach(n.push.bind(n))}catch(e){console.error("domtoimage: Error while reading CSS rules from "+t.href,e.toString())}}),n}).then(function(e){return e.filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).filter(function(e){return r.shouldProcess(e.style.getPropertyValue("src"))})}).then(function(e){return e.map(t)});function t(t){return{resolve:function(){var e=(t.parentStyleSheet||{}).href;return r.inlineAll(t.cssText,e)},src:function(){return t.style.getPropertyValue("src")}}}}let n={inlineAll:function t(e){if(!f.isElement(e))return Promise.resolve(e);return n(e).then(function(){return f.isHTMLImageElement(e)?o(e).inline():Promise.all(f.asArray(e.childNodes).map(function(e){return t(e)}))});function n(o){let e=["background","background-image"],t=e.map(function(t){let e=o.style.getPropertyValue(t),n=o.style.getPropertyPriority(t);return e?r.inlineAll(e).then(function(e){o.style.setProperty(t,e,n)}):Promise.resolve()});return Promise.all(t).then(function(){return o})}},impl:{newImage:o}};function o(n){return{inline:function(e){if(f.isDataUrl(n.src))return Promise.resolve();return Promise.resolve(n.src).then(e||f.getAndEncode).then(function(t){return new Promise(function(e){n.onload=e,n.onerror=e,n.src=t})})}}}let s={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0,adjustClonedNode:void 0},a={toSvg:d,toPng:function(e,t){return i(e,t).then(function(e){return e.toDataURL()})},toJpeg:function(e,t){return i(e,t).then(function(e){return e.toDataURL("image/jpeg",(t?t.quality:void 0)||1)})},toBlob:function(e,t){return i(e,t).then(f.canvasToBlob)},toPixelData:function(t,e){return i(t,e).then(function(e){return e.getContext("2d").getImageData(0,0,f.width(t),f.height(t)).data})},toCanvas:i,impl:{fontFaces:e,images:n,util:f,inliner:r,urlCache:[],options:{}}},c=("object"==typeof exports&&"object"==typeof module?module.exports=a:l.domtoimage=a,("undefined"!=typeof Node?Node.ELEMENT_NODE:void 0)||1),m=(void 0!==l?l.getComputedStyle:void 0)||("undefined"!=typeof window?window.getComputedStyle:void 0)||globalThis.getComputedStyle,u=(void 0!==l?l.atob:void 0)||("undefined"!=typeof window?window.atob:void 0)||globalThis.atob;function d(e,r){let t=a.impl.util.getWindow(e);var n=r=r||{};void 0===n.copyDefaultStyles?a.impl.options.copyDefaultStyles=s.copyDefaultStyles:a.impl.options.copyDefaultStyles=n.copyDefaultStyles,a.impl.options.imagePlaceholder=(void 0===n.imagePlaceholder?s:n).imagePlaceholder,a.impl.options.cacheBust=(void 0===n.cacheBust?s:n).cacheBust,a.impl.options.corsImg=(void 0===n.corsImg?s:n).corsImg,a.impl.options.useCredentials=(void 0===n.useCredentials?s:n).useCredentials,a.impl.options.useCredentialsFilters=(void 0===n.useCredentialsFilters?s:n).useCredentialsFilters,a.impl.options.httpTimeout=(void 0===n.httpTimeout?s:n).httpTimeout,a.impl.options.styleCaching=(void 0===n.styleCaching?s:n).styleCaching;let i=[];return Promise.resolve(e).then(function(e){if(e.nodeType===c)return e;var t=e,n=e.parentNode,o=document.createElement("span");return n.replaceChild(o,t),o.append(e),i.push({parent:n,child:t,wrapper:o}),o}).then(function(e){return function l(t,s,r,u){let e=s.filter;if(t===h||f.isHTMLScriptElement(t)||f.isHTMLStyleElement(t)||f.isHTMLLinkElement(t)||null!==r&&e&&!e(t))return Promise.resolve();return Promise.resolve(t).then(n).then(o).then(function(e){return c(e,a(t))}).then(i).then(function(e){return d(e,t)});function n(e){return f.isHTMLCanvasElement(e)?f.makeImage(e.toDataURL()):e.cloneNode(!1)}function o(e){return s.adjustClonedNode&&s.adjustClonedNode(t,e,!1),Promise.resolve(e)}function i(e){return s.adjustClonedNode&&s.adjustClonedNode(t,e,!0),Promise.resolve(e)}function a(e){return f.isElementHostForOpenShadowRoot(e)?e.shadowRoot:e}function c(n,e){let o=t(e),r=Promise.resolve();if(0!==o.length){let t=m(i(e));f.asArray(o).forEach(function(e){r=r.then(function(){return l(e,s,t,u).then(function(e){e&&n.appendChild(e)})})})}return r.then(function(){return n});function i(e){return f.isShadowRoot(e)?e.host:e}function t(t){if(f.isShadowSlotElement(t)){let e=t.assignedNodes();if(e&&0t.style.removeProperty(e)),["left","right","top","bottom"].forEach(e=>{t.style.getPropertyValue(e)&&t.style.setProperty(e,"0px")})))}e(a,u)}function t(){let s=f.uid();function t(r){let i=m(a,r),l=i.getPropertyValue("content");if(""!==l&&"none"!==l){let e=u.getAttribute("class")||"",t=(u.setAttribute("class",e+" "+s),document.createElement("style"));function n(){let e=`.${s}:`+r,t=(i.cssText?n:o)();return document.createTextNode(e+`{${t}}`);function n(){return`${i.cssText} content: ${l};`}function o(){let e=f.asArray(i).map(t).join("; ");return e+";";function t(e){let t=i.getPropertyValue(e),n=i.getPropertyPriority(e)?" !important":"";return e+": "+t+n}}}t.appendChild(n()),u.appendChild(t)}}[":before",":after"].forEach(function(e){t(e)})}function n(){f.isHTMLTextAreaElement(a)&&(u.innerHTML=a.value),f.isHTMLInputElement(a)&&u.setAttribute("value",a.value)}function o(){f.isSVGElement(u)&&(u.setAttribute("xmlns","http://www.w3.org/2000/svg"),f.isSVGRectElement(u))&&["width","height"].forEach(function(e){let t=u.getAttribute(e);t&&u.style.setProperty(e,t)})}}}(e,r,null,t)}).then(r.disableEmbedFonts?Promise.resolve(e):p).then(g).then(function(t){r.bgcolor&&(t.style.backgroundColor=r.bgcolor);r.width&&(t.style.width=r.width+"px");r.height&&(t.style.height=r.height+"px");r.style&&Object.keys(r.style).forEach(function(e){t.style[e]=r.style[e]});let e=null;"function"==typeof r.onclone&&(e=r.onclone(t));return Promise.resolve(e).then(function(){return t})}).then(function(e){let n=r.width||f.width(e),o=r.height||f.height(e);return Promise.resolve(e).then(function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)}).then(f.escapeXhtml).then(function(e){var t=(f.isDimensionMissing(n)?' width="100%"':` width="${n}"`)+(f.isDimensionMissing(o)?' height="100%"':` height="${o}"`);return`${e}`}).then(function(e){return"data:image/svg+xml;charset=utf-8,"+e})}).then(function(e){for(;0{h&&(document.body.removeChild(h),h=null),v&&clearTimeout(v),v=setTimeout(()=>{v=null,w={}},2e4)})(),e})}function i(r,i){return d(r,i=i||{}).then(f.makeImage).then(function(e){var t="number"!=typeof i.scale?1:i.scale,n=((e,t)=>{let n=i.width||f.width(e),o=i.height||f.height(e);return f.isDimensionMissing(n)&&(n=f.isDimensionMissing(o)?300:2*o),f.isDimensionMissing(o)&&(o=n/2),(e=document.createElement("canvas")).width=n*t,e.height=o*t,i.bgcolor&&((t=e.getContext("2d")).fillStyle=i.bgcolor,t.fillRect(0,0,e.width,e.height)),e})(r,t),o=n.getContext("2d");return o.msImageSmoothingEnabled=!1,o.imageSmoothingEnabled=!1,e&&(o.scale(t,t),o.drawImage(e,0,0)),n})}let h=null;function p(n){return e.resolveAll().then(function(e){var t;return""!==e&&(t=document.createElement("style"),n.appendChild(t),t.appendChild(document.createTextNode(e))),n})}function g(e){return n.inlineAll(e).then(function(){return e})}function y(e,t,i,l,n){let s=a.impl.options.copyDefaultStyles?((t,e)=>{var n,o=(e=>("relaxed"!==t.styleCaching?e:e.filter((e,t,n)=>0===t||t===n.length-1)).join(">"))(e=(e=>{var t=[];do{if(e.nodeType===c){var n=e.tagName;if(t.push(n),E.includes(n))break}}while(e=e.parentNode);return t})(e));{if(w[o])return w[o];e=((e,t)=>{let n=e.body;do{var o=t.pop(),o=e.createElement(o);n.appendChild(o),n=o}while(0{if(h)return h.contentWindow;t=document.characterSet||"UTF-8",e=(e=document.doctype)?(`":"",(h=document.createElement("iframe")).id="domtoimage-sandbox-"+f.uid(),h.style.visibility="hidden",h.style.position="fixed",document.body.appendChild(h);var e,t,n=h,o="domtoimage-sandbox";try{return n.contentWindow.document.write(e+`${o}`),n.contentWindow}catch(e){}var r=document.createElement("meta");r.setAttribute("charset",t);try{var i=document.implementation.createHTMLDocument(o),l=(i.head.appendChild(r),e+i.documentElement.outerHTML);return n.setAttribute("srcdoc",l),n.contentWindow}catch(e){}return n.contentDocument.head.appendChild(r),n.contentDocument.title=o,n.contentWindow;function s(e){var t;return e?((t=document.createElement("div")).innerText=e,t.innerHTML):""}})()).document,e),n=((e,t)=>{let n={},o=e.getComputedStyle(t);return f.asArray(o).forEach(function(e){n[e]="width"===e||"height"===e?"auto":o.getPropertyValue(e)}),n})(n,e);var r=e;do{var i=r.parentElement;null!==i&&i.removeChild(r),r=i}while(r&&"BODY"!==r.tagName);return w[o]=n}})(e,t):{},u=n.style;f.asArray(i).forEach(function(e){var t,n=i.getPropertyValue(e),o=s[e],r=l?l.getPropertyValue(e):void 0;u.getPropertyValue(e)||(n!==o||l&&n!==r)&&(o=i.getPropertyPriority(e),r=u,n=n,o=o,t=0<=["background-clip"].indexOf(e=e),o?(r.setProperty(e,n,o),t&&r.setProperty("-webkit-"+e,n,o)):(r.setProperty(e,n),t&&r.setProperty("-webkit-"+e,n)))})}let v=null,w={},E=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"]})(this); +(l=>{let f=(()=>{let e=0;return{escape:function(e){return e.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(t){if(t.toBlob)return new Promise(function(e){t.toBlob(e)});return(r=>new Promise(function(e){var t=u(r.toDataURL().split(",")[1]),n=t.length,o=new Uint8Array(n);for(let e=0;e0<=s.search(e)).length),a.impl.options.useCredentials&&(r.withCredentials=!0),a.impl.options.corsImg&&0===s.indexOf("http")&&-1===s.indexOf(window.location.origin)){var i="POST"===(a.impl.options.corsImg.method||"GET").toUpperCase()?"POST":"GET";r.open(i,(a.impl.options.corsImg.url||"").replace("#{cors}",s),!0);let t=!1,n=a.impl.options.corsImg.headers||{},o=(Object.keys(n).forEach(function(e){-1!==n[e].indexOf("application/json")&&(t=!0),r.setRequestHeader(e,n[e])}),(e=>{try{return JSON.parse(JSON.stringify(e))}catch(e){l("corsImg.data is missing or invalid:"+e.toString())}})(a.impl.options.corsImg.data||""));Object.keys(o).forEach(function(e){"string"==typeof o[e]&&(o[e]=o[e].replace("#{cors}",s))}),r.send(t?JSON.stringify(o):o)}else r.open("GET",s,!0),r.send();let n;function l(e){console.error(e),t("")}a.impl.options.imagePlaceholder&&(i=a.impl.options.imagePlaceholder.split(/,/))&&i[1]&&(n=i[1])}));return e.promise},uid:function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++},delay:function(n){return function(t){return new Promise(function(e){setTimeout(function(){e(t)},n)})}},asArray:function(t){var n=[],o=t.length;for(let e=0;e{let o=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,o,r){if(!e(t))return Promise.resolve(t);return Promise.resolve(t).then(n).then(function(e){let n=Promise.resolve(t);return e.forEach(function(t){n=n.then(function(e){return i(e,t,o,r)})}),n})},shouldProcess:e,impl:{readUrls:n,inline:i}};function e(e){return-1!==e.search(o)}function n(e){for(var t,n=[];null!==(t=o.exec(e));)n.push(t[1]);return n.filter(function(e){return!f.isDataUrl(e)})}function i(n,o,t,e){return Promise.resolve(o).then(function(e){return t?f.resolveUrl(e,t):e}).then(e||f.getAndEncode).then(function(e){return n.replace((t=o,new RegExp(`(url\\(['"]?)(${f.escape(t)})(['"]?\\))`,"g")),`$1${e}$3`);var t})}})(),e={resolveAll:function(){return t().then(function(e){return Promise.all(e.map(function(e){return e.resolve()}))}).then(function(e){return e.join("\n")})},impl:{readAll:t}};function t(){return Promise.resolve(f.asArray(document.styleSheets)).then(function(e){let n=[];return e.forEach(function(t){var e=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(e,"cssRules"))try{f.asArray(t.cssRules||[]).forEach(n.push.bind(n))}catch(e){console.error("domtoimage: Error while reading CSS rules from "+t.href,e.toString())}}),n}).then(function(e){return e.filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).filter(function(e){return r.shouldProcess(e.style.getPropertyValue("src"))})}).then(function(e){return e.map(t)});function t(t){return{resolve:function(){var e=(t.parentStyleSheet||{}).href;return r.inlineAll(t.cssText,e)},src:function(){return t.style.getPropertyValue("src")}}}}let n={inlineAll:function t(e){if(!f.isElement(e))return Promise.resolve(e);return n(e).then(function(){return f.isHTMLImageElement(e)?o(e).inline():Promise.all(f.asArray(e.childNodes).map(function(e){return t(e)}))});function n(o){let e=["background","background-image"],t=e.map(function(t){let e=o.style.getPropertyValue(t),n=o.style.getPropertyPriority(t);return e?r.inlineAll(e).then(function(e){o.style.setProperty(t,e,n)}):Promise.resolve()});return Promise.all(t).then(function(){return o})}},impl:{newImage:o}};function o(n){return{inline:function(e){if(f.isDataUrl(n.src))return Promise.resolve();return Promise.resolve(n.src).then(e||f.getAndEncode).then(function(t){return new Promise(function(e){n.onload=e,n.onerror=e,n.src=t})})}}}let s={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0,adjustClonedNode:void 0},a={toSvg:d,toPng:function(e,t){return i(e,t).then(function(e){return e.toDataURL()})},toJpeg:function(e,t){return i(e,t).then(function(e){return e.toDataURL("image/jpeg",(t?t.quality:void 0)||1)})},toBlob:function(e,t){return i(e,t).then(f.canvasToBlob)},toPixelData:function(t,e){return i(t,e).then(function(e){return e.getContext("2d").getImageData(0,0,f.width(t),f.height(t)).data})},toCanvas:i,impl:{fontFaces:e,images:n,util:f,inliner:r,urlCache:[],options:{}}},c=("object"==typeof exports&&"object"==typeof module?module.exports=a:l.domtoimage=a,("undefined"!=typeof Node?Node.ELEMENT_NODE:void 0)||1),m=(void 0!==l?l.getComputedStyle:void 0)||("undefined"!=typeof window?window.getComputedStyle:void 0)||globalThis.getComputedStyle,u=(void 0!==l?l.atob:void 0)||("undefined"!=typeof window?window.atob:void 0)||globalThis.atob;function d(e,r){let t=a.impl.util.getWindow(e);var n=r=r||{};void 0===n.copyDefaultStyles?a.impl.options.copyDefaultStyles=s.copyDefaultStyles:a.impl.options.copyDefaultStyles=n.copyDefaultStyles,a.impl.options.imagePlaceholder=(void 0===n.imagePlaceholder?s:n).imagePlaceholder,a.impl.options.cacheBust=(void 0===n.cacheBust?s:n).cacheBust,a.impl.options.corsImg=(void 0===n.corsImg?s:n).corsImg,a.impl.options.useCredentials=(void 0===n.useCredentials?s:n).useCredentials,a.impl.options.useCredentialsFilters=(void 0===n.useCredentialsFilters?s:n).useCredentialsFilters,a.impl.options.httpTimeout=(void 0===n.httpTimeout?s:n).httpTimeout,a.impl.options.styleCaching=(void 0===n.styleCaching?s:n).styleCaching;let i=[];return Promise.resolve(e).then(function(e){if(e.nodeType===c)return e;var t=e,n=e.parentNode,o=document.createElement("span");return n.replaceChild(o,t),o.append(e),i.push({parent:n,child:t,wrapper:o}),o}).then(function(e){return function l(t,s,r,u){let e=s.filter;if(t===h||f.isHTMLScriptElement(t)||f.isHTMLStyleElement(t)||f.isHTMLLinkElement(t)||null!==r&&e&&!e(t))return Promise.resolve();return Promise.resolve(t).then(n).then(o).then(function(e){return c(e,a(t))}).then(i).then(function(e){return d(e,t)});function n(e){return f.isHTMLCanvasElement(e)?f.makeImage(e.toDataURL()):e.cloneNode(!1)}function o(e){return s.adjustClonedNode&&s.adjustClonedNode(t,e,!1),Promise.resolve(e)}function i(e){return s.adjustClonedNode&&s.adjustClonedNode(t,e,!0),Promise.resolve(e)}function a(e){return f.isElementHostForOpenShadowRoot(e)?e.shadowRoot:e}function c(n,e){let o=t(e),r=Promise.resolve();if(0!==o.length){let t=m(i(e));f.asArray(o).forEach(function(e){r=r.then(function(){return l(e,s,t,u).then(function(e){e&&n.appendChild(e)})})})}return r.then(function(){return n});function i(e){return f.isShadowRoot(e)?e.host:e}function t(t){if(f.isShadowSlotElement(t)){let e=t.assignedNodes();if(e&&0t.style.removeProperty(e)),["left","right","top","bottom"].forEach(e=>{t.style.getPropertyValue(e)&&t.style.setProperty(e,"0px")})))}e(a,u)}function t(){let s=f.uid();function t(r){let i=m(a,r),l=i.getPropertyValue("content");if(""!==l&&"none"!==l){let e=u.getAttribute("class")||"",t=(u.setAttribute("class",e+" "+s),document.createElement("style"));function n(){let e=`.${s}:`+r,t=(i.cssText?n:o)();return document.createTextNode(e+`{${t}}`);function n(){return`${i.cssText} content: ${l};`}function o(){let e=f.asArray(i).map(t).join("; ");return e+";";function t(e){let t=i.getPropertyValue(e),n=i.getPropertyPriority(e)?" !important":"";return e+": "+t+n}}}t.appendChild(n()),u.appendChild(t)}}[":before",":after"].forEach(function(e){t(e)})}function n(){f.isHTMLTextAreaElement(a)&&(u.innerHTML=a.value),f.isHTMLInputElement(a)&&u.setAttribute("value",a.value)}function o(){f.isSVGElement(u)&&(u.setAttribute("xmlns","http://www.w3.org/2000/svg"),f.isSVGRectElement(u))&&["width","height"].forEach(function(e){let t=u.getAttribute(e);t&&u.style.setProperty(e,t)})}}}(e,r,null,t)}).then(r.disableEmbedFonts?Promise.resolve(e):p).then(g).then(function(t){r.bgcolor&&(t.style.backgroundColor=r.bgcolor);r.width&&(t.style.width=r.width+"px");r.height&&(t.style.height=r.height+"px");r.style&&Object.keys(r.style).forEach(function(e){t.style[e]=r.style[e]});let e=null;"function"==typeof r.onclone&&(e=r.onclone(t));return Promise.resolve(e).then(function(){return t})}).then(function(e){let n=r.width||f.width(e),o=r.height||f.height(e);return Promise.resolve(e).then(function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)}).then(f.escapeXhtml).then(function(e){var t=(f.isDimensionMissing(n)?' width="100%"':` width="${n}"`)+(f.isDimensionMissing(o)?' height="100%"':` height="${o}"`);return`${e}`}).then(function(e){return"data:image/svg+xml;charset=utf-8,"+e})}).then(function(e){for(;0{h&&(document.body.removeChild(h),h=null),v&&clearTimeout(v),v=setTimeout(()=>{v=null,w={}},2e4)})(),e})}function i(r,i){return d(r,i=i||{}).then(f.makeImage).then(function(e){var t="number"!=typeof i.scale?1:i.scale,n=((e,t)=>{let n=i.width||f.width(e),o=i.height||f.height(e);return f.isDimensionMissing(n)&&(n=f.isDimensionMissing(o)?300:2*o),f.isDimensionMissing(o)&&(o=n/2),(e=document.createElement("canvas")).width=n*t,e.height=o*t,i.bgcolor&&((t=e.getContext("2d")).fillStyle=i.bgcolor,t.fillRect(0,0,e.width,e.height)),e})(r,t),o=n.getContext("2d");return o.msImageSmoothingEnabled=!1,o.imageSmoothingEnabled=!1,e&&(o.scale(t,t),o.drawImage(e,0,0)),n})}let h=null;function p(n){return e.resolveAll().then(function(e){var t;return""!==e&&(t=document.createElement("style"),n.appendChild(t),t.appendChild(document.createTextNode(e))),n})}function g(e){return n.inlineAll(e).then(function(){return e})}function y(e,t,i,l,n){let s=a.impl.options.copyDefaultStyles?((t,e)=>{var n,o=(e=>("relaxed"!==t.styleCaching?e:e.filter((e,t,n)=>0===t||t===n.length-1)).join(">"))(e=(e=>{var t=[];do{if(e.nodeType===c){var n=e.tagName;if(t.push(n),E.includes(n))break}}while(e=e.parentNode);return t})(e));{if(w[o])return w[o];e=((e,t)=>{let n=e.body;do{var o=t.pop(),o=e.createElement(o);n.appendChild(o),n=o}while(0{if(h)return h.contentWindow;t=document.characterSet||"UTF-8",e=(e=document.doctype)?(`":"",(h=document.createElement("iframe")).id="domtoimage-sandbox-"+f.uid(),h.style.visibility="hidden",h.style.position="fixed",document.body.appendChild(h);var e,t,n=h,o="domtoimage-sandbox";try{return n.contentWindow.document.write(e+`${o}`),n.contentWindow}catch(e){}var r=document.createElement("meta");r.setAttribute("charset",t);try{var i=document.implementation.createHTMLDocument(o),l=(i.head.appendChild(r),e+i.documentElement.outerHTML);return n.setAttribute("srcdoc",l),n.contentWindow}catch(e){}return n.contentDocument.head.appendChild(r),n.contentDocument.title=o,n.contentWindow;function s(e){var t;return e?((t=document.createElement("div")).innerText=e,t.innerHTML):""}})()).document,e),n=((e,t)=>{let n={},o=e.getComputedStyle(t);return f.asArray(o).forEach(function(e){n[e]="width"===e||"height"===e?"auto":o.getPropertyValue(e)}),n})(n,e);var r=e;do{var i=r.parentElement;null!==i&&i.removeChild(r),r=i}while(r&&"BODY"!==r.tagName);return w[o]=n}})(e,t):{},u=n.style;f.asArray(i).forEach(function(e){var t,n=i.getPropertyValue(e),o=s[e],r=l?l.getPropertyValue(e):void 0;u.getPropertyValue(e)||(n!==o||l&&n!==r)&&(o=i.getPropertyPriority(e),r=u,n=n,o=o,t=0<=["background-clip"].indexOf(e=e),o?(r.setProperty(e,n,o),t&&r.setProperty("-webkit-"+e,n,o)):(r.setProperty(e,n),t&&r.setProperty("-webkit-"+e,n)))})}let v=null,w={},E=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"]})(this); //# sourceMappingURL=dom-to-image-more.min.js.map \ No newline at end of file diff --git a/dist/dom-to-image-more.min.js.map b/dist/dom-to-image-more.min.js.map index 926c9f0e..ffb1c9c4 100644 --- a/dist/dom-to-image-more.min.js.map +++ b/dist/dom-to-image-more.min.js.map @@ -1 +1 @@ -{"version":3,"file":"dom-to-image-more.min.js","sources":["../src/dom-to-image-more.js"],"names":["global","util","let","uid_index","escape","string","replace","isDataUrl","url","search","canvasToBlob","canvas","toBlob","Promise","resolve","binaryString","atob","toDataURL","split","length","binaryArray","Uint8Array","i","charCodeAt","Blob","type","resolveUrl","baseUrl","doc","document","implementation","createHTMLDocument","base","createElement","a","head","appendChild","body","href","getAndEncode","cacheEntry","domtoimage","impl","urlCache","find","el","promise","push","options","cacheBust","test","Date","getTime","httpTimeout","request","XMLHttpRequest","onreadystatechange","readyState","status","placeholder","fail","encoder","FileReader","onloadend","result","readAsDataURL","response","ontimeout","responseType","timeout","useCredentialsFilters","useCredentials","filter","credentialsFilter","withCredentials","corsImg","indexOf","window","location","origin","method","toUpperCase","open","isJson","headers","corsData","Object","keys","forEach","key","setRequestHeader","data","JSON","parse","stringify","e","toString","send","message","console","error","imagePlaceholder","uid","Math","random","pow","slice","delay","ms","arg","setTimeout","asArray","arrayLike","array","escapeXhtml","makeImage","uri","reject","image","Image","crossOrigin","onload","requestAnimationFrame","onerror","src","width","node","px","isNaN","leftBorder","rightBorder","scrollWidth","height","topBorder","bottomBorder","scrollHeight","getWindow","isElement","isElementHostForOpenShadowRoot","value","shadowRoot","isShadowRoot","isInShadowRoot","isHTMLElement","HTMLElement","isHTMLCanvasElement","HTMLCanvasElement","isHTMLInputElement","HTMLInputElement","isHTMLImageElement","HTMLImageElement","isHTMLLinkElement","HTMLLinkElement","isHTMLScriptElement","HTMLScriptElement","isHTMLStyleElement","HTMLStyleElement","isHTMLTextAreaElement","HTMLTextAreaElement","isShadowSlotElement","HTMLSlotElement","isSVGElement","SVGElement","isSVGRectElement","SVGRectElement","isDimensionMissing","ownerDocument","undefined","defaultView","ShadowRoot","getRootNode","Element","styleProperty","nodeType","ELEMENT_NODE","getComputedStyle","getPropertyValue","parseFloat","NaN","inliner","URL_REGEX","inlineAll","get","shouldProcess","then","readUrls","urls","done","prefix","inline","match","exec","urlValue","dataUrl","RegExp","fontFaces","resolveAll","readAll","webFonts","all","map","webFont","cssStrings","join","styleSheets","cssRules","sheet","sheetProto","getPrototypeOf","prototype","hasOwnProperty","call","bind","rule","CSSRule","FONT_FACE_RULE","style","rules","newWebFont","webFontRule","parentStyleSheet","cssText","images","inlineCSSProperty","newImage","childNodes","child","properties","inliningTasks","propertyName","priority","getPropertyPriority","inlinedValue","setProperty","element","defaultOptions","copyDefaultStyles","styleCaching","adjustClonedNode","toSvg","toPng","draw","toJpeg","quality","toPixelData","getContext","getImageData","toCanvas","exports","module","Node","globalThis","ownerWindow","copyOptions","restorations","originalChild","originalParent","parentNode","wrappingSpan","replaceChild","append","parent","wrapper","clonee","cloneNode","parentComputedStyles","sandbox","makeNodeCopy","adjustCloneBefore","clone","cloneChildren","getParentOfChildren","adjustCloneAfter","processClone","original","originalChildren","getRenderedChildren","originalComputedStyles","getRenderedParent","clonedChild","host","assignedNodes","cloneStyle","clonePseudoElements","copyUserInput","fixSvg","copyFont","source","target","font","fontFamily","fontFeatureSettings","fontKerning","fontSize","fontStretch","fontStyle","fontVariant","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariationSettings","fontWeight","copyStyle","sourceElement","targetElement","sourceComputedStyles","copyUserComputedStyleFast","removeProperty","prop","cloneClassName","clonePseudoElement","content","currentClass","getAttribute","styleElement","setAttribute","formatPseudoElementStyle","selector","formatCssText","formatCssProperties","createTextNode","styleText","formatProperty","name","propertyValue","propertyPriority","innerHTML","attribute","disableEmbedFonts","embedFonts","inlineImages","bgcolor","backgroundColor","property","onCloneResult","onclone","svg","XMLSerializer","serializeToString","xhtml","foreignObjectSizing","restoration","pop","removeChild","removeDefaultStylesTimeoutId","clearTimeout","tagNameDefaultStyles","domNode","scale","ctx","fillStyle","fillRect","msImageSmoothingEnabled","imageSmoothingEnabled","drawImage","styleNode","defaultStyle","tagKey","tagHierarchy","_","sourceNode","tagNames","tagName","ascentStoppers","includes","defaultElement","sandboxDocument","childTagName","childElement","textContent","sandboxWindow","contentWindow","charsetToUse","characterSet","docTypeDeclaration","docType","doctype","escapeHTML","publicId","systemId","trim","id","visibility","position","tryTechniques","charset","title","write","metaCharset","sandboxHTML","documentElement","outerHTML","contentDocument","unsafeText","div","innerText","defaultComputedStyle","destroyElementHierarchy","parentElement","targetStyle","needs_prefixing","sourceValue","defaultValue","parentValue","this"],"mappings":";CAAWA,IAGP,IAAMC,GAimBN,KACIC,IAAIC,EAAY,EAEhB,MAAO,CACHC,OA+UJ,SAAqBC,GACjB,OAAOA,EAAOC,QAAQ,yBAA0B,MAAM,CAC1D,EAhVIC,UAuGJ,SAAmBC,GACf,MAAkC,CAAC,IAA5BA,EAAIC,OAAO,UAAU,CAChC,EAxGIC,aAgIJ,SAAsBC,GAClB,GAAIA,EAAOC,OACP,OAAO,IAAIC,QAAQ,SAAUC,GACzBH,EAAOC,OAAOE,CAAO,CACzB,CAAC,EAGL,OAzBYH,GACL,IAAIE,QAAQ,SAAUC,GACzB,IAAMC,EAAeC,EAAKL,EAAOM,UAAU,EAAEC,MAAM,GAAG,EAAE,EAAE,EACpDC,EAASJ,EAAaI,OACtBC,EAAc,IAAIC,WAAWF,CAAM,EAEzC,IAAKjB,IAAIoB,EAAI,EAAGA,EAAIH,EAAQG,CAAC,GACzBF,EAAYE,GAAKP,EAAaQ,WAAWD,CAAC,EAG9CR,EACI,IAAIU,KAAK,CAACJ,GAAc,CACpBK,KAAM,WACV,CAAC,CACL,CACJ,CAAC,GAUad,CAAM,CACxB,EAvIIe,WAyIJ,SAAoBlB,EAAKmB,GACrB,IA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,EAAMzL,EAAO2F,CAAQ,EACzC2K,GACAD,EAAYvK,YAAY,WAAW2F,EAAQzL,EAAO2F,CAAQ,IAG9D0K,EAAYvK,YAAY2F,EAAMzL,CAAK,EAC/BsQ,GACAD,EAAYvK,YAAY,WAAW2F,EAAQzL,CAAK,GAqCxD,CAAC,CACL,CAEAzI,IAAIuV,EAA+B,KAC/BE,EAAuB,GAErBiB,EAAiB,CAEnB,UACA,UACA,QACA,aACA,UACA,SACA,KACA,MACA,KACA,KACA,WACA,aACA,SACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,SACA,SACA,KACA,KACA,OACA,MACA,KACA,IACA,MACA,UACA,MACA,QACA,KAEA,OACA,MAEA,OACA,OACA,OAuLP,GAAEyC,IAAI"} \ No newline at end of file +{"version":3,"file":"dom-to-image-more.min.js","sources":["../src/dom-to-image-more.js"],"names":["global","util","let","uid_index","escape","string","replace","isDataUrl","url","search","canvasToBlob","canvas","toBlob","Promise","resolve","binaryString","atob","toDataURL","split","length","binaryArray","Uint8Array","i","charCodeAt","Blob","type","resolveUrl","baseUrl","doc","document","implementation","createHTMLDocument","base","createElement","a","head","appendChild","body","href","getAndEncode","cacheEntry","domtoimage","impl","urlCache","find","el","promise","push","options","cacheBust","test","Date","getTime","httpTimeout","request","XMLHttpRequest","onreadystatechange","readyState","status","placeholder","fail","encoder","FileReader","onloadend","result","readAsDataURL","response","ontimeout","responseType","timeout","useCredentialsFilters","useCredentials","filter","credentialsFilter","withCredentials","corsImg","indexOf","window","location","origin","method","toUpperCase","open","isJson","headers","corsData","Object","keys","forEach","key","setRequestHeader","data","JSON","parse","stringify","e","toString","send","message","console","error","imagePlaceholder","uid","Math","random","pow","slice","delay","ms","arg","setTimeout","asArray","arrayLike","array","escapeXhtml","makeImage","uri","reject","image","Image","crossOrigin","onload","requestAnimationFrame","onerror","src","width","node","px","isNaN","leftBorder","rightBorder","scrollWidth","height","topBorder","bottomBorder","scrollHeight","getWindow","isElement","isElementHostForOpenShadowRoot","value","shadowRoot","isShadowRoot","isInShadowRoot","isHTMLElement","HTMLElement","isHTMLCanvasElement","HTMLCanvasElement","isHTMLInputElement","HTMLInputElement","isHTMLImageElement","HTMLImageElement","isHTMLLinkElement","HTMLLinkElement","isHTMLScriptElement","HTMLScriptElement","isHTMLStyleElement","HTMLStyleElement","isHTMLTextAreaElement","HTMLTextAreaElement","isShadowSlotElement","HTMLSlotElement","isSVGElement","SVGElement","isSVGRectElement","SVGRectElement","isDimensionMissing","ownerDocument","undefined","defaultView","ShadowRoot","getRootNode","Element","styleProperty","nodeType","ELEMENT_NODE","getComputedStyle","getPropertyValue","parseFloat","NaN","inliner","URL_REGEX","inlineAll","get","shouldProcess","then","readUrls","urls","done","prefix","inline","match","exec","urlValue","dataUrl","RegExp","fontFaces","resolveAll","readAll","webFonts","all","map","webFont","cssStrings","join","styleSheets","cssRules","sheet","sheetProto","getPrototypeOf","prototype","hasOwnProperty","call","bind","rule","CSSRule","FONT_FACE_RULE","style","rules","newWebFont","webFontRule","parentStyleSheet","cssText","images","inlineCSSProperty","newImage","childNodes","child","properties","inliningTasks","propertyName","priority","getPropertyPriority","inlinedValue","setProperty","element","defaultOptions","copyDefaultStyles","styleCaching","adjustClonedNode","toSvg","toPng","draw","toJpeg","quality","toPixelData","getContext","getImageData","toCanvas","exports","module","Node","globalThis","ownerWindow","copyOptions","restorations","originalChild","originalParent","parentNode","wrappingSpan","replaceChild","append","parent","wrapper","clonee","cloneNode","parentComputedStyles","sandbox","makeNodeCopy","adjustCloneBefore","clone","cloneChildren","getParentOfChildren","adjustCloneAfter","processClone","original","originalChildren","getRenderedChildren","originalComputedStyles","getRenderedParent","clonedChild","host","assignedNodes","cloneStyle","clonePseudoElements","copyUserInput","fixSvg","copyFont","source","target","font","fontFamily","fontFeatureSettings","fontKerning","fontSize","fontStretch","fontStyle","fontVariant","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariationSettings","fontWeight","copyStyle","sourceElement","targetElement","sourceComputedStyles","copyUserComputedStyleFast","removeProperty","prop","cloneClassName","clonePseudoElement","content","currentClass","getAttribute","styleElement","setAttribute","formatPseudoElementStyle","selector","formatCssText","formatCssProperties","createTextNode","styleText","formatProperty","name","propertyValue","propertyPriority","innerHTML","attribute","disableEmbedFonts","embedFonts","inlineImages","bgcolor","backgroundColor","property","onCloneResult","onclone","svg","XMLSerializer","serializeToString","xhtml","foreignObjectSizing","restoration","pop","removeChild","removeDefaultStylesTimeoutId","clearTimeout","tagNameDefaultStyles","domNode","scale","ctx","fillStyle","fillRect","msImageSmoothingEnabled","imageSmoothingEnabled","drawImage","styleNode","defaultStyle","tagKey","tagHierarchy","_","sourceNode","tagNames","tagName","ascentStoppers","includes","defaultElement","sandboxDocument","childTagName","childElement","textContent","sandboxWindow","contentWindow","charsetToUse","characterSet","docTypeDeclaration","docType","doctype","escapeHTML","publicId","systemId","trim","id","visibility","position","tryTechniques","charset","title","write","metaCharset","sandboxHTML","documentElement","outerHTML","contentDocument","unsafeText","div","innerText","defaultComputedStyle","destroyElementHierarchy","parentElement","targetStyle","needs_prefixing","sourceValue","defaultValue","parentValue","this"],"mappings":";CAAWA,IAGP,IAAMC,GAimBN,KACIC,IAAIC,EAAY,EAEhB,MAAO,CACHC,OAgVJ,SAAqBC,GACjB,OAAOA,EAAOC,QAAQ,yBAA0B,MAAM,CAC1D,EAjVIC,UAwGJ,SAAmBC,GACf,MAAkC,CAAC,IAA5BA,EAAIC,OAAO,UAAU,CAChC,EAzGIC,aAiIJ,SAAsBC,GAClB,GAAIA,EAAOC,OACP,OAAO,IAAIC,QAAQ,SAAUC,GACzBH,EAAOC,OAAOE,CAAO,CACzB,CAAC,EAGL,OAzBYH,GACL,IAAIE,QAAQ,SAAUC,GACzB,IAAMC,EAAeC,EAAKL,EAAOM,UAAU,EAAEC,MAAM,GAAG,EAAE,EAAE,EACpDC,EAASJ,EAAaI,OACtBC,EAAc,IAAIC,WAAWF,CAAM,EAEzC,IAAKjB,IAAI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GACf1I,GAAwByI,IAAgBE,KAEnC9K,EAAW4E,EAAqB3E,oBAAoB6F,CAAI,EA5ChD4E,EA6CGA,EA7CgBrQ,EA6CGuQ,EA7CI5K,EA6CSA,EA5CnD2K,EAAuD,GAArC,CAAC,mBAAmBrU,QADTwP,EA6CGA,CA5CkB,EACpD9F,GACA0K,EAAYvK,YAAY2F,EAAMzL,EAAO2F,CAAQ,EACzC2K,GACAD,EAAYvK,YAAY,WAAW2F,EAAQzL,EAAO2F,CAAQ,IAG9D0K,EAAYvK,YAAY2F,EAAMzL,CAAK,EAC/BsQ,GACAD,EAAYvK,YAAY,WAAW2F,EAAQzL,CAAK,GAqCxD,CAAC,CACL,CAEAzI,IAAIuV,EAA+B,KAC/BE,EAAuB,GAErBiB,EAAiB,CAEnB,UACA,UACA,QACA,aACA,UACA,SACA,KACA,MACA,KACA,KACA,WACA,aACA,SACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,SACA,SACA,KACA,KACA,OACA,MACA,KACA,IACA,MACA,UACA,MACA,QACA,KAEA,OACA,MAEA,OACA,OACA,OAuLP,GAAEyC,IAAI"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5aed21bf..2e7c30d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dom-to-image-more", - "version": "3.4.5-beta.0", + "version": "3.4.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dom-to-image-more", - "version": "3.4.5-beta.0", + "version": "3.4.5", "license": "MIT", "devDependencies": { "chai": "^4.3.10", diff --git a/package.json b/package.json index 3509728f..351d9135 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dom-to-image-more", - "version": "3.4.5-beta.0", + "version": "3.4.5", "description": "Generates an image from a DOM node using HTML5 canvas and SVG", "main": "dist/dom-to-image-more.min.js", "devDependencies": { @@ -69,7 +69,8 @@ "Shi Wenyu @cWenyu", "David Burns @davidburns573", "Yujia Cheng @YujiaCheng1996", - "Julien Dorra @juliendorra" + "Julien Dorra @juliendorra", + "Sean Zhang @SeanZhang-eaton" ], "license": "MIT", "bugs": { diff --git a/src/dom-to-image-more.js b/src/dom-to-image-more.js index 2f60755f..a1295f80 100644 --- a/src/dom-to-image-more.js +++ b/src/dom-to-image-more.js @@ -664,7 +664,8 @@ function isInShadowRoot(value) { // not calling the method, getting the method - if (value === null || value === undefined || value.getRootNode === undefined) return false; + if (value === null || value === undefined || value.getRootNode === undefined) + return false; return isShadowRoot(value.getRootNode()); } @@ -950,7 +951,7 @@ } function escapeRegEx(string) { - return string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); + return string.replace(/([.*+?^${}()|[\]/\\])/g, '\\$1'); } function delay(ms) {