diff --git a/packages/html-reporter/src/headerView.tsx b/packages/html-reporter/src/headerView.tsx index 925bc64721..01f92f1ecb 100644 --- a/packages/html-reporter/src/headerView.tsx +++ b/packages/html-reporter/src/headerView.tsx @@ -20,7 +20,7 @@ import './colors.css'; import './common.css'; import './headerView.css'; import * as icons from './icons'; -import { Link, navigate } from './links'; +import { Link, navigate, SearchParamsContext } from './links'; import { statusIcon } from './statusIcon'; import { filterWithToken } from './filter'; @@ -65,7 +65,7 @@ export const HeaderView: React.FC = ({ stats }) => { - const searchParams = new URLSearchParams(window.location.hash.slice(1)); + const searchParams = React.useContext(SearchParamsContext); const q = searchParams.get('q')?.toString() || ''; const tokens = q.split(' '); return