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.
|
* A short description of the feed. Optional.
|
||||||
*/
|
*/
|
||||||
addLiveBookmark: function PCH_addLiveBookmark(url, feedTitle, feedSubtitle) {
|
addLiveBookmark: function PCH_addLiveBookmark(url, feedTitle, feedSubtitle) {
|
||||||
var ios =
|
var feedURI = makeURI(url);
|
||||||
Cc["@mozilla.org/network/io-service;1"].
|
|
||||||
getService(Ci.nsIIOService);
|
|
||||||
var feedURI = ios.newURI(url, null, null);
|
|
||||||
|
|
||||||
var doc = gBrowser.contentDocument;
|
var doc = gBrowser.contentDocument;
|
||||||
var title = (arguments.length > 1) ? feedTitle : doc.title;
|
var title = (arguments.length > 1) ? feedTitle : doc.title;
|
||||||
|
@ -1182,10 +1182,8 @@ nsContextMenu.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getLinkURI: function() {
|
getLinkURI: function() {
|
||||||
var ioService = Cc["@mozilla.org/network/io-service;1"].
|
|
||||||
getService(Ci.nsIIOService);
|
|
||||||
try {
|
try {
|
||||||
return ioService.newURI(this.linkURL, null, null);
|
return makeURI(this.linkURL);
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
// e.g. empty URL string
|
// e.g. empty URL string
|
||||||
|
@ -622,17 +622,13 @@
|
|||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
var browser = this.getBrowserForTab(aTab);
|
var browser = this.getBrowserForTab(aTab);
|
||||||
browser.mIconURL = aURI;
|
browser.mIconURL = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
|
||||||
|
|
||||||
if (aURI) {
|
if (aURI && this.mFaviconService) {
|
||||||
if (!(aURI instanceof Components.interfaces.nsIURI)) {
|
if (!(aURI instanceof Ci.nsIURI))
|
||||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
aURI = makeURI(aURI);
|
||||||
.getService(Components.interfaces.nsIIOService);
|
this.mFaviconService.setAndLoadFaviconForPage(browser.currentURI,
|
||||||
aURI = ios.newURI(aURI, null, null);
|
aURI, false);
|
||||||
}
|
|
||||||
if (this.mFaviconService)
|
|
||||||
this.mFaviconService.setAndLoadFaviconForPage(browser.currentURI,
|
|
||||||
aURI, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateIcon(aTab);
|
this.updateIcon(aTab);
|
||||||
@ -706,7 +702,7 @@
|
|||||||
req.image.height > sz)
|
req.image.height > sz)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.setIcon(aTab, browser.currentURI.spec);
|
this.setIcon(aTab, browser.currentURI);
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -725,14 +721,11 @@
|
|||||||
<parameter name="aURI"/>
|
<parameter name="aURI"/>
|
||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if (!(aURI instanceof Components.interfaces.nsIURI)) {
|
if (this.mFaviconService) {
|
||||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
if (!(aURI instanceof Ci.nsIURI))
|
||||||
.getService(Components.interfaces.nsIIOService);
|
aURI = makeURI(aURI);
|
||||||
aURI = ios.newURI(aURI, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.mFaviconService)
|
|
||||||
return this.mFaviconService.isFailedFavicon(aURI);
|
return this.mFaviconService.isFailedFavicon(aURI);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
|
@ -283,10 +283,8 @@
|
|||||||
if (val == this.value &&
|
if (val == this.value &&
|
||||||
this.getAttribute("pageproxystate") == "valid") {
|
this.getAttribute("pageproxystate") == "valid") {
|
||||||
let uri;
|
let uri;
|
||||||
let ioService = Cc["@mozilla.org/network/io-service;1"]
|
|
||||||
.getService(Ci.nsIIOService);
|
|
||||||
try {
|
try {
|
||||||
uri = ioService.newURI(val, null, null);
|
uri = makeURI(val);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
if (uri && !uri.schemeIs("javascript") && !uri.schemeIs("data")) {
|
if (uri && !uri.schemeIs("javascript") && !uri.schemeIs("data")) {
|
||||||
@ -387,10 +385,7 @@
|
|||||||
<setter>
|
<setter>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
try {
|
try {
|
||||||
let uri = Cc["@mozilla.org/network/io-service;1"].
|
val = losslessDecodeURI(makeURI(val));
|
||||||
getService(Ci.nsIIOService).
|
|
||||||
newURI(val, null, null);
|
|
||||||
val = losslessDecodeURI(uri);
|
|
||||||
} catch (ex) { }
|
} catch (ex) { }
|
||||||
this.value = val;
|
this.value = val;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user