diff --git a/lib/internal/perf/resource_timing.js b/lib/internal/perf/resource_timing.js index ff0728c9f0ffff..63403bf0ac405a 100644 --- a/lib/internal/perf/resource_timing.js +++ b/lib/internal/perf/resource_timing.js @@ -46,6 +46,10 @@ class InternalPerformanceResourceTiming extends InternalPerformanceEntry { return this[kTimingInfo].endTime - this[kTimingInfo].startTime; } + get initiatorType() { + return this[kInitiatorType]; + } + get workerStart() { return this[kTimingInfo].finalServiceWorkerStartTime; } diff --git a/test/parallel/test-perf-hooks-resourcetiming.js b/test/parallel/test-perf-hooks-resourcetiming.js index 60a7e908bed6f4..bf4b49347bb289 100644 --- a/test/parallel/test-perf-hooks-resourcetiming.js +++ b/test/parallel/test-perf-hooks-resourcetiming.js @@ -134,6 +134,7 @@ function createTimingInfo({ assert.ok(typeof resource.cacheMode === 'undefined', 'cacheMode does not have a getter'); assert.strictEqual(resource.startTime, timingInfo.startTime); assert.strictEqual(resource.duration, 0); + assert.strictEqual(resource.initiatorType, initiatorType); assert.strictEqual(resource.workerStart, 0); assert.strictEqual(resource.redirectStart, 0); assert.strictEqual(resource.redirectEnd, 0);