adblock: Postpone navigation decisions until ready
This defers navigation decisions while EphyFiltersManager
is performing its initial setup, with the aim of avoiding touching the network without the adblocker filters being in use. This is particuarly important to avoid accidentally making requests to trackers which would be filtered by the adblocker in the small time window while the EphyFiltersManager
initializes.
Blocking of requests is done by tapping into WebKitWebView:decide-policy
because the signal can be handled asynchronously, and while a decision is not made WebKit will not start performing requests. Thus, a list of
pending decisions is kept and items which were added to it are decided when the EphyFiltersManager:is-initialized
property changes.
The existing VerifyUrlAsyncData
struct (which was being used by the safe browsing code) is reused to hold the information about pending navigation decisions.
Closes #872 (closed)