Skip to content

Commit

Permalink
Fix pagetimings not merging
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbeland committed Sep 22, 2023
1 parent aac3bad commit 7995130
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion browserup-proxy.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"url": "logo.png"
},
"title": "BrowserUp MitmProxy",
"version": "1.1.5"
"version": "1.22"
},
"paths": {
"/har": {
Expand Down
6 changes: 4 additions & 2 deletions mitmproxy/addons/browserup/browserup_addons_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@

# https://marshmallow.readthedocs.io/en/stable/quickstart.html

VERSION = '1.22'


class BrowserUpAddonsManagerAddOn:
initialized = False

def load(self, l):
logging.info('Loading BrowserUpAddonsManagerAddOn')
logging.info('Version 1.22')
logging.info('Version {}'.format(VERSION))

ctx.options.update(listen_port = 48080)

Expand Down Expand Up @@ -56,7 +58,7 @@ def is_script_loader_initialized(self):
def basic_spec(self, app):
return APISpec(
title='BrowserUp MitmProxy',
version='1.1.5',
version=VERSION,
servers = [{"url": "http://localhost:{port}/",
"description": "The development API server",
"variables": {"port": {"enum": ["48088"], "default": '48088'}}
Expand Down
4 changes: 2 additions & 2 deletions mitmproxy/addons/browserup/har/har_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def log():
@staticmethod
def page_timings():
return {
"onContentLoad": 0,
"onLoad": 0,
"onContentLoad": -1,
"onLoad": -1,
"comment": ""
}

Expand Down
4 changes: 3 additions & 1 deletion mitmproxy/addons/browserup/har/har_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def add_error_to_har(self, error_dict):

def add_page_timings_to_har(self, page_info):
page = self.get_or_create_current_page()
page['pageTimings'] = page_info
timings = page['pageTimings']
timings.update(page_info)
page['pageTimings'] = timings
logging.info(self.get_or_create_current_page())

def add_page_data_to_har(self, page_data):
Expand Down

0 comments on commit 7995130

Please sign in to comment.