mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 506861 - make more use of makeURI(). r=gavin
This commit is contained in:
parent
3f2b8bfc51
commit
f7fa537188
@ -524,10 +524,7 @@ var PlacesCommandHook = {
|
||||
* A short description of the feed. Optional.
|
||||
*/
|
||||
addLiveBookmark: function PCH_addLiveBookmark(url, feedTitle, feedSubtitle) {
|
||||
var ios =
|
||||
Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
var feedURI = ios.newURI(url, null, null);
|
||||
var feedURI = makeURI(url);
|
||||
|
||||
var doc = gBrowser.contentDocument;
|
||||
var title = (arguments.length > 1) ? feedTitle : doc.title;
|
||||
|
@ -1182,10 +1182,8 @@ nsContextMenu.prototype = {
|
||||
},
|
||||
|
||||
getLinkURI: function() {
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
try {
|
||||
return ioService.newURI(this.linkURL, null, null);
|
||||
return makeURI(this.linkURL);
|
||||
}
|
||||
catch (ex) {
|
||||
// e.g. empty URL string
|
||||
|
@ -622,15 +622,11 @@
|
||||
<body>
|
||||
<![CDATA[
|
||||
var browser = this.getBrowserForTab(aTab);
|
||||
browser.mIconURL = aURI;
|
||||
browser.mIconURL = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
|
||||
|
||||
if (aURI) {
|
||||
if (!(aURI instanceof Components.interfaces.nsIURI)) {
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
aURI = ios.newURI(aURI, null, null);
|
||||
}
|
||||
if (this.mFaviconService)
|
||||
if (aURI && this.mFaviconService) {
|
||||
if (!(aURI instanceof Ci.nsIURI))
|
||||
aURI = makeURI(aURI);
|
||||
this.mFaviconService.setAndLoadFaviconForPage(browser.currentURI,
|
||||
aURI, false);
|
||||
}
|
||||
@ -706,7 +702,7 @@
|
||||
req.image.height > sz)
|
||||
return;
|
||||
|
||||
this.setIcon(aTab, browser.currentURI.spec);
|
||||
this.setIcon(aTab, browser.currentURI);
|
||||
} catch (e) { }
|
||||
}
|
||||
}
|
||||
@ -725,14 +721,11 @@
|
||||
<parameter name="aURI"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!(aURI instanceof Components.interfaces.nsIURI)) {
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
aURI = ios.newURI(aURI, null, null);
|
||||
}
|
||||
|
||||
if (this.mFaviconService)
|
||||
if (this.mFaviconService) {
|
||||
if (!(aURI instanceof Ci.nsIURI))
|
||||
aURI = makeURI(aURI);
|
||||
return this.mFaviconService.isFailedFavicon(aURI);
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
|
@ -283,10 +283,8 @@
|
||||
if (val == this.value &&
|
||||
this.getAttribute("pageproxystate") == "valid") {
|
||||
let uri;
|
||||
let ioService = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
try {
|
||||
uri = ioService.newURI(val, null, null);
|
||||
uri = makeURI(val);
|
||||
} catch (e) {}
|
||||
|
||||
if (uri && !uri.schemeIs("javascript") && !uri.schemeIs("data")) {
|
||||
@ -387,10 +385,7 @@
|
||||
<setter>
|
||||
<![CDATA[
|
||||
try {
|
||||
let uri = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService).
|
||||
newURI(val, null, null);
|
||||
val = losslessDecodeURI(uri);
|
||||
val = losslessDecodeURI(makeURI(val));
|
||||
} catch (ex) { }
|
||||
this.value = val;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user