Bug 1939658 - Replace new URL usage with URL.parse/URL.canParse where possible. r=robwu,Standard8,Gijs,mtigley,pdahiya,settings-reviewers,credential-management-reviewers,devtools-reviewers,tabbrowser-reviewers,places-reviewers,omc-reviewers,migration-reviewers,firefox-desktop-core-reviewers ,home-newtab-reviewers,webcompat-reviewers,urlbar-reviewers,twisniewski,mossop,dao,nchevobbe,webdriver-reviewers,whimboo,issammani,mconley,nbarrett,beth
Differential Revision: https://phabricator.services.mozilla.com/D233071
This commit is contained in:
@@ -203,13 +203,11 @@ var gBrowserInit = {
|
||||
// Hack to ensure that the various initial pages favicon is loaded
|
||||
// instantaneously, to avoid flickering and improve perceived performance.
|
||||
this._callWithURIToLoad(uriToLoad => {
|
||||
let url;
|
||||
try {
|
||||
url = Services.io.newURI(uriToLoad);
|
||||
} catch (e) {
|
||||
let url = URL.parse(uriToLoad);
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
let nonQuery = url.prePath + url.filePath;
|
||||
let nonQuery = url.URI.prePath + url.pathname;
|
||||
if (nonQuery in gPageIcons) {
|
||||
gBrowser.setIcon(gBrowser.selectedTab, gPageIcons[nonQuery]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user