browsertime 16.13.2 → 16.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
3
 
4
+ ## 16.13.3 - 2022-08-17
5
+
6
+ ### Fixed
7
+ * Make sure set cookies work when navigating in script for Chrome/Edge [#1830](https://github.com/sitespeedio/browsertime/pull/1830).
8
+
4
9
  ## 16.13.2 - 2022-08-14
5
10
  ### Fixed
6
11
  * Disable adding lastCPULongTask to the HAR data since it breaks waterfall view on slow mobile phones with late CPU long tasks [#1828](https://github.com/sitespeedio/browsertime/pull/1828).
@@ -444,6 +444,10 @@ class Chromium {
444
444
  return { har: harBuilder.mergeHars(this.hars) };
445
445
  } else return {};
446
446
  }
447
+
448
+ async setCookies(url, cookies) {
449
+ return this.cdpClient.setCookies(url, cookies);
450
+ }
447
451
  }
448
452
 
449
453
  module.exports = Chromium;
@@ -141,6 +141,15 @@ class Measure {
141
141
  log.info('Navigating to url %s iteration %s', url, this.index);
142
142
  if (this.numberOfVisitedPages === 0) {
143
143
  await this.extensionServer.setup(url, this.browser, this.options);
144
+
145
+ // There's a bug that we introduced when moving cookie handling to CDP
146
+ // and this is the hack to fix that.
147
+ if (
148
+ (this.options.cookie && this.options.browser === 'chrome') ||
149
+ this.options.browser === 'edge'
150
+ ) {
151
+ await this.engineDelegate.setCookies(url, this.options.cookie);
152
+ }
144
153
  }
145
154
  if (this.numberOfVisitedPages === 0) {
146
155
  await this.engineDelegate.beforeStartIteration(this.browser, this.index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "description": "Browsertime",
3
- "version": "16.13.2",
3
+ "version": "16.13.3",
4
4
  "bin": "./bin/browsertime.js",
5
5
  "dependencies": {
6
6
  "@cypress/xvfb": "1.2.4",