1

I have a custom plugin for FireFox which writes a file in the users filesystem at a specified location. The plugin is invoked via appending a hidden tag to the body of the document with the plugin commands as attributes in the tag (Save, Remove etc) This works great however, I want to know when the entire file has completed writing. I can see the GET request in the browser debugger network tab and can see when it finishes writing the file. I want to add an event listener to that GET request and fire a call back when complete on Status 200 OK. I have tried all kinds of methods like adding an ID to the embed tag and using jQuery $("embed").load(function(){ callback }); But I think I am missing a step or something?

Is there a way to listen for a GET request fired when an tag has been appended to the body of a document? I would love to find a pure javascript solution. I do have jQuery available if its easier. or maybe I am missing something pretty easy to do?

ok so to be clear:

$("body")append("<embed type='application/x-abc-fileactions' hidden='true' command='save' filename='c:\fileactions\somefile.txt'>");

this fires off a GET request once I embed it and downloads somefile.txt file from a vault server.

I would like to have a callback after the entire file somefile.txt can completed writing.

Let me know if that clears it up?

Paul
  • 1,527
  • 2
  • 16
  • 24
  • 1
    you can't reasonably know when an embed has finished loading. – Daniel A. White Oct 30 '14 at 20:27
  • I think I am finding that out. However, I can see the GET request. Is there a way to tell when that has finished? It seems hack but is this something I am looking for? http://stackoverflow.com/questions/3489433/monitor-all-javascript-events-in-the-browser-console – Paul Oct 30 '14 at 20:28
  • i'm sorry but you are limited to what the browser can give you. – Daniel A. White Oct 30 '14 at 20:30
  • Thanks Daniel. Appreciate the comments... – Paul Oct 30 '14 at 20:35

0 Answers0