Feeling input[file] by files with custom content

Extension description:

The extension which receives commands from the remote browser (through peerConnection) and sends stream of local browser’s (local browser is where this extension was installed) screen back to host (host is user from remote browser and who controlls local browser).

Host sees local’s browser screen and can click or make any DOM event with elements from local browser’s content on his remote browser.

It simulates local work on browser (as same as TeamViewer’s logic).

What needs:

When local browser receives click command on element and this element is input[file] – must be next logic:

  1. extension sends a trigger on remote browser that input[file] was clicked and now is waiting a custom file from host
  2. explorer dialog window are opening on remote browser and host chooses a file
  3. file’s content converts to binary code (or something else, doesn’t matter) and sends back a data from remote browser to extension
  4. local browser changes FileList for input[file] and triggers event change for input

What’s the problem:

But security policy disable access to change FileList and browser can’t make a custom list for input.

I want to simulate files uploading procedure by the remote browser. I see only way:

  1. create new file and fill with content
  2. add to FileList of input
  3. trigger change event and submit if it needs


Do anyone had some expirience with it? Or any idea how to avoid security? Or maybe you see another ways to upload files remotely?

Big thanks!