Page 1 of 1

createImageBitmap - unsupported call signatures

Posted: 2024-05-26, 02:19
by UCyborg
Just a heads up, it came into my awareness that there are websites out there that rely on additions to createImageBitmap not supported by the platform.

https://pixai.art/ throws an exception about not enough arguments, causing image previews not showing as expected, eg. even on the first page, you're supposed to see the images without having to click their entries to open them.

Related entry on Bugzilla with another example

TypeError: Not enough arguments to Window.createImageBitmap

Posted: 2024-07-08, 15:27
by vannilla
The createImageBitmap function seems to have received a different signature at some point in time.
https://developer.mozilla.org/en-US/doc ... mageBitmap

Looking at the XRef very quickly UXP does not support the options argument as an extension to the existing supported signatures.

I wanted to play this game: https://skk-atelier.itch.io/sokoban-jelly :)
The game uses the Cocos JS engine so anything built on it is a valid "in the wild" live example.
Code from the engine just for reference: https://github.com/cocos/cocos-engine/b ... ser.ts#L88

Re: TypeError: Not enough arguments to Window.createImageBitmap

Posted: 2024-07-08, 16:27
by Moonchild
I'm sick and tired of this passing through "options" objects to everyone and their uncle. It's such a terrible hybrid approach to established calls.
But I guess it's Yet Another Spec Change (YASC) we will have to implement.

Issue #2545 (UXP)

Re: TypeError: Not enough arguments to Window.createImageBitmap

Posted: 2024-07-09, 06:37
by adoxa
Here's a Modify HTTP Response filter to remove the options.

Code: Select all

[["html-classic.itch.zone",["/_virtual_cc.*\\.js$/",["/(createImageBitmap\\(.),\\{.*?\\}/g","$1"]]]]

Re: TypeError: Not enough arguments to Window.createImageBitmap

Posted: 2024-07-10, 10:09
by UCyborg
For the record, I wrote about this here.

I'm not sure when it comes to technicalities, which board is better. I assumed Browser Development was more for Pale Moon specific things, eg. look 'n feel, web stuff is all handled by the platform AFAIK.

Re: TypeError: Not enough arguments to Window.createImageBitmap

Posted: 2024-07-10, 10:15
by Moonchild
That one just slipped under my radar, sorry about that. Yes, platform development is the better location but I'm usually not super strict about where it's put.
I'll merge both topics.

Re: TypeError: Not enough arguments to Window.createImageBitmap

Posted: 2024-07-10, 23:38
by vannilla
UCyborg wrote:
2024-07-10, 10:09
For the record, I wrote about this here.
Off-topic:
Oops, I missed it completely. :oops:
I think I also read the OP back then but forgot about it. :(

Re: createImageBitmap - unsupported call signatures

Posted: 2024-07-11, 20:44
by UCyborg
Off-topic:
I've always been more of an invisible type. :P