Monday, July 23, 2007

xul loadURIWitthFlags exception

if u failed to run loadURIWithFlags, check if u have created your referrer (referer) correctly.

var nsIWebNavigation = Components.interfaces.nsIWebNavigation;
var aref1 = browser.contentDocument.referrer;
var aref2 = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(aref1, null, null);

dont just use a string object as the referrer (referer).
by the way, referrer is wrong, should be refer ....

No comments: