Skip to content

Commit

Permalink
cherry-pick(#33627): fix(codegen): document.documentElement is null o…
Browse files Browse the repository at this point in the history
…n early navigation
  • Loading branch information
mxschmitt committed Nov 15, 2024
1 parent c0fa804 commit 698823a
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 698823a

Please sign in to comment.