rem: var data = new Object(); var dataLen = new Object(); trans.getTransferData("text/unicode", data, dataLen); var url = null; if (data) { data = data.value.QueryInterface(Components.interfaces .nsISupportsWString); url = data.data.substring(0, dataLen.value / 2); } return url; } catch(ex) { return null; 
add:  var trans = Components.classes["@mozilla.org/widget/transferable;1"] .createInstance(Components.interfaces.nsITransferable);  trans.addDataFlavor("text/unicode"); clipboard.getData(trans, clipboard.kSelectionClipboard);  var data = {}; var dataLen = {}; trans.getTransferData("text/unicode", data, dataLen);  if (data) { data = data.value.QueryInterface(Components.interfaces.nsISupportsWString); url = data.data.substring(0, dataLen.value / 2); 
context:   function readFromClipboard()  {    try {      // Get clipboard.      var clipboard = Components                        .classes["@mozilla.org/widget/clipboard;1"]                          .getService ( Components.interfaces.nsIClipboard );      // Create tranferable that will transfer the text.      var trans = Components                     .classes["@mozilla.org/widget/transferable;1"]                       .createInstance( Components.interfaces.nsITransferable );      if ( !clipboard || !trans )        return null;      trans.addDataFlavor( "text/unicode" );      clipboard.getData(trans, clipboard.kSelectionClipboard);      var data = new Object();      var dataLen = new Object();      trans.getTransferData("text/unicode", data, dataLen);      var url = null;      if (data)      {        data = data.value.QueryInterface(Components.interfaces                                                      .nsISupportsWString);        url = data.data.substring(0, dataLen.value / 2);      }      return url;    } catch(ex) {      return null;    }  }
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/8af6fdd67793deac301bb3a38dd32a9feff8f9a9/navigator.js/clean/suite/browser/navigator.js