Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First you need a function to know whether DOM is ready. A functionality provided by many Javascript frameworks, but <a href="http://books.google.com/books?id=GgJN2CC_2s4C&amp;lpg=PA90&amp;ots=7x_fgZadNI&amp;dq=domready%20techniques&amp;pg=PA89#v=onepage&amp;q&amp;f=false" rel="nofollow">refer this</a> if you need a pure js implementation.<br> <em>When the DOM is ready the button is enabled for the user to click.</em><br> Then you may have a function to serialize the DOM tree to a string. As Load and Save DOM is not yet implemented in Mozilla, read <a href="https://developer.mozilla.org/en/Parsing_and_serializing_XML" rel="nofollow">this MDN article</a> to get to know what you want.<br> Now you can send the Saved DOM to your Web Service.</p> <pre class="lang-js prettyprint-override"><code>//Code grabbed mostly from MDN article linked var req = new XMLHttpRequest(); req.open("GET", "chrome://passwdmaker/content/people.xml", false); req.send(null); var dom = req.responseXML; var serializer = new XMLSerializer(); var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); var file = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties) .get("ProfD", Components.interfaces.nsILocalFile);//get profile folder file.append("extensions"); // extensions sub-directory file.append("{5872365E-67D1-4AFD-9480-FD293BEBD20D}");//GUID of your extension file.append("myXMLFile.xml"); // filename foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0);//write, create, truncate serializer.serializeToStream(dom, foStream, "");//remember, dom is the DOM tree foStream.close(); </code></pre> <p>Hope this would help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload