question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Won't work when some extension add dom to body πŸ˜‚πŸ˜‚πŸ˜‚

See original GitHub issue

There is a strange issue.Some extension may add dom when the page is created.So initialContent won’t be written to right place. Please help me. πŸ˜‚πŸ˜‚πŸ˜‚

I think using doc.body.children.length is not safe. Maybe props.initialContent has empty body.

 /*
  *  entension may create dom before following code run
  *  so doc.body.children.length will not be 0
  **/
if (doc.body.children.length < 1) {
  doc.open('text/html', 'replace');
  doc.write(this.props.initialContent);
  doc.close();
}

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ryanseddoncommented, Nov 5, 2020

Can you try the alpha release and see if that works react-frame-component@alpha

1reaction
ryanseddoncommented, Apr 20, 2021

v5 is now the latest release

Read more comments on GitHub >

github_iconTop Results From Across the Web

chrome extension -- appending div to body not working with ...
When I checked the dom structure of such pages, these widgets create their own html>body structure within an iframe. And that's what causing...
Read more >
Page: DOMContentLoaded, load, beforeunload, unload
Scripts that are generated dynamically with document.createElement('script') and then added to the webpage also don't block this event.
Read more >
Chrome extensions: Local storage - DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»
I'm back with another post about Chrome extensions! This time I wanted to explore how to store data locally using the chrome.storage API....
Read more >
webpack Tutorial: How to Set Up webpack 5 From Scratch
Let's update it to inject some content into the DOM. Change the index.js entry point to this, and run the build command again....
Read more >
Modify page DOM on click in page action popup
Hello,. I'm looking for a method of modifying current tab content (inject. HTML, CSS, JavaScript) when user click on an element in page...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found