Skip to content

Commit 63af2bb

Browse files
committed
Send pageTimings on load; Stop request flow for both page_info and page_complete
1 parent 6554327 commit 63af2bb

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

.github/python-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11
1+
3.10

mitmproxy/addons/browserup/browser_data_addon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def request(self, f: mitmproxy.http.HTTPFlow):
3737
self.HarCaptureAddon.add_page_info_to_har(page_timings)
3838
if action == 'page_complete':
3939
self.HarCaptureAddon.end_page()
40-
f.kill()
40+
f.kill()
4141

4242
def response(self, f: mitmproxy.http.HTTPFlow):
4343
if f.response is None or f.response.status_code != 200 or f.request.method not in ['GET', 'POST', 'PUT']:

scripts/browsertime/browser-data.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,20 +225,14 @@ function submitPageInfo(page_timings, action = 'page_info') {
225225

226226
function postPageTimings(){ submitPageInfo(pageTimings(), 'page_info'); }
227227

228-
function delayForPaintAndPostPageTimings(){
229-
requestAnimationFrame(() => {
230-
requestIdleCallback(postPageTimings, { timeout: 500 });
231-
});
232-
}
233-
234228
function handleClose(){
235229
if (window.closeIsHandled == true) { return true };
236230
window.closeIsHandled = true;
237231
submitPageInfo(pageTimings(), 'page_complete');
238232
}
239233

240234
observeAndSaveFirstInputDelay();
241-
window.addEventListener('load', delayForPaintAndPostPageTimings);
235+
window.addEventListener('load', postPageTimings);
242236
window.addEventListener('beforeunload', handleClose);
243237
window.addEventListener('unload', handleClose);
244238

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"hypothesis>=5.8,<7",
117117
"parver>=0.1,<2.0",
118118
"pdoc>=4.0.0",
119-
"pyinstaller==5.6.2",
119+
"pyinstaller==5.12.0",
120120
"pytest-asyncio>=0.17,<0.21",
121121
"pytest-cov>=2.7.1,<4.1",
122122
"pytest-timeout>=1.3.3,<2.2",

0 commit comments

Comments
 (0)