From 23d9dbc011711ed3b57a8d9d63baaf69b5856780 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 4 Apr 2022 19:56:04 -0800 Subject: [PATCH] chore: rewrite non-web protocol for Electron tracing (#13305) --- .../trace/recorder/snapshotterInjected.ts | 4 --- packages/trace-viewer/src/snapshotRenderer.ts | 35 +++++++++++++++++-- packages/trace-viewer/src/snapshotServer.ts | 4 +-- packages/trace-viewer/src/snapshotStorage.ts | 5 ++- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts b/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts index 2dbbb28ee0..697e830b91 100644 --- a/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts +++ b/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts @@ -44,7 +44,6 @@ export function frameSnapshotStreamer(snapshotStreamer: string) { const kScrollTopAttribute = '__playwright_scroll_top_'; const kScrollLeftAttribute = '__playwright_scroll_left_'; const kStyleSheetAttribute = '__playwright_style_sheet_'; - const kBlobUrlPrefix = 'http://playwright.bloburl/#'; // Symbols for our own info on Nodes/StyleSheets. const kSnapshotFrameId = Symbol('__playwright_snapshot_frameid_'); @@ -220,9 +219,6 @@ export function frameSnapshotStreamer(snapshotStreamer: string) { private _sanitizeUrl(url: string): string { if (url.startsWith('javascript:')) return ''; - // Rewrite blob urls so that Service Worker can intercept them. - if (url.startsWith('blob:')) - return kBlobUrlPrefix + url; return url; } diff --git a/packages/trace-viewer/src/snapshotRenderer.ts b/packages/trace-viewer/src/snapshotRenderer.ts index bb83d888fc..6ff7f6bd9b 100644 --- a/packages/trace-viewer/src/snapshotRenderer.ts +++ b/packages/trace-viewer/src/snapshotRenderer.ts @@ -62,8 +62,9 @@ export class SnapshotRenderer { // Never set relative URLs as