JavaScript var url = 'http://zigorou:hogehoge@www.google.co.jp:8080/foo/bar/hoge.js;aaa?foo=bar#hoge'; var Cc = Components.classes; var Ci = Components.interfaces; var IOService = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService); var uri = IOService.newURI(url, null, null).QueryInterface(Ci.nsIURL); // 相対パスの解決 is(uri.resolve('../fuga.css'), 'http://zigorou:hogehoge@www.google.co