Skip to content

finicky: fix v4 rewrite API, route more domains to Chrome - #97

Open
idvorkin wants to merge 3 commits into
mainfrom
public/finicky-chrome
Open

finicky: fix v4 rewrite API, route more domains to Chrome#97
idvorkin wants to merge 3 commits into
mainfrom
public/finicky-chrome

Conversation

@idvorkin

@idvorkin idvorkin commented Jul 31, 2026

Copy link
Copy Markdown
Owner

What

Three finicky changes, split out of a long-lived local branch.

  • finicky: pass URL instance directly to rewrite fns (v4 API) — the real bug fix. The rewrite handlers were destructuring ({ url }), which is the v3 signature; finicky v4 passes the URL instance directly. Without this the http→https rewrite silently stops firing.
  • finicky: route internalmeta, GHE, and github to Chrome — adds internalmeta.com, ghe.oculus-rep.com, and github.com to the existing Chrome match list, alongside the fburl.com / internalfb.com / fb.okta.com entries already there.
  • finicky: default to Chrome to avoid auth issues — flips defaultBrowser from Microsoft Edge to Google Chrome.

Test plan

~/.finicky.js symlinks to mac/.finicky.js, so this config has been running live on my Mac since June.

Summary by CodeRabbit

  • Configuration
    • Google Chrome is now the default browser.
    • Added routing support for additional GitHub and internal-tools URLs.
    • Updated URL rewrite handling for improved compatibility.

Copilot AI review requested due to automatic review settings July 31, 2026 18:13
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The macOS Finicky configuration now uses Google Chrome by default, accepts direct URL arguments in rewrite callbacks, and routes ghe.oculus-rep.com and github.com URLs to Chrome.

Changes

Finicky routing configuration

Layer / File(s) Summary
Default browser and URL rewrites
mac/.finicky.js
The default browser changes from Microsoft Edge to Google Chrome. Rewrite callbacks now receive the URL directly and continue converting HTTP URLs to HTTPS.
Chrome URL matching
mac/.finicky.js
The Chrome handler adds patterns for ghe.oculus-rep.com and github.com.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: fixing the Finicky v4 rewrite API and routing additional domains to Chrome.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch public/finicky-chrome

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s Finicky macOS URL-routing configuration to align with Finicky v4’s rewrite handler API and to prefer Chrome for more destinations, reducing day-to-day auth/browser-compat friction.

Changes:

  • Fixes the rewrite handler signatures to accept a URL instance directly (Finicky v4 API).
  • Routes additional Meta/GitHub-related domains to Google Chrome.
  • Switches defaultBrowser from Microsoft Edge to Google Chrome.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@mac/.finicky.js`:
- Around line 59-60: Update the URL matchers in the Finicky configuration to
match hostnames rather than arbitrary text in full URLs, using
finicky.matchHostnames for ghe.oculus-rep.com and github.com or equivalent
host-anchored expressions. Preserve any required subdomain matching by listing
those subdomains explicitly.
🪄 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 Plus

Run ID: 3d248387-1041-444c-bbab-aabbcc524a66

📥 Commits

Reviewing files that changed from the base of the PR and between cc82357 and 14e789a.

📒 Files selected for processing (1)
  • mac/.finicky.js

Comment thread mac/.finicky.js
Comment on lines +59 to +60
/ghe\.oculus-rep\.com/i,
/github\.com/i,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== repo files matching finicky.js =="
fd -a 'finicky\.js$' . || true

echo "== mac/.finicky.js line count and relevant sections =="
if [ -f mac/.finicky.js ]; then
  wc -l mac/.finicky.js
  nl -ba mac/.finicky.js | sed -n '1,140p'
fi

echo "== search for finicky matchers/config in mac/.finicky.js =="
if [ -f mac/.finicky.js ]; then
  rg -n "def|exports|matchHostnames|matchURL|match|ghe\.oculus-rep\.com|github\.com|chrome|Firefox" mac/.finicky.js
fi

echo "== finicky dependency references in repo =="
rg -n "finicky|\.finicky\.js" -S .

Repository: idvorkin/Settings

Length of output: 307


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== mac/.finicky.js contents =="
if [ -f mac/.finicky.js ]; then
  cat -n mac/.finicky.js
fi

echo "== repository references to Finicky/finicky =="
git ls-files | xargs grep -l -i 'finicky\|\.finicky\.js\|matchHostnames\|matchURL' || true

echo "== relevant line contexts in mac/.finicky.js =="
if [ -f mac/.finicky.js ]; then
  grep -n -i 'ghe\.oculus-rep\.com\|github\.com\|finicky\.|match\|chrome|Firefox' mac/.finicky.js -C 3 || true
fi

Repository: idvorkin/Settings

Length of output: 3117


🌐 Web query:

Finicky .finicky.js matchHostnames matchURL Regular expression matches URL text

💡 Result:

In Finicky, URL matching for handlers and rewrites can be performed using strings (glob patterns), regular expressions (RegExp), or custom functions [1][2][3]. For matching specific hostnames, Finicky provides a utility function: finicky.matchHostnames(matchers) This utility simplifies matching against the domain part of a URL [1]. It accepts a string, a RegExp, or an array of these [1]. Example usage in your.finicky.js: module.exports = { handlers: [{ match: finicky.matchHostnames(["apple.com", /example.(com|org|net)/]), browser: "Safari" }] }; Beyond this utility, you can match URLs directly using various methods: 1. String patterns: Simple glob-like patterns such as "example.com/" or ".google.com*" are supported directly in the match property [2][4]. 2. Regular expressions: You can provide a native JavaScript RegExp object directly to the match property to match the full URL string [1][3]. 3. Custom functions: For complex logic, you can provide a function that receives the URL (as an object) and other context (like the opener), returning a boolean [1][3]. Example using a function: match: ({ url }) => url.host === "example.com" && url.pathname.startsWith("/path") For troubleshooting, you can use the logRequests option or a custom rewrite rule to log incoming URL objects to the console, allowing you to inspect the exact structure being matched [5].

Citations:


Match the target hostnames, not arbitrary URL text.

Handlers use matchers against the full URL string, so /ghe\.oculus-rep\.com/i and /github\.com/i can also match URLs that contain those strings in a path, query string, or unrelated hostname. Use finicky.matchHostnames(...) or anchor each expression to the URL host. Add subdomains explicitly if they are required.

Suggested fix
-				/ghe\.oculus-rep\.com/i,
-				/github\.com/i,
+				finicky.matchHostnames([
+					"ghe.oculus-rep.com",
+					"github.com",
+				]),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/ghe\.oculus-rep\.com/i,
/github\.com/i,
finicky.matchHostnames([
"ghe.oculus-rep.com",
"github.com",
]),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mac/.finicky.js` around lines 59 - 60, Update the URL matchers in the Finicky
configuration to match hostnames rather than arbitrary text in full URLs, using
finicky.matchHostnames for ghe.oculus-rep.com and github.com or equivalent
host-anchored expressions. Preserve any required subdomain matching by listing
those subdomains explicitly.

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.

2 participants