Skip to content

feat(intelligent-assistant): add screenshot capture utility with sensitive data redaction - #4210

Open
its-mitesh-kumar wants to merge 4 commits into
redhat-developer:mainfrom
its-mitesh-kumar:feat/intelligent-assistant-screen-capture-utility
Open

feat(intelligent-assistant): add screenshot capture utility with sensitive data redaction#4210
its-mitesh-kumar wants to merge 4 commits into
redhat-developer:mainfrom
its-mitesh-kumar:feat/intelligent-assistant-screen-capture-utility

Conversation

@its-mitesh-kumar

@its-mitesh-kumar its-mitesh-kumar commented Aug 9, 2026

Copy link
Copy Markdown
Member

Description

Adds an on-demand screenshot capture utility for the intelligent-assistant plugin's deep context awareness feature. The implementation uses html2canvas-pro to capture the current RHDH page view with WebP-first format negotiation (JPEG fallback), a sensitive data redaction layer that sanitizes passwords, tokens, and secrets from the captured DOM, and performance guardrails including tab visibility checks, idle scheduling, and a configurable timeout. The backend validation is also extended to accept WebP image attachments alongside JPEG.

Fixed

Screenshots example

S_.2026-08-09.at.11.28.32.PM.mov
screenshot-1786298094918 screenshot-1786298176913 screenshot-1786298316493

Steps to Test

  1. Add the following to app-config.yaml:
    intelligent-assistant:
      screen-context:
        enabled: true
        screenshots:
          enabled: true
  2. Cherry-pick the test helper commit to enable screenshot download on every message send:
git cherry-pick 97e764fa1

This commit (97e764fa1 from branch test/screen-capture-helper) adds temporary code that triggers captureScreenshot() on send and auto-downloads the result. Revert it before merging.

