Conversation
- Add screenshot image - Fix linting - Add command to set My Browser - Update changelog, error handling and category - Change icon - Initial commit
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile SummaryThis PR introduces the My Browser extension with two commands: Confidence Score: 5/5Safe to merge; all findings are P2 style/best-practice suggestions that do not block functionality. No P0 or P1 issues found. The three comments are improvements: replacing extensions/my-browser/src/set-my-browser.tsx and extensions/my-browser/src/open-my-browser.ts for the style suggestions. Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/my-browser/src/open-my-browser.ts
Line: 7
Comment:
**Prefer Raycast's `open()` API over `execSync`**
`execSync` blocks the entire Node.js event loop and bypasses Raycast's built-in mechanisms. Raycast's `open()` function (from `@raycast/api`) is the idiomatic replacement — it handles app launching/focusing without shell execution and is non-blocking.
```suggestion
await open(browser.path);
```
You'll also need to add `open` to the import from `@raycast/api` and remove the `execSync` import.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/my-browser/src/set-my-browser.tsx
Line: 43-47
Comment:
**Bundle ID interpolated directly into executable Swift source**
`bundleId` is embedded verbatim into the Swift script with a template literal. While bundle IDs sourced from `getApplications()` are controlled by the local system, it's a risky pattern — a bundle ID containing `"` or a newline would corrupt the generated Swift source. Consider passing the value as a command-line argument instead:
```typescript
function setDefaultBrowser(bundleId: string): void {
const tmpFile = join(tmpdir(), `raycast-my-browser-${Date.now()}.swift`);
const script = `
import Foundation
import CoreServices
let id = CommandLine.arguments[1] as CFString
LSSetDefaultHandlerForURLScheme("https" as CFString, id)
LSSetDefaultHandlerForURLScheme("http" as CFString, id)
`;
try {
writeFileSync(tmpFile, script);
execSync(`swift ${tmpFile} ${JSON.stringify(bundleId)}`, { timeout: 20000 });
} finally {
try { unlinkSync(tmpFile); } catch { /* ignore */ }
}
}
```
This also avoids the fixed temp filename collision if `getHttpsHandlerBundleIds` and `setDefaultBrowser` were ever called concurrently.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/my-browser/CHANGELOG.md
Line: 3-11
Comment:
**Two entries share the same `{PR_MERGE_DATE}` placeholder in an initial release**
Both commands are shipped in the same PR, so they share the same merge date. Having a separate "update" entry (`[Set My Browser]`) above the initial entry (`[Initial Version]`) implies a version history that doesn't exist yet. The standard convention for a first PR is a single initial-release entry that lists all shipped features:
```suggestion
## [Initial Version] - {PR_MERGE_DATE}
### Added
- Open My Browser command: focus or launch your default browser with a single hotkey
- Set My Browser command: list all browsers registered on your Mac and set one as the system's default
```
**Rule Used:** What: Changelog entries must use `{PR_MERGE_DATE}`... ([source](https://app.greptile.com/review/custom-context?memory=c2214c11-df56-490a-b1c0-09a385df481a))
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Add my-browser extension" | Re-trigger Greptile |
Description
Adding the My Browser extension - Commands and utilities that automatically adapt to your default browser, so you never have to reconfigure when you switch.
This extension centralizes Raycast configurations (e.g. hotkeys) based on the system's currently active default browser. It was born out of the frustration of having to unset and re-set a hotkey every time the default browser changed.
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder