diff --git a/dist/doboard-widget-bundle.js b/dist/doboard-widget-bundle.js
index a19f78f..a8cd979 100644
--- a/dist/doboard-widget-bundle.js
+++ b/dist/doboard-widget-bundle.js
@@ -13827,6 +13827,8 @@ class FileUploader {
let bgColor = window.getComputedStyle(document.body).backgroundColor;
if (bgColor === 'rgba(0, 0, 0, 0)' || bgColor === 'transparent') bgColor = '#ffffff';
+ const currentOrigin = window.location.origin;
+
try {
const domtoimageLib = await this.loadDomToImage();
if (domtoimageLib) {
@@ -13840,7 +13842,25 @@ class FileUploader {
},
filter: (node) => {
if (node.classList && node.classList.contains('doboard_task_widget')) return false;
- if (node.tagName === 'NOSCRIPT') return false;
+ if (node.tagName === 'NOSCRIPT' || node.tagName === 'IFRAME') return false;
+
+ if (node.tagName === 'IMG' && node.src && node.src.startsWith('http')) {
+ try {
+ const url = new URL(node.src);
+ if (url.origin !== currentOrigin && !node.crossOrigin) return false;
+ } catch (e) {
+ return false;
+ }
+ }
+
+ if (node.tagName === 'LINK' && node.rel === 'stylesheet') {
+ try {
+ if (node.sheet && !node.sheet.cssRules) return false;
+ } catch (e) {
+ return false;
+ }
+ }
+
return true;
}
});
@@ -13869,7 +13889,6 @@ class FileUploader {
windowWidth: document.documentElement.offsetWidth,
windowHeight: document.documentElement.offsetHeight,
onclone: (clonedDoc) => {
- const currentOrigin = window.location.origin;
const transparentPixel = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
clonedDoc.querySelectorAll('img').forEach(img => {
diff --git a/dist/doboard-widget-bundle.min.js b/dist/doboard-widget-bundle.min.js
index 3204ba8..0241a78 100644
--- a/dist/doboard-widget-bundle.min.js
+++ b/dist/doboard-widget-bundle.min.js
@@ -39,7 +39,7 @@
- `),A.querySelector(".doboard_task_widget__file-upload__remove-btn").addEventListener("click",()=>this.removeFile(t)),A}formatFileSize(A){var e;return 0===A?"0 Bytes":(e=Math.floor(Math.log(A)/Math.log(1024)),parseFloat((A/Math.pow(1024,e)).toFixed(2))+" "+this.SIZE_UNITS[e])}showError(A){this.errorMessage&&(this.errorMessage.textContent=A,this.errorMessage.style.display="block")}clearError(){this.errorMessage&&(this.errorMessage.textContent="",this.errorMessage.style.display="none")}hasFiles(){return 0A?.[e],A)}async sendSingleAttachment(A){A=await this.validateFileData(A);return attachmentAddDoboard(A)}async sendAttachmentsForComment(e,t,o){var i={preparedFilesCount:this.files.length,sentFilesCount:0,fileResults:[],success:!0};for(let A=0;A{var t;window.domtoimage?A(window.domtoimage):((t=document.createElement("script")).src="https://cdn.jsdelivr.net/npm/dom-to-image-more@3.1.6/dist/dom-to-image-more.min.js",t.onload=()=>A(window.domtoimage),t.onerror=()=>e(new Error("Failed to load dom-to-image-more")),document.head.appendChild(t))})}async makeScreenshot(){if(!this.files||!Array.isArray(this.files)||this.files.length>=this.maxFiles)console.log("SpotFix: File count limit reached.");else if("function"==typeof this.getTotalSize&&this.getTotalSize()>=this.maxTotalSize)console.log("SpotFix: Size limit reached.");else{let t=null,A=window.getComputedStyle(document.body).backgroundColor;"rgba(0, 0, 0, 0)"!==A&&"transparent"!==A||(A="#ffffff");try{var e=await this.loadDomToImage();e&&(t=await e.toBlob(document.body,{bgcolor:A,width:window.innerWidth,height:window.innerHeight,style:{transform:`translate(${-window.scrollX}px, ${-window.scrollY}px)`,backgroundColor:A},filter:A=>!(A.classList&&A.classList.contains("doboard_task_widget")||"NOSCRIPT"===A.tagName)}))}catch(A){console.warn(A.message),t=null}if(!t)try{if("undefined"==typeof html2canvas)throw new Error("html2canvas is not defined");document.fonts&&document.fonts.ready&&await document.fonts.ready;let e=await html2canvas(document.body,{useCORS:!0,allowTaint:!1,logging:!1,backgroundColor:A,scale:window.devicePixelRatio||1,x:window.scrollX,y:window.scrollY,width:window.innerWidth,height:window.innerHeight,windowWidth:document.documentElement.offsetWidth,windowHeight:document.documentElement.offsetHeight,onclone:A=>{let e=window.location.origin;A.querySelectorAll("img").forEach(A=>{try{A.src&&A.src.startsWith("http")&&(new URL(A.src).origin===e||A.crossOrigin||(A.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",A.removeAttribute("srcset")))}catch(A){}}),A.querySelectorAll("iframe").forEach(A=>A.remove()),A.querySelectorAll(".doboard_task_widget").forEach(A=>A.style.display="none")}});if(!(t=await new Promise(A=>e.toBlob(A,"image/png"))))throw new Error("html2canvas returned empty canvas")}catch(A){return console.error(A),null}t&&(e=`Screenshot_${(e=new Date).getHours()}-${e.getMinutes()}_${e.getDate()}_${e.getMonth()+1}_${e.getFullYear()}.png`,e=new File([t],e,{type:"image/png",lastModified:Date.now()}),"function"==typeof this.validateFile)&&this.validateFile(e)&&(this.uploaderWrapper?.style&&(this.uploaderWrapper.style.display="block"),"function"==typeof this.clearError&&this.clearError(),"function"==typeof this.addFile)&&this.addFile(e)}}}class SpotFixTemplatesLoader{static getTemplateCode(A){var e=this[A];if("function"!=typeof e)throw new Error(`Template method '${A}' not found`);return e.call(this).trim()}static all_issues(){return`
+ `),A.querySelector(".doboard_task_widget__file-upload__remove-btn").addEventListener("click",()=>this.removeFile(t)),A}formatFileSize(A){var e;return 0===A?"0 Bytes":(e=Math.floor(Math.log(A)/Math.log(1024)),parseFloat((A/Math.pow(1024,e)).toFixed(2))+" "+this.SIZE_UNITS[e])}showError(A){this.errorMessage&&(this.errorMessage.textContent=A,this.errorMessage.style.display="block")}clearError(){this.errorMessage&&(this.errorMessage.textContent="",this.errorMessage.style.display="none")}hasFiles(){return 0A?.[e],A)}async sendSingleAttachment(A){A=await this.validateFileData(A);return attachmentAddDoboard(A)}async sendAttachmentsForComment(e,t,o){var i={preparedFilesCount:this.files.length,sentFilesCount:0,fileResults:[],success:!0};for(let A=0;A{var t;window.domtoimage?A(window.domtoimage):((t=document.createElement("script")).src="https://cdn.jsdelivr.net/npm/dom-to-image-more@3.1.6/dist/dom-to-image-more.min.js",t.onload=()=>A(window.domtoimage),t.onerror=()=>e(new Error("Failed to load dom-to-image-more")),document.head.appendChild(t))})}async makeScreenshot(){if(!this.files||!Array.isArray(this.files)||this.files.length>=this.maxFiles)console.log("SpotFix: File count limit reached.");else if("function"==typeof this.getTotalSize&&this.getTotalSize()>=this.maxTotalSize)console.log("SpotFix: Size limit reached.");else{let t=null,A=window.getComputedStyle(document.body).backgroundColor,o=("rgba(0, 0, 0, 0)"!==A&&"transparent"!==A||(A="#ffffff"),window.location.origin);try{var e=await this.loadDomToImage();e&&(t=await e.toBlob(document.body,{bgcolor:A,width:window.innerWidth,height:window.innerHeight,style:{transform:`translate(${-window.scrollX}px, ${-window.scrollY}px)`,backgroundColor:A},filter:A=>{if(A.classList&&A.classList.contains("doboard_task_widget"))return!1;if("NOSCRIPT"===A.tagName||"IFRAME"===A.tagName)return!1;if("IMG"===A.tagName&&A.src&&A.src.startsWith("http"))try{if(new URL(A.src).origin!==o&&!A.crossOrigin)return!1}catch(A){return!1}if("LINK"===A.tagName&&"stylesheet"===A.rel)try{if(A.sheet&&!A.sheet.cssRules)return!1}catch(A){return!1}return!0}}))}catch(A){console.warn(A.message),t=null}if(!t)try{if("undefined"==typeof html2canvas)throw new Error("html2canvas is not defined");document.fonts&&document.fonts.ready&&await document.fonts.ready;let e=await html2canvas(document.body,{useCORS:!0,allowTaint:!1,logging:!1,backgroundColor:A,scale:window.devicePixelRatio||1,x:window.scrollX,y:window.scrollY,width:window.innerWidth,height:window.innerHeight,windowWidth:document.documentElement.offsetWidth,windowHeight:document.documentElement.offsetHeight,onclone:A=>{A.querySelectorAll("img").forEach(A=>{try{A.src&&A.src.startsWith("http")&&(new URL(A.src).origin===o||A.crossOrigin||(A.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",A.removeAttribute("srcset")))}catch(A){}}),A.querySelectorAll("iframe").forEach(A=>A.remove()),A.querySelectorAll(".doboard_task_widget").forEach(A=>A.style.display="none")}});if(!(t=await new Promise(A=>e.toBlob(A,"image/png"))))throw new Error("html2canvas returned empty canvas")}catch(A){return console.error(A),null}t&&(e=`Screenshot_${(e=new Date).getHours()}-${e.getMinutes()}_${e.getDate()}_${e.getMonth()+1}_${e.getFullYear()}.png`,e=new File([t],e,{type:"image/png",lastModified:Date.now()}),"function"==typeof this.validateFile)&&this.validateFile(e)&&(this.uploaderWrapper?.style&&(this.uploaderWrapper.style.display="block"),"function"==typeof this.clearError&&this.clearError(),"function"==typeof this.addFile)&&this.addFile(e)}}}class SpotFixTemplatesLoader{static getTemplateCode(A){var e=this[A];if("function"!=typeof e)throw new Error(`Template method '${A}' not found`);return e.call(this).trim()}static all_issues(){return`