Skip to content

fileuploader fixed - #120

Closed
veronika-tseleva-cleantalk wants to merge 1 commit into
devfrom
fix_55346
Closed

fileuploader fixed#120
veronika-tseleva-cleantalk wants to merge 1 commit into
devfrom
fix_55346

Conversation

@veronika-tseleva-cleantalk

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the file uploader’s automatic screenshot capture logic to rely on html2canvas with additional DOM sanitization in the cloned document, and syncs the generated dist bundle accordingly.

Changes:

  • Reworked makeScreenshot() to use html2canvas with an onclone hook that removes/neutralizes potentially cross-origin resources.
  • Simplified console messages and screenshot filename formatting.
  • Updated the distribution bundle to reflect the source changes (including relocating spotFixCSS and the updated FileUploader implementation).

Reviewed changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated 3 comments.

File Description
js/src/fileuploader.js Reworks screenshot generation via html2canvas and adjusts validation/logging behavior.
dist/doboard-widget-bundle.js Updates the bundled output to match the new screenshot and CSS placement changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread js/src/fileuploader.js
Comment on lines 419 to 422
if (!this.files || !Array.isArray(this.files) || this.files.length >= this.maxFiles) {
console.log('SpotFix: File count limit reached or file uploader is not fully initialized.');
console.log('SpotFix: File count limit reached.');
return;
}
Comment thread js/src/fileuploader.js
Comment on lines +451 to +455
if (link.href && link.href.includes('fonts.googleapis.com')) {
link.remove();
} else if (link.sheet) {
const rules = link.sheet.cssRules;
}
Comment thread js/src/fileuploader.js
Comment on lines +441 to +447
const canvas = await html2canvas(document.body, {
useCORS: true,
allowTaint: false,
logging: false,
backgroundColor: bgColor,
scale: window.devicePixelRatio || 1,
onclone: (clonedDoc) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants