Currently we block doc.write injected scripts (in experiment) if the network is actually 2G. Consider also blocking when the network is 2g-like according to NQE. This would require a separate experiment setting.
Out for review: https://codereview.chromium.org/2279543004/
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3bddb7d26f782d26958aa3afb0777adb1792033d commit 3bddb7d26f782d26958aa3afb0777adb1792033d Author: jkarlin <jkarlin@chromium.org> Date: Wed Sep 21 18:44:16 2016 Add Blink setting to block doc.written scripts on 2g-like networks Use the NetworkQualityEstimator to add the ability to block synchronous script loading with document.write if the network conditions are 2G or 2G-like. This CL also adds TestRunner API to let layout tests override the effective network type. BUG= 633569 Review-Url: https://codereview.chromium.org/2338623004 Cr-Commit-Position: refs/heads/master@{#420117} [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/components/test_runner/test_runner.cc [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/components/test_runner/test_runner.h [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/components/test_runner/web_frame_test_client.cc [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/components/test_runner/web_frame_test_client.h [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/components/test_runner/web_frame_test_proxy.h [add] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block-effectively-2g-expected.txt [add] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block-effectively-2g.html [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/third_party/WebKit/Source/core/frame/Settings.in [modify] https://crrev.com/3bddb7d26f782d26958aa3afb0777adb1792033d/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
DevTools Network emulation doesn't work?
Comment 1 by jkarlin@chromium.org
, Aug 25 2016