Skip to content

Commit

Permalink
fix(codegen): document.documentElement is null on early navigation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Nov 15, 2024
1 parent e61cea5 commit c81504c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/playwright-core/src/server/injected/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export class Highlight {
}

install() {
if (!this._injectedScript.document.documentElement.contains(this._glassPaneElement))
// NOTE: document.documentElement can be null: https://github.com/microsoft/TypeScript/issues/50078
if (this._injectedScript.document.documentElement && !this._injectedScript.document.documentElement.contains(this._glassPaneElement))
this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);
}

Expand Down

0 comments on commit c81504c

Please sign in to comment.