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.

TypeError thrown when used inside a srcdoc iframe

See original GitHub issue

Hi,

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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
esroyocommented, Apr 5, 2020

Many thanks @Mikhus @besfahbod 😃

0reactions
esroyocommented, Apr 4, 2020

Sure! 😃

Read more comments on GitHub >

github_iconTop 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 >

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