fileuploader fixed - #120
Closed
veronika-tseleva-cleantalk wants to merge 1 commit into
Closed
Conversation
Copilot started reviewing on behalf of
veronika-tseleva-cleantalk
August 20, 2026 12:03
View session
veronika-tseleva-cleantalk
requested review from
AntonV1211,
Glomberg,
alexander-b-clean,
alexandergull and
svfcode
August 20, 2026 12:03
There was a problem hiding this comment.
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 usehtml2canvaswith anonclonehook 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
spotFixCSSand the updatedFileUploaderimplementation).
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 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 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 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) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.