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.

Add URL.createObjectURL and URL.revokeObjectURL

See original GitHub issue

Hi, jsdom already supports the URL constructor, but not these 2 static methods, they are supported in most modern browsers.

createObjectURL revokeObjectURL Can I use

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:101
  • Comments:34 (5 by maintainers)

github_iconTop GitHub Comments

37reactions
dylanjhacommented, Jun 5, 2018

@fredvollmer if using jest with jsdom and you want to noop this function you can add this code to setupTest.js (or an equivalent setup script)

function noOp () { }

if (typeof window.URL.createObjectURL === 'undefined') {
  Object.defineProperty(window.URL, 'createObjectURL', { value: noOp})
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

URL.revokeObjectURL() - Web APIs | MDN
The URL.revokeObjectURL() static method releases an existing object URL which was previously created by calling URL.createObjectURL().
Read more >
CreateObjectURL and RevokeObjectURL (Explained by ...
In this video we will learn how to use CreateObjectURL and RevokeObjectURL to cache resources locally after loading them with the fetch url...
Read more >
HTML DOM revokeObjectURL() method - GeeksforGeeks
The URL revokeObjectURL() method releases an existing object URL which was created by using URL createObjectURL(). This method is called ...
Read more >
When is it safe to call URL.revokeObjectURL? - Stack Overflow
createObjectURL creates a URL that represents a file or a blob. Because the URL is just a string the browser has no way...
Read more >
Using URL.createObjectURL() - LinkedIn
Syntax from MDN: window.URL.revokeObjectURL(objectURL);. Calling the revokeObjectURL() static function also lets the browser know that this file ...
Read more >

github_iconTop Related Medium Post

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