Copy and paste files in Firefox with javascript

Good morning.
I am trying to copy a file to a page that receives it, this works fine in chrome, edge and opera, but not in firefox….

The idea is to copy one or several files and to be able to paste them in the browser, the function below recognizes the paste effect, consults the clipboardData and inserts these images or videos in some input files.

The only browser that is not supported is Firefox, and version 83 of chrome as far as I have tested.


window.addEventListener("paste",copyPasteFunction); 

function copyPasteFunction(e){
        var fileInput = document.querySelector("input");
        if(e.clipboardData.files.length > 0){
            fileInput.files = e.clipboardData.files;
            $("input").eq(0).trigger("change");        
        }else{            
            console.log("%cFirefox or unsupported browser", "color:red");
        }
  }

¿Does anyone know of any other method to copy a file, paste it into a page and have it read and inserted into an input?

Thank you very much!