fix: update host_permissions in manifest to match actual backend URLs#650
fix: update host_permissions in manifest to match actual backend URLs#650laibulous wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated the Chrome extension manifest Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@extension/public/manifest.json`:
- Around line 14-15: The manifest currently allows "http://127.0.0.1:5000/*" and
"https://localhost:5000/*" but omits "http://localhost:5000/*", causing scheme
mismatch and blocked requests from components like TextInput.jsx, Answer.jsx and
SidePanel.jsx; update extension/public/manifest.json to include
"http://localhost:5000/*" in the host permissions/origins array so the HTTP
scheme for localhost is explicitly allowed and matches the requests from those
components.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e7cbf312-5fc0-475f-a04f-5a5d8d8e860f
📒 Files selected for processing (1)
extension/public/manifest.json
| "http://127.0.0.1:5000/*", | ||
| "https://localhost:5000/*" |
There was a problem hiding this comment.
Add http://localhost:5000/* (scheme mismatch currently breaks allowed-origin matching).
Line 15 grants https://localhost:5000/*, but the code calls http://localhost:5000/* (e.g., extension/src/pages/text_input/TextInput.jsx, extension/src/pages/answer/Answer.jsx, extension/src/pages/question/SidePanel.jsx). Because scheme is part of host permission matching, those HTTP requests can still be blocked.
Proposed fix
"host_permissions": [
"http://127.0.0.1:5000/*",
- "https://localhost:5000/*"
+ "http://localhost:5000/*"
],🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@extension/public/manifest.json` around lines 14 - 15, The manifest currently
allows "http://127.0.0.1:5000/*" and "https://localhost:5000/*" but omits
"http://localhost:5000/*", causing scheme mismatch and blocked requests from
components like TextInput.jsx, Answer.jsx and SidePanel.jsx; update
extension/public/manifest.json to include "http://localhost:5000/*" in the host
permissions/origins array so the HTTP scheme for localhost is explicitly allowed
and matches the requests from those components.
Addressed Issues:
Fixes #636
What changed
Updated
host_permissionsinextension/public/manifest.jsonfromhttp://127.0.0.1:8000/*to includehttp://localhost:5000/*andhttp://127.0.0.1:5000/*.Why
The extension's fetch calls across 5 files all target
localhost:5000, but the manifest only permitted127.0.0.1:8000, a different host AND port. Chrome silently blocks requests to unlisted hosts, causing backend calls to fail. Both entries are added becauselocalhostand127.0.0.1are treated as distinct hostnames by Chrome, and either may be used depending on the system.Files verified
extension/public/manifest.json- fixed hereextension/public/youtubeContentScript.js- calls localhost:5000extension/src/pages/text_input/TextInput.jsx- calls localhost:5000extension/src/pages/answer/Answer.jsx- calls localhost:5000extension/src/pages/question/Question.jsx- calls localhost:5000extension/src/pages/question/SidePanel.jsx- calls localhost:5000No backend changes required.
Screenshots/Recordings:
No response
Testing
npm run build) and loaded unpacked in ChromeAI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist
Summary by CodeRabbit