Bug 169826: minor tweaks to tabbrowser code (port fixes from bug 164006 to Firefox), r=mconnor

This commit is contained in:
gavin%gavinsharp.com 2006-10-16 16:42:31 +00:00
Родитель f847f8f88a
Коммит d6ee5ffdc3
2 изменённых файлов: 7 добавлений и 10 удалений

Просмотреть файл

@ -3737,6 +3737,7 @@ nsBrowserStatusHandler.prototype =
onLocationChange : function(aWebProgress, aRequest, aLocation)
{
var location = aLocation ? aLocation.spec : "";
if (document.tooltipNode) {
// Optimise for the common case
@ -3772,7 +3773,7 @@ nsBrowserStatusHandler.prototype =
var oldIndexOfHash = oldSpec.indexOf("#");
if (oldIndexOfHash != -1)
oldSpec = oldSpec.substr(0, oldIndexOfHash);
var newSpec = aLocation.spec;
var newSpec = location;
var newIndexOfHash = newSpec.indexOf("#");
if (newIndexOfHash != -1)
newSpec = newSpec.substr(0, newSpec.indexOf("#"));
@ -3799,8 +3800,6 @@ nsBrowserStatusHandler.prototype =
var findField = document.getElementById("find-field");
if (aWebProgress.DOMWindow == content) {
var location = aLocation.spec;
if (location == "about:blank" || location == "") { //second condition is for new tabs, otherwise
location = ""; //reload function is enabled until tab is refreshed
this.reloadCommand.setAttribute("disabled", "true");
@ -3831,11 +3830,11 @@ nsBrowserStatusHandler.prototype =
if (!gURIFixup)
gURIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
.getService(Components.interfaces.nsIURIFixup);
if (location && gURIFixup)
if (location && gURIFixup) {
try {
var locationURI = gURIFixup.createExposableURI(aLocation);
location = locationURI.spec;
} catch (exception) {}
location = gURIFixup.createExposableURI(location).spec;
} catch (ex) {}
}
if (getBrowser().forceSyncURLBarUpdate) {
gURLBar.value = ""; // hack for bug 249322

Просмотреть файл

@ -688,8 +688,6 @@
// Update the URL bar.
var loc = this.mCurrentBrowser.currentURI;
if (!loc)
loc = ({ spec: "" });
var webProgress = this.mCurrentBrowser.webProgress;
var securityUI = this.mCurrentBrowser.securityUI;
@ -912,7 +910,7 @@
<![CDATA[
var browser = this.getBrowserForTab(aTab);
var crop = "end";
var title = browser.contentDocument.title;
var title = browser.contentTitle;
if (!title) {
if (browser.currentURI.spec) {