Fullscreen Elm App in 0.19 (childNode issue) Reopened

Yes, you’re right, it does break the extension in some ways. I didn’t try it for long enough, unfortunately.

But I think there are still 2 important observations to draw from this:

  • I didn’t try to break the extension, I tried to load things fast. I would have probably broken it if I was using Javascript as well.
  • No one can actually “own” the contents of the body tag. The best thing we might be able to do is control a contiguous slice of its children. (See Evans reply)

Even then, I’m no longer that sure the solution Evan proposed would work in that case: You simply cannot know which elements of the body to replace (because of SSR), and which ones to keep (because a browser extension depends on them) as soon as you initialize your app after DOMContentLoaded, if you don’t want to break extensions like this.

Overall, I feel better about breaking a small number of extensions than breaking the whole website. As a user, I would also prefer a broken browser extension (which means I can’t share cute bunny pictures as easily) over a broken SPA (which means I can’t share and can’t look at pictures of cute bunnies).

I understand the problems of letting people specify a node for application or document programs, but it might be the only solution that will work in every case. Maybe we can add some additional requirements, like making sure the node is a direct child of <body>.

3 Likes