-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added network throttling and user agent device parameters
- Loading branch information
Showing
5 changed files
with
252 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "electron-har", | ||
"description": "A command-line tool for generating HTTP Archive (HAR) (based on Electron)", | ||
"version": "0.1.8", | ||
"version": "0.2.0", | ||
"author": "Stanley Shyiko <[email protected]>", | ||
"license": "MIT", | ||
"repository": { | ||
|
@@ -12,7 +12,7 @@ | |
"main": "./src/index.js", | ||
"dependencies": { | ||
"cross-exec-file": "^1.0.0", | ||
"electron-prebuilt": "^0.35.4", | ||
"electron-prebuilt": "^0.35.6", | ||
"json-stable-stringify": "^1.0.0", | ||
"object-assign": "^4.0.1", | ||
"tmp": "^0.0.28", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
module.exports = { | ||
GALAXY_S5: { | ||
diviceName: 'Galaxy S5', | ||
width: 360, | ||
height: 640, | ||
pixelRatio: 2, | ||
userAgentString: 'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36', | ||
useragentType: 'mobile' | ||
}, | ||
NEXUS_5X: { | ||
diviceName: 'Nexus 5X', | ||
width: 411, | ||
height: 731, | ||
pixelRatio: 2.625, | ||
userAgentString: 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36', | ||
useragentType: 'mobile' | ||
}, | ||
NEXUS_6P: { | ||
diviceName: 'Nexus 6P', | ||
width: 435, | ||
height: 773, | ||
pixelRatio: 3.3, | ||
userAgentString: 'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36', | ||
useragentType: 'mobile' | ||
}, | ||
IPHONE_5: { | ||
diviceName: 'iPhone 5', | ||
width: 320, | ||
height: 568, | ||
pixelRatio: 2, | ||
userAgentString: 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', | ||
useragentType: 'mobile' | ||
}, | ||
IPHONE_6: { | ||
diviceName: 'iPhone 6', | ||
width: 375, | ||
height: 667, | ||
pixelRatio: 2, | ||
userAgentString: 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', | ||
useragentType: 'mobile' | ||
}, | ||
IPHONE_6PLUS: { | ||
diviceName: 'iPhone 6+', | ||
width: 414, | ||
height: 736, | ||
pixelRatio: 3, | ||
userAgentString: 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', | ||
useragentType: 'mobile' | ||
}, | ||
IPAD: { | ||
diviceName: 'iPad', | ||
width: 768, | ||
height: 1024, | ||
pixelRatio: 2, | ||
userAgentString: 'Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', | ||
useragentType: 'mobile' | ||
}, | ||
DESKTOP_1080P: { | ||
diviceName: 'Desktop 1080p', | ||
width: 1920, | ||
height: 1080, | ||
pixelRatio: 1, | ||
userAgentString: '', | ||
useragentType: 'desktop' | ||
}, | ||
LAPTOP_1080P: { | ||
diviceName: 'Laptop Touch screen', | ||
width: 1920, | ||
height: 1080, | ||
pixelRatio: 1, | ||
userAgentString: '', | ||
useragentType: 'desktop with touch' | ||
} | ||
// IPAD_PRO: { | ||
// diviceName: 2, | ||
// width: 30000, | ||
// height: 15000, | ||
// pixelRatio: '', | ||
// userAgentString: 'Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', | ||
// useragentType: 'mobile' | ||
// } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
var Mb = 100000; // 1 million Bytes in a Megabyte | ||
var Kb = 1000; // 1 thousand Bytes in a Kilobyte | ||
|
||
|
||
/** | ||
* List of enumerated latency profiles | ||
* @sauce: https://github.com/atom/electron/blob/master/docs/api/session.md#sesenablenetworkemulationoptions | ||
* @type {Object} | ||
*/ | ||
module.exports = { | ||
WIFI: { | ||
latency: 2, | ||
downloadThroughput: 30*Mb, | ||
uploadThroughput: 15*Mb | ||
}, | ||
DSL: { | ||
latency: 5, | ||
downloadThroughput: 2*Mb, | ||
uploadThroughput: 1*Mb | ||
}, | ||
REGULAR_4G: { | ||
latency: 20, | ||
downloadThroughput: 4*Mb, | ||
uploadThroughput: 3*Mb | ||
}, | ||
GOOD_3G: { | ||
latency: 40, | ||
downloadThroughput: 1*Mb, | ||
uploadThroughput: 750*Kb | ||
}, | ||
REGULAR_3G: { | ||
latency: 100, | ||
downloadThroughput: 750*Kb, | ||
uploadThroughput: 250*Kb | ||
}, | ||
GOOD_2G: { | ||
latency: 150, | ||
downloadThroughput: 450*Kb, | ||
uploadThroughput: 150*Kb | ||
}, | ||
REGULAR_2G: { | ||
latency: 300, | ||
downloadThroughput: 250*Kb, | ||
uploadThroughput: 50*Kb | ||
}, | ||
GPRS: { | ||
latency: 500, | ||
downloadThroughput: 50*Kb, | ||
uploadThroughput: 20*Kb, | ||
} | ||
}; |