feat(browser): enable Chrome extension compatibility (webRequest, contextMenus, debugger unblock)#160
Open
PrasannaPal21 wants to merge 25 commits intop2plabsxyz:mainfrom
Open
Conversation
…sion bridge logging
8 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Chrome extension compatibility in the Electron-based browser shell by bridging missing extension APIs/behaviors into the host app (notably webRequest dispatching, context menu integration, and tab/webview registration resilience).
Changes:
- Dispatch Electron
session.webRequestevents into the extension layer (including blocking-capable hooks) and adjust tab/webview registration to handle guest webContents replacement. - Integrate extension-provided
chrome.contextMenusitems into the browser’s native context menu. - Unblock
chrome.debuggerpermission and improve handling ofchrome-extension://URLs so they open as normal tabs instead of popups.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main.js | Adds a webRequest bridge from Electron session to the extension layer across multiple events. |
| src/pages/tab-bar.js | Makes extension tab registration robust to webContents ID changes; adjusts popup-closing behavior on tab switches. |
| src/extensions/services/popup-guards.js | Redirects extension window.open() of chrome-extension:// URLs to open in a normal tab. |
| src/context-menu.js | Appends extension-provided context menu items into the app context menu. |
| src/extensions/policy.js | Removes debugger from blocked permissions to unblock chrome.debugger. |
| src/extensions/index.js | Minor hunk change near tab registration; logging remains in the touched area. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ing to avoid false error pages on redirects/OAuth
…al21/peersky-browser into Chrome-api-limitations
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/pages/tab-bar.js:893
- The
if (!isNewTab) { ... }block’s indentation is currently inconsistent, which makes it easy to misread the scope of what is conditional (especially around thetry/catch). Please reformat this block so the conditional region is unambiguous and matches the surrounding style.
if (!isNewTab) {
try {
const { ipcRenderer } = require('electron');
ipcRenderer.invoke('extensions-close-all-popups').catch(error => {
console.warn('[TabBar] Failed to close extension popups on tab switch:', error);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d until IPC completes and validating pending wcId
…allback to previous navigation during OAuth
indentation fix Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
removed unused import Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
This PR improves Chrome extension compatibility on the browser side.
Related: #125
peersky-browser-shell#4