Open patrickhulce opened 6 years ago
@patrickhulce request interception is (so far) only working with the --headless
flag, but not without. Do you have any idea on when the fix for that will end up in stable?
will also help fix #2512
@benschwarz my sources say that it's been fixed in canary, perhaps it'll go out with m63? I haven't checked
@patrickhulce I just tested https://github.com/benschwarz/chrome-request-interception on Canary (latest) mac.
--headless
wouldn't launch at allNetwork.requestIntercepted
is never fired (on non-headless)Definitely want to see this change come through, but it seems like request interception is still not ready
the --headless problem seems to be based on the order of your listeners, due to PlzNavigate, you must establish all your handlers/listeners before Page.navigate
since it can frequently resolve after the page has already loaded, moving around the listeners gets the example to work for me on headless.
non-headless definitely still seems to be missing interception though still perhaps my source jumped the gun 😄
EDIT: it looks like this failure is the result of an open bug for the user data dir works if you start chrome with a pre-existing user data dir 😆 https://bugs.chromium.org/p/chromium/issues/detail?id=764505&q=interception%20&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified
FYI @benschwarz if you want to star that bug too :)
Good repro for broken setblockedURL: Try running lighthouse against http://2015.cssconf.com.au
So, network interception is much better now, so we can probably do this now. Although I don't see where it says setBlockedUrls is going away. it's marked as experimental, but not deprecated afaict.
If we still want to do this, we'll want to use the Fetch domain. This PR has the necessary code: https://github.com/GoogleChrome/lighthouse/pull/9459/files#diff-20c9b77b021305db443ebff30875575a
setBlockedUrls will be disappearing from the protocol and we should migrate to use request interception to do URL blocking instead
Blocked on https://crbug.com/764505