Repository navigation
P1: ad blocker, site permissions, Safe Browsing, state restore - #14
Merged
Merged
Conversation
Ad blocker - AdBlocker: host-based blocking from a bundled, curated list (res/raw/adblock_hosts.txt), matched on the host name only, main-frame requests never blocked - WebViewPool.shouldInterceptRequest returns an empty 200 for blocked hosts - Settings > Ad blocking and permissions: on/off switch, live blocked count, reset Site permissions - WebViewPool.onPermissionRequest (camera/mic) and onGeolocationPermissionsShowPrompt forward to a browser-owned dialog: Allow / Block, remembered per origin - the app asks Android for the real permission before granting the page, so camera and microphone actually work - SitePermissionStore keeps decisions in DataStore; Settings lists allowed sites with Remove and Clear all; prompts can be switched off entirely Safe Browsing - onSafeBrowsingHit raises a dialog with the threat label, Back to safety (default) and an explicit Continue anyway State restore - MainActivity saves every WebView state on onSaveInstanceState and the pool restores it on the next create, so rotation and process death keep scroll, form input and history Also: <queries> for web/app links, camera/mic/location permissions, geolocation enabled.
|
Caution Review failedThe pull request is closed. Walkthrough
Change: Feature
|
The class already had a companion object holding DESKTOP_USER_AGENT; adding a second one for active/pendingState broke the build. The two state properties now live in the existing companion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every P1 gap from the audit, each with the UI the user needs to control it.
1. Ad and tracker blocker (with on/off)
browser/AdBlocker.kt— host matching from a bundled list (res/raw/adblock_hosts.txt, ~120 curated ad/analytics/tracker hosts). Matches the host or any parent domain, never blocks main-frame requests, never touches CDNs that serve page assets (gstatic, fbcdn, cloudfront, jsdelivr…).WebViewPool.shouldInterceptRequestreturns an empty 200 for blocked hosts, so the page keeps rendering.2. Site permissions (camera / microphone / location) with UI
onPermissionRequest(video/audio capture) andonGeolocationPermissionsShowPromptnow forward to a browser-owned dialog: "example.com wants to use your camera" → Allow / Block, remembered per origin.SitePermissionStore(DataStore) keeps the decisions; Settings lists every allowed site with Remove and Clear all; a switch can deny every request outright.setGeolocationEnabled(true).3. Safe Browsing
onSafeBrowsingHitraises a dialog with the threat label (phishing / harmful software …), Back to safety as the default action and an explicit Continue anyway. Nothing proceeds silently.4. WebView state restore
MainActivity.onSaveInstanceStatewrites every live WebView's state into the bundle; the pool restores it when the tab is recreated. Rotation and process death keep scroll position, form input and back/forward history.5. Manifest
<queries>forhttps,http,market,mailtoso external links can be resolved on Android 11+.Honest limits
Checks
The PR's own
Quality Gate & Testsrun compiles the app, runs unit tests and lint.Summary by CodeRabbit