Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL.createObjectURL still fails #8187

Open
2 tasks done
CosmoMyzrailGorynych opened this issue May 21, 2024 · 1 comment
Open
2 tasks done

URL.createObjectURL still fails #8187

CosmoMyzrailGorynych opened this issue May 21, 2024 · 1 comment
Labels

Comments

@CosmoMyzrailGorynych
Copy link

CosmoMyzrailGorynych commented May 21, 2024

Issue Type

Before opening an issue, please search and see if it has already been raised.
One of the cases was fixed in:

This is a:

  • Bug Report
  • Successfully reproduced against the latest version of NW.js

Current/Missing Behavior

Calling URL.createObjectURL fails in most occurences:

  1. When nw.js is run with a flag --mixed-context
  2. When URL.createObjectURL is called in an nw-enabled webview (allownw attribute).
  3. When URL.createObjectURL is called in a first window after creating a second one.

The error is

Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.

Minimal code that reproduces that:

URL.createObjectURL(new Blob([]))

Expected/Proposed Behavior

Calling URL.createObjectURL should work

Additional Info

  • Operating System: Confirmed to affect Windows 10 and 11, Linux (SteamOS and others).
  • NW.js Version: 0.87.0
@CosmoMyzrailGorynych CosmoMyzrailGorynych moved this to Blocked / Upstream bugs in Overlook May 21, 2024
@ssnangua
Copy link

I found a temporary solution:

<!-- Fix Blob Start -->
<script>delete window.Blob;</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/Blob.min.js"></script>
<!-- Fix Blob End -->

<script>
    const objectURL = URL.createObjectURL(new Blob(["test"]));
    console.log(objectURL); // 'data:;base64,dGVzdA=='
</script>

But it is still a problem, I hope it can be solved reasonably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants