Won't work when some extension add dom to body πππ
See original GitHub issueThere 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();
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can you try the alpha release and see if that works
react-frame-component@alpha
v5 is now the latest release