fileuploader fixed - #121
Open
veronika-tseleva-cleantalk wants to merge 3 commits into
Open
Conversation
Copilot started reviewing on behalf of
veronika-tseleva-cleantalk
August 20, 2026 12:36
View session
veronika-tseleva-cleantalk
requested review from
AntonV1211,
Glomberg,
alexander-b-clean,
alexandergull and
svfcode
August 20, 2026 12:38
There was a problem hiding this comment.
Pull request overview
This PR updates the automatic screenshot flow in FileUploader to improve reliability when capturing pages that can taint canvases (cross-origin CSS/images/iframes), preferring dom-to-image-more when the page appears “safe” and falling back to html2canvas with sanitization.
Changes:
- Added a “page safety” pre-check to decide whether to attempt
dom-to-image-more. - Adjusted
html2canvasoptions and added anonclonehook to remove/replace elements that can taint screenshots. - Updated the built bundle to reflect the source changes.
Reviewed changes
Copilot reviewed 1 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| js/src/fileuploader.js | Adds safety detection and refactors screenshot capture to prefer dom-to-image-more and sanitize html2canvas rendering. |
| dist/doboard-widget-bundle.js | Regenerated bundle including the updated screenshot logic. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
veronika-tseleva-cleantalk
August 20, 2026 12:43
View session
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (3)
js/src/fileuploader.js:425
sheet.cssRulesis only being read to detect cross-origin stylesheets, but the assignedrulesvariable is unused. This can triggerno-unused-varslinting and makes the intent less clear; just access the property without assigning it (or usevoid).
try {
const rules = sheet.cssRules;
} catch (e) {
js/src/fileuploader.js:444
isPageSafeForDomToImage()returnsnullon URL parsing errors, but callers treat the result as a boolean (if (isSafe)). Returning a non-boolean makes behavior harder to reason about; returningfalsekeeps the contract consistent and still routes to the html2canvas fallback.
} catch (e){
return null;
}
js/src/fileuploader.js:457
- The guard condition also covers an uninitialized/invalid
this.files(!this.files || !Array.isArray(this.files)), but the log message only mentions the file-count limit. This can mislead debugging when the uploader isn't initialized yet.
if (!this.files || !Array.isArray(this.files) || this.files.length >= this.maxFiles) {
console.log('SpotFix: File count limit reached.');
return;
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.