From e7d6ab0535a2477eb1a2b7226105fa1b7c6075a1 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Wed, 11 Sep 2024 16:26:51 -0500 Subject: [PATCH] Resolving browser incompatibities Also update author credits. --- README.md | 2 +- dist/dom-to-image-more.min.js | 4 +- dist/dom-to-image-more.min.js.map | 2 +- package-lock.json | 93 +++++++++++++++++-------------- package.json | 7 ++- src/dom-to-image-more.js | 11 ++-- 6 files changed, 64 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 39f9b21e..b7f21223 100644 --- a/README.md +++ b/README.md @@ -386,7 +386,7 @@ 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) +optional), Julien Dorra @juliendorra (documentation) ## License diff --git a/dist/dom-to-image-more.min.js b/dist/dom-to-image-more.min.js index 5bdd693e..572b32cd 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 29-08-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){if("cssRules"in Object.getPrototypeOf(t))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); +/*! dom-to-image-more 11-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); //# 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 e74bdb0a..bc945d16 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","getPrototypeOf","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,OAiVJ,SAAqBC,GACjB,OAAOA,EAAOC,QAAQ,yBAA0B,MAAM,CAC1D,EAlVIC,UAyGJ,SAAmBC,GACf,MAAkC,CAAC,IAA5BA,EA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,QAAQ,SAAUwO,GACjD,IA3BE6E,EA2BIC,EAAchG,EAAqB9H,iBAAiBgJ,CAAI,EACxD+E,EAAe9C,EAAajC,GAC5BgF,EAAc3I,EACdA,EAAqBrF,iBAAiBgJ,CAAI,EAC1CzJ,KAAAA,EAGcqO,EAAY5N,iBAAiBgJ,CAAI,IAMjD8E,IAAgBC,GACf1I,GAAwByI,IAAgBE,KAEnC9K,EAAW4E,EAAqB3E,oBAAoB6F,CAAI,EA5ChD4E,EA6CGA,EA7CgBjQ,EA6CGmQ,EA7CI5K,EA6CSA,EA5CnD2K,EAAuD,GAArC,CAAC,mBAAmBjU,QADToP,EA6CGA,CA5CkB,EACpD9F,GACA0K,EAAYvK,YAAY2F,EAAMrL,EAAOuF,CAAQ,EACzC2K,GACAD,EAAYvK,YAAY,WAAW2F,EAAQrL,EAAOuF,CAAQ,IAG9D0K,EAAYvK,YAAY2F,EAAMrL,CAAK,EAC/BkQ,GACAD,EAAYvK,YAAY,WAAW2F,EAAQrL,CAAK,GAqCxD,CAAC,CACL,CAEAzI,IAAImV,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,OA+U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GACAA,EAAcvD,YAAY9G,CAAO,EAErCA,EAAUqK,CACd,OAASrK,GAA+B,SAApBA,EAAQiI,SAtEhC,OADAhB,EAAqBW,GAAUD,CAb/B,CAsFJ,GAtK0BrT,EAASgQ,CAAa,EACtC,GACAgG,EAAc/F,EAAczF,MAElCvN,EAAK8G,QAAQmM,CAAoB,EAAE1N,QAAQ,SAAU4O,GACjD,IA3BE6E,EA2BIC,EAAchG,EAAqBlI,iBAAiBoJ,CAAI,EACxD+E,EAAe9C,EAAajC,GAC5BgF,EAAc3I,EACdA,EAAqBzF,iBAAiBoJ,CAAI,EAC1C7J,KAAAA,EAGcyO,EAAYhO,iBAAiBoJ,CAAI,IAMjD8E,IAAgBC,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 0de5d363..41942291 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "dom-to-image-more", - "version": "3.4.3", + "version": "3.4.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dom-to-image-more", - "version": "3.4.3", + "version": "3.4.4", "license": "MIT", "devDependencies": { "chai": "^4.3.10", - "eslint": "^9.9.1", + "eslint": "^9.10.0", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "grunt-contrib-jshint": "^3.2.0", @@ -118,9 +118,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", - "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz", + "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==", "dev": true, "license": "MIT", "engines": { @@ -137,6 +137,19 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/plugin-kit": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz", + "integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -228,9 +241,9 @@ } }, "node_modules/@types/node": { - "version": "22.5.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.1.tgz", - "integrity": "sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==", + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", "dev": true, "license": "MIT", "dependencies": { @@ -438,9 +451,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "license": "MIT", "dependencies": { @@ -452,7 +465,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -884,13 +897,13 @@ } }, "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1219,9 +1232,9 @@ } }, "node_modules/eslint": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", - "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz", + "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==", "dev": true, "license": "MIT", "dependencies": { @@ -1229,7 +1242,8 @@ "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.9.1", + "@eslint/js": "9.10.0", + "@eslint/plugin-kit": "^0.1.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -1252,7 +1266,6 @@ "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", @@ -1666,9 +1679,9 @@ "license": "ISC" }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -3504,13 +3517,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -3528,9 +3534,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, @@ -3943,13 +3949,13 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -4578,9 +4584,9 @@ } }, "node_modules/ua-parser-js": { - "version": "0.7.38", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.38.tgz", - "integrity": "sha512-fYmIy7fKTSFAhG3fuPlubeGaMoAd6r0rSnfEsO5nEY55i26KSLt9EH7PLQiiqPUhNqYIJvSkTy1oArIcXAbPbA==", + "version": "0.7.39", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.39.tgz", + "integrity": "sha512-IZ6acm6RhQHNibSt7+c09hhvsKy9WUr4DVbeq9U8o71qxyYtJpQeDxQnMrVqnIFMLcQjHO0I9wgfO2vIahht4w==", "dev": true, "funding": [ { @@ -4597,6 +4603,9 @@ } ], "license": "MIT", + "bin": { + "ua-parser-js": "script/cli.js" + }, "engines": { "node": "*" } diff --git a/package.json b/package.json index 92761872..c8fb3e51 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "dom-to-image-more", - "version": "3.4.3", + "version": "3.4.4", "description": "Generates an image from a DOM node using HTML5 canvas and SVG", "main": "dist/dom-to-image-more.min.js", "devDependencies": { "chai": "^4.3.10", - "eslint": "^9.9.1", + "eslint": "^9.10.0", "grunt": "^1.6.1", "grunt-cli": "^1.5.0", "grunt-contrib-jshint": "^3.2.0", @@ -68,7 +68,8 @@ "Aravind @codesculpture", "Shi Wenyu @cWenyu", "David Burns @davidburns573", - "Yujia Cheng @YujiaCheng1996" + "Yujia Cheng @YujiaCheng1996", + "Julien Dorra @juliendorra" ], "license": "MIT", "bugs": { diff --git a/src/dom-to-image-more.js b/src/dom-to-image-more.js index 2d5b2941..974cbe1c 100644 --- a/src/dom-to-image-more.js +++ b/src/dom-to-image-more.js @@ -663,11 +663,9 @@ } function isInShadowRoot(value) { - return ( - value !== null && - 'getRootNode' in value && - isShadowRoot(value.getRootNode()) - ); + // not calling the method, getting the method + if (value === null || value === undefined || value.getRootNode === undefined) return false; + return isShadowRoot(value.getRootNode()); } function isElement(value) { @@ -1123,7 +1121,8 @@ function getCssRules(styleSheets) { const cssRules = []; styleSheets.forEach(function (sheet) { - if ('cssRules' in Object.getPrototypeOf(sheet)) { + const sheetProto = Object.getPrototypeOf(sheet); + if (Object.prototype.hasOwnProperty.call(sheetProto, 'cssRules')) { try { util.asArray(sheet.cssRules || []).forEach( cssRules.push.bind(cssRules)