0

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

Question:

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!

Vyacheslav
  • 99
  • 3
  • 8
  • I missed why you do need to fill an input[type=file]? From web API, the only way to change the FileList object of an input is to set it to an other FileList object, or `null`. The only way to get a FileList object is from an input, or drag/paste(?) events. Now for chrome:// scripts, you have much more powerful tools to deal with FileIO, but I don't know it enough to know if they can create FileList objects or even change an input's files value... – Kaiido Oct 31 '17 at 08:44
  • 1
    I'm using chrome. `input[file]` needs to be filled for next normal work on browser. Because any sites like facebook or youtube have self logic to work with `input[file]` after event `change`. Data can be submited or maybe deleted, I don't know. – Vyacheslav Oct 31 '17 at 08:53
  • I'm looking to change xmlHttpRequests with custom data, but this is obviously a bad way – Vyacheslav Oct 31 '17 at 13:09
  • Now I'm using `input.__defineGetter__('files', ...)` for `input[file]` and just imitate FileList class by creating new one: `FileList = function(files) {...}` – Vyacheslav Nov 02 '17 at 07:27

0 Answers0