Open
Conversation
…e bone hooks on Android).
…code. Some of the sync public APIs are now async as a result
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.
Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.
Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.
Skip Pull Request Checklist:
swift testCodex generated the code. Unit test all green when running locally + ran Smoke Tests from Android/iOS devices:
Content Blocking Smoke Suite
Smoke Tests Summary
These smoke tests focus on four higher-level areas:
WKWebView, cache invalidation, and pruning.Smoke Tests Details
testContentBlockerConfigurationDefaults: verifies a fresh blocker config starts empty on both iOS and Android surfaces.testPopupChildMirroredConfigurationPreservesContentBlockers: verifies popup child engines inherit the parent’s content-blocker configuration.testAndroidLegacyEngineDelegateDoesNotReplaceInternalWebViewClient: verifies the deprecated Android navigation hook no longer displaces the engine-owned blocker client.testAndroidSuppliedWebViewClientIsPreservedUnderInternalClient: verifies a caller-supplied AndroidWebViewClientis embedded under the internal blocker client instead of being dropped.testAndroidPageContextDefaultsHostFromURL: verifies Android page context deriveshostfrom the supplied page URL.testAndroidCosmeticRuleDefaults: verifies Android cosmetic rules default to wildcard origins, main-frame scope, and document-start timing.testAndroidCosmeticRuleHiddenSelectorsConvenienceInitializer: verifies selector-based hide rules normalize into CSS plus the expected scope/filter metadata.testAndroidRedirectDetectionSkipsLookupWhenFeatureUnsupported: verifies redirect probing is skipped when the Android WebView feature is unavailable.testAndroidHistoryNavigationIndexUsesOffsetFromCurrentEntry: verifies back/forward navigation computes the correct target history index.testAndroidHistoryNavigationIndexRejectsOutOfBoundsTargets: verifies invalid history offsets are rejected instead of pre-registering cosmetics for a bad entry.testAndroidCosmeticPlanPreservesDocumentStartRuleOrder: verifies document-start rules keep caller order when native document-start support exists.testAndroidCosmeticPlanFallsBackOnlyForMainFrameRulesWhenUnsupported: verifies unsupported document-start injection degrades only main-frame rules to lifecycle CSS.testAndroidCosmeticPlanKeepsPageLifecycleRulesForMainFrameOnly: verifies lifecycle injection keeps only rules that are valid for main-frame fallback.testAndroidCosmeticPlanFiltersLifecycleRulesByAllowedOriginRules: verifies lifecycle CSS is filtered by allowed-origin matching before injection.testAndroidCosmeticPlanFiltersFallbackRulesByAllowedOriginRules: verifies document-start fallback still respects allowed-origin filters.testAndroidCosmeticPlanFiltersFallbackRulesByURLFilterPattern: verifies document-start fallback still respectsurlFilterPatternmatching on the main document URL.testAndroidRedirectFallbackPlanDegradesDocumentStartRulesEvenWhenSupported: verifies redirected final pages intentionally degrade document-start rules to late main-frame injection.testAndroidContentBlockerStyleInjectionScriptAddsMainFrameGuard: verifies generated CSS injection scripts bail out in subframes for main-frame-only rules.testAndroidContentBlockerStyleInjectionScriptAddsSubframeGuard: verifies generated CSS injection scripts bail out in the top frame for subframe-only rules.testAndroidContentBlockerStyleInjectionScriptAddsURLGuard: verifies generated CSS injection scripts include a URL-match guard for URL-scoped rules.testAndroidContentBlockerStyleInjectionScriptLeavesAllFramesUngarded: verifies all-frame scripts omit frame guards so they can run in any frame context.testAndroidContentBlockerStyleRemovalScriptTargetsInjectedStyle: verifies stale injected blocker CSS can be removed by targeting the expected style element.testIOSContentBlockerRuleListsCompileAndReusePersistentCache: verifies iOS rule lists compile once and are reused from persistent cache on subsequent loads.testIOSContentBlockersInstallIntoSuppliedWKWebView: verifies configured iOS blocker rule lists install into a caller-suppliedWKWebView.testIOSContentBlockerRuleListChangesInvalidateCachedIdentifier: verifies changing a rule file recompiles it and prunes the old cached identifier.testIOSContentBlockerRemovingRuleFilePrunesStaleIdentifier: verifies removing a configured rule file prunes its stale compiled rule-list entry.testIOSContentBlockerSetupErrorsAreRecordedWithoutFailingConfiguration: verifies invalid iOS rule files surface setup errors without aborting async config or engine setup.Quick Usage Example
New API Shape In This Branch
Configuration Surface
Android Content Blocking Mode
Android Request Blocking
These legacy Android request/cosmetic protocols remain available as deprecated compatibility shims for one release, but the primary branch API is
androidMode: .custom(...).Android Cosmetic Blocking
Error Reporting