Skip to content

Commit

Permalink
Merge branch 'main' into new-network-idle
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Oct 20, 2023
2 parents bdf1479 + 3159741 commit 6082204
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 22 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Browsertime changelog (we do [semantic versioning](https://semver.org))

## 17.17.0 - 2022-10-11
### Added
* Firefox 118, Edge 117 and Chrome/Chromedriver 118 in the Docker container [#1996](https://github.com/sitespeedio/browsertime/pull/1996).
* Expose trace start/stop for Chrome in scripting (the same way as for Firefox). Thank you [KS](https://github.com/92kns) for [#1988](https://github.com/sitespeedio/browsertime/pull/1988). Documentation is coming when the functionality is rolled out in sitespeed.io.

### Updated
* Updated to Selenium 4.12

## 17.16.0 - 2022-09-04
### Added
* Firefox 117 and Edge 116 in the Docker container.
Expand Down
21 changes: 17 additions & 4 deletions browserscripts/pageinfo/resources.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
(function() {
(function () {
const resources = window.performance.getEntriesByType('resource');

let resourceDuration = 0;
let servedFromCache = 0;
let servedFromCacheSupported = false;
for (let i = 0; i < resources.length; i++) {
resourceDuration += resources[i].duration;
if (resources[i].deliveryType !== undefined) {
servedFromCacheSupported = true;
if (resources[i].deliveryType === 'cache') {
servedFromCache++;
}
}
}

return {
const info = {
count: Number(resources.length),
duration: Number(resourceDuration)
duration: Number(resourceDuration),
};

if (servedFromCacheSupported === true) {
info.servedFromCache = Number(servedFromCache);
}
})();

return info;
})();
9 changes: 3 additions & 6 deletions lib/core/engine/command/geckoProfiler.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import intel from 'intel';
const log = intel.getLogger('browsertime.command.geckoprofiler');
export class GeckoProfiler {
constructor(GeckoProfiler, browser, index, options) {
constructor(GeckoProfiler, browser, index, options, result) {
this.GeckoProfiler = GeckoProfiler;
this.browser = browser;
this.index = index;
this.options = options;
this.result = result;
}

async start() {
Expand All @@ -25,11 +26,7 @@ export class GeckoProfiler {
async stop() {
if (this.options.browser === 'firefox') {
if (this.options.firefox.geckoProfilerRecordingType === 'custom') {
const url = await this.browser
.getDriver()
.executeScript('return document.documentURI;');

return this.GeckoProfiler.stop(this.index, url);
return this.GeckoProfiler.stop(this.index, this.result[0].url);
}
} else {
throw new Error('Geckoprofiler only works in Firefox');
Expand Down
3 changes: 2 additions & 1 deletion lib/core/engine/iteration.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ export class Iteration {
browserProfiler,
browser,
index,
this.options
this.options,
result
);
const cdp = new ChromeDevelopmentToolsProtocol(
engineDelegate,
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "browsertime",
"description": "Get performance metrics from your web page using Browsertime.",
"version": "17.16.0",
"version": "17.17.0",
"bin": "./bin/browsertime.js",
"type": "module",
"dependencies": {
"@cypress/xvfb": "1.2.4",
"@devicefarmer/adbkit": "2.11.3",
"@sitespeed.io/chromedriver": "118.0.5993-70",
"@sitespeed.io/chromedriver": "119.0.6045-21",
"@sitespeed.io/edgedriver": "115.0.1901-183",
"@sitespeed.io/geckodriver": "0.33.0",
"@sitespeed.io/throttle": "5.0.0",
Expand Down

0 comments on commit 6082204

Please sign in to comment.