Repository navigation
feat: Add blacklist mode for browser host filtering #1164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7dcab91
5be9892
0e1b6e1
3e8924a
dc177db
ccaace2
b8a8c6e
f706245
cf819a4
ad98c33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -8672,9 +8672,18 @@ struct ContentView: View { | |||||||
| var openedCount = 0 | ||||||||
| if openSidebarPullRequestLinksInCmuxBrowser { | ||||||||
| for pullRequest in pullRequests { | ||||||||
| if tabManager.openBrowser(url: pullRequest.url, insertAtEnd: true) != nil { | ||||||||
| let url = pullRequest.url | ||||||||
| // Respect external-open patterns and host whitelist/blacklist settings. | ||||||||
| let shouldOpenExternally = BrowserLinkOpenSettings.shouldOpenExternally(url) | ||||||||
| || { | ||||||||
| guard let host = BrowserInsecureHTTPSettings.normalizeHost(url.host ?? "") else { return false } | ||||||||
| return !BrowserLinkOpenSettings.shouldOpenInCmuxBrowser(host: host) | ||||||||
|
Comment on lines
+8679
to
+8680
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Normalization failure is treated as "open in cmux" here, which can bypass host-list filtering for non-normalizable hosts. Prompt for AI agents
Suggested change
|
||||||||
| }() | ||||||||
| if shouldOpenExternally { | ||||||||
| if NSWorkspace.shared.open(url) { openedCount += 1 } | ||||||||
| } else if tabManager.openBrowser(url: url, insertAtEnd: true) != nil { | ||||||||
| openedCount += 1 | ||||||||
| } else if NSWorkspace.shared.open(pullRequest.url) { | ||||||||
| } else if NSWorkspace.shared.open(url) { | ||||||||
| openedCount += 1 | ||||||||
| } | ||||||||
| } | ||||||||
|
|
@@ -13793,6 +13802,16 @@ private struct TabItemView: View, Equatable { | |||||||
| private func openPullRequestLink(_ url: URL) { | ||||||||
| updateSelection() | ||||||||
| if openSidebarPullRequestLinksInCmuxBrowser { | ||||||||
| // Respect external-open patterns and host whitelist/blacklist settings. | ||||||||
| if BrowserLinkOpenSettings.shouldOpenExternally(url) { | ||||||||
| NSWorkspace.shared.open(url) | ||||||||
| return | ||||||||
| } | ||||||||
| if let host = BrowserInsecureHTTPSettings.normalizeHost(url.host ?? ""), | ||||||||
| !BrowserLinkOpenSettings.shouldOpenInCmuxBrowser(host: host) { | ||||||||
|
Comment on lines
+13810
to
+13811
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: This Prompt for AI agents
Suggested change
|
||||||||
| NSWorkspace.shared.open(url) | ||||||||
| return | ||||||||
| } | ||||||||
| if tabManager.openBrowser( | ||||||||
| inWorkspace: tab.id, | ||||||||
| url: url, | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.