Skip to content

Remove fallback to BlobBuilder if Blob constructor is missing #19277

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

Merged
merged 1 commit into from
May 2, 2023
Merged

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented May 2, 2023

This code for handling the absence of Blob constructor goes back to 2012: a97aab0

I'm pretty sure there is nobody depending on this today. I think we would have to go back to chrome 32 or firefox 14 or safari 6 in order to actually need this: https://caniuse.com/blobbuilder

I noticed this looked like it should be removed when following the link in tools/file_packager.py to https://crbug.com/124926, which was marked as WontFix over 10 years ago.

@sbc100
Copy link
Collaborator Author

sbc100 commented May 2, 2023

View with "Hide whitespace" to see the real changes here.

@sbc100 sbc100 requested a review from kripken May 2, 2023 19:40
This code for handling the absence of Blob constructor goes back to
2012: a97aab0

I'm pretty there is nobody depending on this today.  I think we would
have to go back to chrome 32 or firefox 14 or safari 6 in order to
actually need this: https://caniuse.com/blobbuilder

I noticed this looked like it should be removed when following the
link in tools/file_packager.py to https://crbug.com/124926, which
was marked as WontFix over 10 years ago.
@@ -635,11 +635,7 @@ def generate_js(data_target, data_files, metadata):
Module['FS_createPreloadedFile'](this.name, null, byteArray, true, true, function() {
Module['removeRunDependency']('fp ' + that.name);
}, function() {
if (that.audio) {
Module['removeRunDependency']('fp ' + that.name); // workaround for chromium bug 124926 (still no audio with this, but at least we don't hang)
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this? Don't we need the workaround if the bug is WONTFIX?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WONTFIX was for broken BlobBuilder. According to the bug:

Well, BlobBuilder appears to be deprecated (probably for quite a while now) and is undefined in current Linux Chrome dev M35. See comment #16 and http://updates.html5rocks.com/2012/06/Don-t-Build-Blobs-Construct-Them.

As attached, I modified the script in page.html to use the new Blob constructor instead, and the ogg file loads successfully and two sounds play, including when I replay.

And since we are using Blob constructor now there should no longer be an issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Yeah, that's probably right, then, though an earlier comment says

it happens with the Blob constructor too, not just the (deprecated) BlobBuilder
https://bugs.chromium.org/p/chromium/issues/detail?id=124926#c16

But the later comment says it works, and I do see it work locally when I try that modified page.html, so looks good.

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm aside from comment

@sbc100 sbc100 enabled auto-merge (squash) May 2, 2023 21:39
@sbc100 sbc100 merged commit 3130e06 into main May 2, 2023
@sbc100 sbc100 deleted the blob_ctor branch May 2, 2023 21:51
sbc100 added a commit that referenced this pull request May 3, 2023
Perhaps 10 years ago there was possibility that the URL object didn't
exist, but today we don't support such browsers

See https://caniuse.com/url.

This is a followup to #19277 which did the same for the Blob
constructor.
sbc100 added a commit that referenced this pull request May 3, 2023
Perhaps 10 years ago there was possibility that the URL object didn't
exist, but today we don't support such browsers

See https://caniuse.com/url.

This is a followup to #19277 which did the same for the Blob
constructor.
sbc100 added a commit that referenced this pull request May 3, 2023
Perhaps 10 years ago there was possibility that the URL object didn't
exist, but today we don't support such browsers

See https://caniuse.com/url.

This is a followup to #19277 which did the same for the Blob
constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants