Skip to content

DOM body's first div is used, but could be used by browser extension #339

@sk22

Description

@sk22

Do you want to request a feature or report a bug?
A conflict, so more of a bug

What is the current behavior?

When using a browser extension that alters the DOM, like Emoji One, the Preact app might not be rendered to the correct spot, or even twice. For example, Emoji One injects an invisible element as the first child of body after some time. Since the app appears always to be rendered onto the first child, this can lead to problems.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Install the Emoji Keyboard by Emoji One Chrome extension
  2. Create a new Preact project
  3. Serve it (I'm using serve because I'm having problems with SimpleHTTPServer)
  4. Add some network throttling (e.g. Slow 3G)
  5. Do a hard reload (CTRL + Shift + R) and watch the app getting rendered twice

What is the expected behavior?

The Preact app should explicitly be rendered to one specific element, e.g. determined by ID or reference.

(In case the selector isn't the cause of the problem, my ideas wouldn't help)

Please mention other relevant information.

  • node version v8.0.0
  • Operating system: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions