Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first sandbox isn't working in firefox #4694

Open
Yokozuna59 opened this issue Aug 2, 2023 · 0 comments
Open

first sandbox isn't working in firefox #4694

Yokozuna59 opened this issue Aug 2, 2023 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@Yokozuna59
Copy link
Member

Description

This issue has been taken from this thread: #4514 (comment), and we filed the issue so we could merge that PR, and we won't forget about it until we figure out how to resolve this.

Steps to reproduce

I've changed /demos/info.html config to this:

<script type="module">
  import mermaid from './mermaid.esm.mjs';
  mermaid.initialize({
    theme: 'forest',
    logLevel: 3,
-   securityLevel: 'loose',
+   securityLevel: 'sandbox',
  });
</script>

The first would fail, but others would work fine:

image

Not sure why yet, maybe a variable has been defined after first one, that's why e2e testing is failing.

What is being logged:

image

#4514 (comment)


The above screenshot is in firefox, but it works fine in chrome:

image

#4514 (comment)


After more debugging, when I added the following line of code in /packages/diagrams/info/infoRenderer.ts:

if (securityLevel === 'sandbox') {
  const sandboxElement: HTML = select('#i' + id);
  document = sandboxElement.node()?.contentDocument;
+ log.info(document?.body)
}

It shows that the body is being use in the first time is the parent one, not sub body of iframe element:

image

#4514 (comment)

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version: 10.3.0
  • Browser and Version: Firefox

Suggested Solutions

No response

Additional Context

No response

@Yokozuna59 Yokozuna59 added Type: Bug / Error Something isn't working or is incorrect Status: Triage Needs to be verified, categorized, etc labels Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant