Skip to content

fix: optimize content script performance and reduce main thread blocking (#100) - #117

Merged
Exotic209093 merged 1 commit into
mainfrom
worktree-wf_7a9e3632-bc8-22
Sep 9, 2026
Merged

fix: optimize content script performance and reduce main thread blocking (#100)#117
Exotic209093 merged 1 commit into
mainfrom
worktree-wf_7a9e3632-bc8-22

Conversation

@Exotic209093

Copy link
Copy Markdown
Owner

Reduces content script initialization overhead, defers non-critical work, and minimizes DOM interaction latency to improve page load performance.

Closes #100

🤖 Generated with Claude Code

…ing (#100)

Reduces content script initialization overhead, defers non-critical work,
and minimizes DOM interaction latency to improve page load performance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T13:57:13.168657Z a7ca674 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7ca674b99

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/content/index.ts
Comment on lines +176 to +178
history.pushState = function (...args: Parameters<typeof history.pushState>): void {
originalPushState(...args);
onUrlChange();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Observe navigation from the page's execution world

Because public/manifest.json does not specify "world": "MAIN", this content script runs in Chrome's isolated world. Reassigning history.pushState and replaceState here therefore does not wrap the functions invoked by Salesforce's page scripts; moreover, those calls do not emit popstate. During ordinary Lightning SPA navigation, onUrlChange() consequently never runs and reportOrgDetection() is not repeated, unlike with the removed DOM observer. Inject a page-world hook that relays navigation events, or retain another observer visible to the content script.

Useful? React with 👍 / 👎.

@Exotic209093
Exotic209093 merged commit 55b1501 into main Sep 9, 2026
1 check failed
@Exotic209093
Exotic209093 deleted the worktree-wf_7a9e3632-bc8-22 branch September 9, 2026 14:05
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.

Content script MutationObserver watches entire document.body subtree for URL changes

1 participant