cherry-pick(#33627): fix(codegen): document.documentElement is null on early navigation
This commit is contained in:
parent
c0fa804367
commit
698823a78e
|
|
@ -90,7 +90,8 @@ export class Highlight {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
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);
|
this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue