saveFrames function not working in Firefox

I’m using the sameframe function to , save the images of a gif animation I have in my website.
This is my function:

saveFrames('out', 'png', 2, 25, function saveFrames(callbackData){
       console.log('Button clicked');

If I remove the part of the callbackfunction, the frames get saved without any issues, but when I add the function as the one I shared below, nothing happens.

I tested it in chrome, and I’m able to see the array that got created with the frames and the console log.
In firefox nothing happens.