Problem/Motivation

When loading a web page with seckit module installed, Firefox gives a number of warnings

An unbalanced tree was written using document.write() causing data from the network to be reparsed. More information: https://developer.mozilla.org/en-US/docs/Glossary/speculative_parsing

It blames this code.

/**
 * If site is not being framed or being framed within the same host,
 * start commenting out seckit.no_body.css.
 */
if (top === self || top.location.hostname === self.location.hostname) {
  document.write('<!--');
}

It relies on document.write, which according to https://developer.mozilla.org/en-US/docs/Web/API/Document/write#browser_... is "deprecated"

Proposed resolution

I am not sure whether I completely understand the purpose of above code, I think

document.getElementById('seckit-clickjacking-no-body')?.remove();

might also do the trick, as it would remove the
containing seckit.no_body.css.

Comments

jvdkolk created an issue. See original summary.

jvdkolk’s picture

Issue summary: View changes
jvdkolk’s picture

Status: Active » Closed (duplicate)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.