Then:

  1. Run yarn start from the workspace root
  2. Open the Intelligent Assistant chat panel
  3. Send any message — a screenshot should auto-download
  4. Verify:
    • The downloaded image is in WebP format (or JPEG if your browser doesn't support WebP)
    • The chatbot panel itself is excluded from the screenshot
    • Any passwords/tokens visible on the page are redacted in the screenshot
    • Console shows capture metrics (format, size, dimensions, time)

Verifying Sensitive Data Redaction

  1. Navigate to a page with visible secrets (e.g., a secret details page with "Show secret" toggle revealed)
  2. Trigger screenshot capture (send a message)
  3. Confirm the downloaded screenshot shows [REDACTED] instead of actual secret values

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

…itive data redaction

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-intelligent-assistant-backend workspaces/intelligent-assistant/plugins/intelligent-assistant-backend patch v3.2.0
@red-hat-developer-hub/backstage-plugin-intelligent-assistant workspaces/intelligent-assistant/plugins/intelligent-assistant minor v3.2.0

@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Add screen-context screenshot capture with redaction and WebP support

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add on-demand screen capture utility with WebP-first encoding, scaling, and timeouts.
• Redact secrets from the cloned DOM before rendering screenshots (inputs + token patterns).
• Extend backend attachment validation to accept WebP images alongside JPEG.
Diagram

graph TD
  ui["RHDH page"] --> cap["Screen capture"] --> h2c[["html2canvas-pro"]] --> attach["Image (WebP/JPEG)"] --> be(["Backend validation"]) --> llm["Vision model"]
  cap --> red["DOM redactor"]
  red -. "onclone sanitize" .-> h2c
  subgraph Legend
    direction LR
    _mod["Module"] ~~~ _ext[["External lib"]] ~~~ _svc(["Backend svc"])
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use native getDisplayMedia capture
  • ➕ Captures the real screen including non-DOM content (e.g., video, canvas, iframes) when permitted
  • ➕ Browser-managed permissions and potentially higher-fidelity captures
  • ➖ Requires user permission prompts and can be blocked by policy
  • ➖ Captures outside the app boundary (higher privacy risk)
  • ➖ More complex UX and error handling than DOM snapshotting
2. Opt-in/allowlist redaction instead of regex scanning
  • ➕ Lower risk of false positives/false negatives vs broad token regexes
  • ➕ Teams can explicitly mark sensitive regions/fields for masking
  • ➖ Requires product teams to consistently annotate sensitive UI
  • ➖ Misses secrets in unannotated areas; operational burden to keep up-to-date
3. Server-side image validation via MIME sniffing library
  • ➕ More robust format verification than magic bytes alone
  • ➕ Easier extension to additional formats later
  • ➖ Adds backend dependency/complexity and potentially higher CPU cost
  • ➖ Current JPEG/WebP magic-byte checks are sufficient for scoped support

Recommendation: Keep the current approach (DOM snapshot + onclone sanitization + WebP-first) as the best default for an in-app assistant because it avoids permission prompts and limits capture scope. Consider adding an explicit opt-in/allowlist annotation mechanism over time (in addition to regex scanning) to reduce both over-redaction and missed secrets as UI surfaces evolve.

Files changed (11) +1111 / -8

Enhancement (3) +363 / -6
validation.tsAccept WebP images in attachment validation +22/-6

Accept WebP images in attachment validation

• Extends image magic-byte validation from JPEG-only to JPEG-or-WebP, and updates user-facing error messages accordingly. Also generalizes the non-vision model error to refer to images rather than JPEG specifically.

workspaces/intelligent-assistant/plugins/intelligent-assistant-backend/src/service/validation.ts

screen-capture.tsNew screenshot capture utility with guardrails and WebP-first encoding +197/-0

New screenshot capture utility with guardrails and WebP-first encoding

• Implements on-demand capture via html2canvas-pro with onclone DOM sanitization, element exclusion rules, max-width scaling, WebP-first encoding (JPEG fallback), idle deferral, tab visibility checks, and a configurable timeout. Returns base64 payloads without data-URI prefixes plus capture metadata.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts

sensitive-data-redactor.tsNew sensitive-data redaction layer for cloned DOM screenshots +144/-0

New sensitive-data redaction layer for cloned DOM screenshots

• Implements masking/redaction utilities: regex-based token scrubbing for text nodes, label/aria-based heuristics for detecting sensitive inputs, and a sanitizer that mutates the cloned DOM before rendering to canvas (including a special-case for hide-secret patterns).

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/sensitive-data-redactor.ts

Tests (4) +669 / -2
router.test.tsUpdate router test error text for non-vision models +1/-1

Update router test error text for non-vision models

• Adjusts a test expectation to match the new generic error messaging when a selected model does not support images (not just JPEG).

workspaces/intelligent-assistant/plugins/intelligent-assistant-backend/src/service/router.test.ts

validation.test.tsAdd WebP coverage to attachment validation tests +82/-1

Add WebP coverage to attachment validation tests

• Updates the invalid-image error message to mention JPEG or WebP and adds new tests to accept WebP magic bytes (with and without data URL prefix) while still rejecting PNG.

workspaces/intelligent-assistant/plugins/intelligent-assistant-backend/src/service/validation.test.ts

screen-capture.test.tsUnit tests for screenshot capture utility +310/-0

Unit tests for screenshot capture utility

• Adds tests covering WebP-first negotiation with JPEG fallback, visibility and timeout guardrails, root element discovery, exclude rules, scaling behavior, idle scheduling fallback, and capture time reporting.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/tests/screen-capture.test.ts

sensitive-data-redactor.test.tsUnit tests for sensitive DOM redaction +276/-0

Unit tests for sensitive DOM redaction

• Adds test coverage for secret/token regex patterns, sensitive label detection (with safe exclusions), masking of sensitive inputs, redaction of text nodes, and handling of show/hide secret UI patterns.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/tests/sensitive-data-redactor.test.ts

Other (4) +79 / -0
swift-foxes-glow.mdChangeset for screen-context screenshot capture feature +6/-0

Changeset for screen-context screenshot capture feature

• Adds a minor-version changeset entry for both frontend and backend intelligent-assistant packages, describing screenshot capture with WebP-first encoding, redaction, and guardrails.

workspaces/intelligent-assistant/.changeset/swift-foxes-glow.md

config.d.tsAdd frontend config schema for screen-context feature flags +27/-0

Add frontend config schema for screen-context feature flags

• Introduces a new optional 'screen-context' configuration section with an overall enablement flag and a nested screenshots enable/disable toggle, marked for frontend visibility.

workspaces/intelligent-assistant/plugins/intelligent-assistant/config.d.ts

package.jsonAdd html2canvas-pro dependency for screen capture +1/-0

Add html2canvas-pro dependency for screen capture

• Adds html2canvas-pro as a runtime dependency for the intelligent-assistant frontend plugin to support DOM-to-canvas rendering.

workspaces/intelligent-assistant/plugins/intelligent-assistant/package.json

yarn.lockLockfile updates for html2canvas-pro and transitive deps +45/-0

Lockfile updates for html2canvas-pro and transitive deps

• Adds lock entries for html2canvas-pro and its transitive dependencies (e.g., css-line-break, text-segmentation, utrie, base64-arraybuffer).

workspaces/intelligent-assistant/yarn.lock

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Aug 9, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Hide-secret redaction is case-sensitive ✓ Resolved 🐞 Bug ⛨ Security
Description
sanitizeClonedDom only detects visibility-toggle secret containers when aria-label contains the
exact-case substrings "Hide secret" or "Hide value". If the UI uses different casing (e.g. "hide
secret"), non-pattern secrets (that don't match SECRET_PATTERNS) can remain visible in screenshots.
Code

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/sensitive-data-redactor.ts[R133-136]

+  clonedDoc
+    .querySelectorAll('[aria-label*="Hide secret"], [aria-label*="Hide value"]')
+    .forEach(btn => {
+      const container = btn.closest('[class*="Box"], [class*="flex"]');
Relevance

●●● Strong

Security redaction robustness likely prioritized; small deterministic change (case-insensitive
match) reduces secret leakage risk.

PR-#3347

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The implementation hard-codes case-sensitive aria-label substring selectors, and the unit test
relies on that selector to mask a value that wouldn't be caught by regex-based redaction.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/sensitive-data-redactor.ts[132-143]
workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/tests/sensitive-data-redactor.test.ts[236-253]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The visibility-toggle masking logic depends on a case-sensitive CSS attribute selector (`[aria-label*="Hide secret"]`). If the label differs in casing/wording, the masking step is skipped and arbitrary secret values (not matching regex token patterns) can leak into the captured screenshot.

### Issue Context
The test demonstrates masking `super-secret-value-123`, which is not a known token format and therefore relies on this visibility-toggle masking path.

### Fix Focus Areas
- workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/sensitive-data-redactor.ts[132-143]
- workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/__tests__/sensitive-data-redactor.test.ts[236-253]

### Suggested fix
- Use case-insensitive attribute selectors: `[aria-label*="hide secret" i], [aria-label*="hide value" i]`.
- Add a regression test for lowercase/mixed-case aria-label values (e.g., `hide secret value`).
- (Optional hardening) Consider also matching additional common phrases (e.g., "Show secret") or normalizing `aria-label` via DOM traversal instead of relying purely on selectors.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Invalid excludeSelector can crash capture ✓ Resolved 🐞 Bug ☼ Reliability
Description
ignoreElements calls element.matches(selector) on the user-supplied excludeSelector without
guarding against invalid CSS selectors, which can throw and fail the entire capture. A malformed
selector input/config would therefore break screenshot capture.
Code

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[R131-134]

+      const selector = options.excludeSelector;
+      if (selector !== DEFAULT_EXCLUDE_SELECTOR && element.matches(selector)) {
+        return true;
+      }
Relevance

●●● Strong

Guarding invalid user/config inputs to avoid crashes matches prior accepted validation/hardening
patterns.

PR-#3536
PR-#3347

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The code passes excludeSelector directly into element.matches(...) with no validation or
exception handling.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[117-137]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`Element.matches()` throws a `DOMException` for invalid selector syntax. Since `excludeSelector` is configurable, a malformed value can cause `doCapture` to throw and the capture to fail.

### Issue Context
This is triggered only when `excludeSelector !== DEFAULT_EXCLUDE_SELECTOR`, but that includes any custom selector supplied by callers/admin config.

### Fix Focus Areas
- workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[124-136]

### Suggested fix
- Wrap the `element.matches(selector)` call in `try/catch` and treat invalid selectors as either:
 - a no-op (return false), or
 - a structured capture error indicating invalid configuration.
- Add a unit test that passes an invalid selector (e.g. `'[data-foo'`) and asserts capture returns a clean error instead of throwing.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Timeout doesn't stop capture 🐞 Bug ☼ Reliability
Description
captureScreenshot returns a timeout error via Promise.race, but the underlying doCapture/html2canvas
work continues running in the background and the timeout timer is never cleared when capture
completes. This can waste CPU/memory and keep doing expensive DOM/canvas work after the caller
already gave up.
Code

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[R181-188]

+    const result = await Promise.race<CaptureResponse>([
+      doCapture(resolvedOptions),
+      new Promise<CaptureError>(resolve =>
+        setTimeout(
+          () => resolve({ success: false, error: 'Capture timeout exceeded' }),
+          resolvedOptions.timeoutMs,
+        ),
+      ),
Relevance

●● Moderate

Timeout cleanup is reasonable, but true cancellation is nontrivial; repo history shows mixed
acceptance on abort/cancel changes.

PR-#2581
PR-#3584

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The timeout is implemented as a competing promise in Promise.race, but there is no
cancellation/short-circuit mechanism or timeout cleanup; doCapture still awaits html2canvas and
then continues processing even if the timeout already resolved the race.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[107-155]
workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[180-190]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`captureScreenshot` uses `Promise.race([doCapture(), timeoutPromise])` but does not clear the timeout when capture finishes, and does not cooperatively short-circuit the capture path when the timeout wins. This leaves extra timers scheduled and allows expensive capture processing to continue after the API returns a timeout result.

### Issue Context
`doCapture` awaits `html2canvas(...)` and then does scaling + encoding; when the timeout promise wins, none of this work is stopped.

### Fix Focus Areas
- workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[107-155]
- workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[180-190]

### Suggested fix
- Create and store `timeoutId` so it can be `clearTimeout(timeoutId)` when `doCapture` settles first.
- Add a cooperative `timedOut` flag (or similar) that is set when the timeout fires; after `html2canvas` resolves, check the flag and return early (skipping scale/encode) to reduce post-timeout work.
- Ensure `doCapture` is wrapped so it never rejects past the race (e.g., `const capturePromise = doCapture(...).catch(e => ({ success:false, error: ... }))`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. Scaling can return blank image ✓ Resolved 🐞 Bug ≡ Correctness
Description
scaleCanvas returns a newly created canvas even when getContext('2d') returns null, which produces
an undrawn (blank) image while capture still reports success. This is a silent failure path for
constrained/canvas-failing environments.
Code

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[R87-92]

+  const ctx = scaledCanvas.getContext('2d');
+  if (ctx) {
+    ctx.drawImage(canvas, 0, 0, scaledWidth, scaledHeight);
+  }
+
+  return scaledCanvas;
Relevance

●●● Strong

Defensive correctness fix; team often accepts hardening against silent failure paths.

PR-#3521
PR-#3572

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
If ctx is null, no drawImage occurs, but the newly created scaled canvas is still returned and
later used for encoding.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[71-105]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
When scaling is needed, `scaleCanvas` creates a new canvas and attempts to draw into it, but if `getContext('2d')` returns `null` it still returns the scaled canvas. That canvas will be blank and still encoded/sent.

### Issue Context
This can happen in low-memory situations, certain browser restrictions, or unusual runtimes.

### Fix Focus Areas
- workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[71-93]

### Suggested fix
- If `ctx` is null, either:
 - fall back to returning the original `canvas` (no scaling), or
 - throw/return a `{ success:false, error: ... }` up the call chain so the caller gets a clear failure instead of a blank screenshot.
- Add a unit test that forces `getContext` to return `null` when scaling is requested.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. JPEG fallback not validated 🐞 Bug ≡ Correctness
Description
negotiateFormat assumes toDataURL('image/jpeg') returns a JPEG data URI and always labels the
output as image/jpeg without checking the prefix. In atypical runtimes where JPEG encoding fails
or falls back, the declared contentType can diverge from the actual encoded bytes.
Code

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[R99-105]

+  const webpDataUri = canvas.toDataURL('image/webp', quality);
+  if (webpDataUri.startsWith('data:image/webp')) {
+    return { dataUri: webpDataUri, contentType: 'image/webp' };
+  }
+  const jpegDataUri = canvas.toDataURL('image/jpeg', quality);
+  return { dataUri: jpegDataUri, contentType: 'image/jpeg' };
+}
Relevance

●● Moderate

Seems correct but edge-case runtime behavior; no close repo precedent for validating JPEG data URI
prefixes.

PR-#3629

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Only the WebP candidate is validated via startsWith('data:image/webp'); the JPEG fallback is
returned unconditionally as image/jpeg.

workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[95-105]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The WebP path validates the returned data URI prefix, but the JPEG fallback does not. If the returned data URI is not actually JPEG, downstream validation/consumers can mis-handle the attachment.

### Issue Context
This is defensive hardening; most browsers support JPEG, but the code is currently asymmetric and assumes success.

### Fix Focus Areas
- workspaces/intelligent-assistant/plugins/intelligent-assistant/src/utils/screen-capture.ts[95-105]

### Suggested fix
- After calling `toDataURL('image/jpeg', quality)`, verify it starts with `data:image/jpeg`.
- If it does not, return a capture error like `{ success:false, error: 'JPEG encoding unsupported' }` (or handle the unexpected format explicitly).
- Consider adding a unit test that simulates a non-JPEG prefix on the JPEG path.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
⚠️ Tickets: not configured — ticket URL found in PR but could not be fetched — check ticket provider credentials
✅ Compliance rules (platform): 11 rules
✅ Cross-repo context
  Explored: repo: redhat-developer/rhdh (sha: 4c5a4e85)
  Explored: repo: redhat-developer/rhdh-local (sha: a1776caa)
  Not relevant to this PR: redhat-developer/rhdh-chart
  Not relevant to this PR: redhat-developer/rhdh-operator

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.16312% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.39%. Comparing base (6caf154) to head (29cf8b4).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4210      +/-   ##
==========================================
+ Coverage   58.33%   58.39%   +0.05%     
==========================================
  Files        2432     2434       +2     
  Lines       96776    96913     +137     
  Branches    26874    26920      +46     
==========================================
+ Hits        56457    56590     +133     
- Misses      38862    38866       +4     
  Partials     1457     1457              
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from eb7d831
ai-integrations 69.76% <ø> (ø) Carriedforward from eb7d831
app-defaults 69.79% <ø> (ø) Carriedforward from eb7d831
augment 46.67% <ø> (ø) Carriedforward from eb7d831
boost 76.77% <ø> (ø) Carriedforward from eb7d831
bulk-import 72.79% <ø> (ø) Carriedforward from eb7d831
cost-management 13.55% <ø> (ø) Carriedforward from eb7d831
dcm 67.21% <ø> (ø) Carriedforward from eb7d831
extensions 56.59% <ø> (ø) Carriedforward from eb7d831
global-floating-action-button 71.18% <ø> (ø) Carriedforward from eb7d831
global-header 66.50% <ø> (ø) Carriedforward from eb7d831
homepage 47.59% <ø> (ø) Carriedforward from eb7d831
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from eb7d831
intelligent-assistant 75.73% <97.16%> (+0.49%) ⬆️
konflux 91.98% <ø> (ø) Carriedforward from eb7d831
lightspeed 69.02% <ø> (ø) Carriedforward from eb7d831
mcp-integrations 83.40% <ø> (ø) Carriedforward from eb7d831
orchestrator 66.91% <ø> (ø) Carriedforward from eb7d831
quickstart 63.74% <ø> (ø) Carriedforward from eb7d831
sandbox 79.56% <ø> (ø) Carriedforward from eb7d831
scorecard 86.17% <ø> (ø) Carriedforward from eb7d831
theme 88.77% <ø> (ø) Carriedforward from eb7d831
translations 5.12% <ø> (ø) Carriedforward from eb7d831
x2a 79.20% <ø> (ø) Carriedforward from eb7d831

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6caf154...29cf8b4. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

its-mitesh-kumar and others added 3 commits August 9, 2026 23:46
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
- Fall back to original canvas when getContext('2d') returns null
- Add CSS.escape() to prevent selector injection in label lookup
- Remove redundant password type check (already in isSensitiveElement)
- Wrap element.matches() in try/catch for invalid selectors
- Use case-insensitive CSS attribute selectors for aria-label matching
- Convert html2canvas-pro to dynamic import for bundle size optimization
- Clear timeout timer in finally block to prevent resource leak
- Replace as-any casts with expect.objectContaining in tests
- Remove fragile index-based SECRET_PATTERNS tests
- Add JSDoc warning about stateful /g regexes

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant