-
Notifications
You must be signed in to change notification settings - Fork 894
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
feature(privacy): Add debug view to iOS to display blocked requests per-tab #26987
Conversation
d1cc491
to
16efa5a
Compare
|
||
extension Strings.Shields { | ||
public static let blockedRequestsTitle = NSLocalizedString( | ||
"blockedRequestsTitle", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to prefix these strings with Shields
(e.g. Shields.blockedRequestTitle
) for possible (though unlikely 😅) collision prevention
.searchable(text: $filterText) | ||
} | ||
|
||
@ViewBuilder private func row(title: String, detail: String) -> some View { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can drop @ViewBuilder
since the computed value is wrapped in Group
sourceURL: document.location.href, | ||
sourceURL: $.windowOrigin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this was missed in the local frames fix, just for our tracking protection stats. But this debug view feature piggy-backs on that script to catch requests blocked by the content blocker (as opposed to blocked by our request blocking scripts). Some additional info w/ examples.
|
||
private var blockedRequests: [BlockedRequestInfo] { | ||
let blockedRequests = Array(contentBlockerHelper.blockedRequests) | ||
guard !filterText.isEmpty else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if filterText.isEmpty
would be easier to parse
@@ -27,13 +27,15 @@ struct ShieldsPanelView: View { | |||
} | |||
|
|||
private let url: URL | |||
private weak var tab: Tab? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably doesn't need to be weak
since this is a View
and ShieldsSettingsViewModel
is already holding onto the Tab
strongly
Released in v1.75.97 |
BraveIOSDebugAdblock
feature flag (default: disabled) that when enabled will display blocked requests for a given tab in it's Shield panel under advanced controls.Resolves brave/brave-browser#42842
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
brave://flags
and enable#ios-debug-adblock
feature flagbrave://flags
is not working (see [iOS] - brave://flags crashes on iOS due to missing resources brave-browser#42843), visit Settings -> 'BraveCore Switches' -> 'Enable Features' and addBraveIOSDebugAdblock
Blocked Requests