chore: rename popout.html to snapshot.html in trace viewer (#23842)

Turns out its caused by a uBlockOrigin EasyList entry which thinks we
are an ad since we call ourselves "popout.html". See this entry:


e7883cfe74/easylist/easylist_general_block_popup.txt (L42)

Fixes https://github.com/microsoft/playwright/issues/23799
This commit is contained in:
Max Schmitt 2023-06-21 21:10:50 +02:00 committed by GitHub
parent 752176fd23
commit 605dfde2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -353,10 +353,10 @@ function rewriteURLsInStyleSheetForCustomProtocol(text: string): string {
}); });
} }
// <base>/popout.html?r=<snapshotUrl> is used for "pop out snapshot" feature. // <base>/snapshot.html?r=<snapshotUrl> is used for "pop out snapshot" feature.
export function unwrapPopoutUrl(url: string) { export function unwrapPopoutUrl(url: string) {
const u = new URL(url); const u = new URL(url);
if (u.pathname.endsWith('/popout.html')) if (u.pathname.endsWith('/snapshot.html'))
return u.searchParams.get('r')!; return u.searchParams.get('r')!;
return url; return url;
} }

View File

@ -73,7 +73,7 @@ export const SnapshotTab: React.FunctionComponent<{
const popoutParams = new URLSearchParams(); const popoutParams = new URLSearchParams();
popoutParams.set('r', snapshotUrl); popoutParams.set('r', snapshotUrl);
popoutParams.set('trace', context(snapshot.action).traceUrl); popoutParams.set('trace', context(snapshot.action).traceUrl);
const popoutUrl = new URL(`popout.html?${popoutParams.toString()}`, window.location.href).toString(); const popoutUrl = new URL(`snapshot.html?${popoutParams.toString()}`, window.location.href).toString();
return { snapshots, snapshotInfoUrl, snapshotUrl, pointX, pointY, popoutUrl }; return { snapshots, snapshotInfoUrl, snapshotUrl, pointX, pointY, popoutUrl };
}, [snapshots, snapshotTab]); }, [snapshots, snapshotTab]);

View File

@ -45,7 +45,7 @@ export default defineConfig({
input: { input: {
index: path.resolve(__dirname, 'index.html'), index: path.resolve(__dirname, 'index.html'),
uiMode: path.resolve(__dirname, 'uiMode.html'), uiMode: path.resolve(__dirname, 'uiMode.html'),
popout: path.resolve(__dirname, 'popout.html'), snapshot: path.resolve(__dirname, 'snapshot.html'),
}, },
output: { output: {
entryFileNames: () => '[name].[hash].js', entryFileNames: () => '[name].[hash].js',