electron-har icon indicating copy to clipboard operation
electron-har copied to clipboard

Add network throttling and device user agent configs

Open bmcminn opened this issue 9 years ago • 8 comments

Fix #5

EDIT:

  • :shell: add CLI option -A (user agent) with argument validation
  • :shell: add CLI option -Y (network throttling) with argument validation
  • fix user-agent string override when using -A
  • :shell: add CLI option --landscape which forces device orientation to landscape
  • configure src/profiles/devices.js based on Chromium device profile definitions:
    • https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
  • configured src/profiles/networks.js based on Chromium network speed definitions:
    • https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js&q=%22Good%203G%22&sq=package:chromium&dr=C&l=50
  • :art: general formatting of scripts
  • :clipboard: add commentary to script components

bmcminn avatar Mar 31 '16 21:03 bmcminn

Good work! Would you mind removing console.log calls and rebase the branch (right now I can't merge it in due to "This branch has conflicts that must be resolved")?

Also, where does src/profiles/devices.js & src/profiles/networks.js data come from? Thank you.

shyiko avatar Apr 01 '16 00:04 shyiko

Alright, finally got the rebase worked out.

Also, the src/profiles data was extrapolated from the latest Chrome throttling and UA device configs in dev tools.

bmcminn avatar Apr 01 '16 07:04 bmcminn

I propose we take list of devices from here. What do you think?

shyiko avatar Apr 02 '16 18:04 shyiko

Also, download/upload throttling is calculated differently. See here.

shyiko avatar Apr 02 '16 18:04 shyiko

I like that idea. Just added those defs verbatim to src/profiles/devices.js.

I also went ahead and fixed up a few other things and updated the PR description. I think this feature is ready to close now.

bmcminn avatar Apr 03 '16 07:04 bmcminn

Hey man. Unfortunately it looks like this PR will have to wait. My laptop won't turn on :) Will get back to it as soon as I have it fixed.

shyiko avatar Apr 03 '16 18:04 shyiko

Hey @shyiko any update on your laptop situation?

bmcminn avatar Apr 07 '16 15:04 bmcminn

@bmcminn I'm getting it back tomorrow morning.

shyiko avatar Apr 11 '16 20:04 shyiko