Repository navigation
P0 hardening: renderer crashes, popups, error pages, TV, incognito privacy - #13
Merged
Merged
Conversation
…cognito privacy Six production blockers found in the audit: 1. Renderer crash killed the app — WebViewClient.onRenderProcessGone now destroys the dead WebView, drops the tab and returns true, so a crashing page costs one tab instead of the whole app. 2. window.open()/target=_blank were dead ends — supportMultipleWindows is on and onCreateWindow creates the popup WebView in the pool, hands it to the WebViewTransport and asks the ViewModel to adopt that exact tab. 3. Failed loads left a blank screen — onReceivedError and onReceivedSslError now surface a PageError overlay with Try again / Close tab. Certificate errors are cancelled; there is no bypass. 4. No TV presence — LEANBACK_LAUNCHER category, android:banner, leanback and optional-touchscreen features, plus a 320x180 banner generated from the logo. 5. Incognito leaked — visited hosts are tracked and their cookies removed when the last incognito tab closes, cache/form data/history cleared, and FLAG_SECURE is set while an incognito tab is open so it stays out of screenshots and Recents. 6. Cleartext policy was implicit — an explicit network_security_config documents why a browser cannot block http:// outright and what protects the user instead (HTTPS-first, no certificate bypass, insecure indicator in the omnibox).
|
Caution Review failedThe pull request is closed. Walkthrough
Change: Bug fix
|
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.
Fixes the six production blockers from the code audit. No behaviour change for a healthy page.
WebViewClient.onRenderProcessGonedestroys the dead WebView, removes it from the pool, drops the tab and returnstrue. One tab dies instead of the process.window.open()/target=_blankwere deadsetSupportMultipleWindows(true)+onCreateWindow: the popup WebView is created in the pool, handed toWebViewTransport, and the ViewModel adopts that exact tab id (adoptPopupTab).onReceivedError(main frame) andonReceivedSslErrorraise aPageError; a new overlay offers Try again and Close tab. SSL errors cancel the load — no bypass path.LEANBACK_LAUNCHERcategory,android:banner,android.software.leanback(not required) and optional touchscreen, plus a 320×180 banner generated from the official logo.FLAG_SECUREis set while an incognito tab is open, so it stays out of screenshots and the Recents thumbnail.network_security_config.xmlthat documents why a browser cannot blockhttp://outright, and what protects the user instead: HTTPS-first on by default, no certificate bypass, insecure warning in the omnibox.Files
browser/WebViewPool.kt— new callbacks (onPopupTabCreated,onPageError,onRendererGone),onCreateWindow, error/SSL/renderer handlers, incognito host tracking +clearIncognitoData()viewmodel/BrowserViewModel.kt—PageErrorstate,adoptPopupTab,onPageError,onRendererGoneui/BrowserApp.kt— new callbacks,PageErrorOverlay,FLAG_SECUREeffect, incognito wipe on last closeAndroidManifest.xml,res/xml/network_security_config.xml,res/drawable-nodpi/tv_banner.pngHonest limitations
onReceivedHttpError(a 404/500 the server itself renders) is deliberately left alone — the site's own error page is better than ours.Checks
Compiles via the PR's own
Quality Gate & Testsrun (assembleDebug+ lint + unit tests).Summary by CodeRabbit