TypeError thrown when used inside a srcdoc iframe
See original GitHub issueHi,
I’ve found an issue when one of our scripts that use domurl was injected inside a srcdoc iframe.
That is an strange case, but I though It may be worth mentioning it.
Here there is a minimal example:
<!doctype html>
<html>
<body>
<iframe srcdoc='<script src="https://cdn.jsdelivr.net/npm/domurl@2.3.0/url.js" integrity="sha256-4NOatzFOPdRvADrRwu+TbGMS2LQNQ0ZEseTjM1sdFj4=" crossorigin="anonymous"></script><script>var url = new Url("/robots.txt");</script>'></iframe>
</body>
</html>
Output:
TypeError: getCurrUrl(...).match(...) is null
What do you think? It feels like something that should be “gracefully” handled? A bit difficult may be.
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Uncaught error when trying to render [object HTMLDocument ...
Initially, inside a React application, I retrieved HTML file from ... When I use srcDoc, the iframe element has a #document child which ......
Read more >Unable to access iframe #3323 - DevExpress/testcafe - GitHub
An error occurred in Selector code: TypeError: this.each is not a ... Meanwhile, I found that using srcdoc attribute inside iframe is ...
Read more >SEO and the Iframe srcDoc attribute
My strong recommendation, if you make use of iframe , do explicit control of the iframe content: if you want iframe content is...
Read more >Safari Technology Preview Release Notes - Apple Developer
Changed to keep MediaKeySystemAccess alive in a createMediaKeys() async task ... Fixed iframe srcdoc with a quirky doctype to use no-quirks mode ...
Read more >4.8.2 The iframe element — HTML5 - W3C
Whenever an iframe element with a nested browsing context has its srcdoc attribute set, changed, or removed, the user agent must process the ......
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
Many thanks @Mikhus @besfahbod 😃
Sure! 😃