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

Extension doesn't play nicely with pages that dynamically update content. #67

Open
alext opened this issue Jul 28, 2023 · 3 comments
Open

Comments

@alext
Copy link

alext commented Jul 28, 2023

Hi,

I'm seeing issues with this extension on a site that has dynamic updates to sections on a page. These are updated by JS setting element.innerHTML. When the dynamic update happens, these elements lose the OpenDyslexic font while the rest of the page retains it.

Digging a little, shows that the helperbird-font-opendyslexic-regular class that's added to every element is no longer added to the elements within the updated block, which is why they're not picking up the font any more.

Extension version: 40.1.0
Browser: Chrome 115

@alext
Copy link
Author

alext commented Jul 28, 2023

I've managed to create a minimal reproduction case. With the following page the font wil disappear from the dynamic block after the update (5 seconds).

<html lang="en">
  <head>
    <style type="text/css">
      h1 {
        font-family: sans-serif;
      }
      p {
        font-family: sans-serif;
      }
    </style>
  </head>
  <body>
    <h1>Test page</h1>
    <p>Static paragraph</p>
    <div id="target">
      <p>Paragraph in dynamic block</p>
    </div>
  </body>
  <script>
    function replaceBlock() {
      const node = document.getElementById('target');
      node.innerHTML = '<p>Updated paragraph</p>';
    }
    window.setTimeout(replaceBlock, 5 * 1000);
  </script>
</html>

@RobertJGabriel
Copy link
Member

Hey @alext,

Thank you for reporting this, I know what to do and will post in more detail later :) Should have it out this weekend.

@RobertJGabriel
Copy link
Member

@alext submitting to the store today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants