Bug #213538 --> remove the MOZ_THUNDERBIRD ifdef in nsWebShell.cpp. Add moz thunderbird functionality to OnStartURI to kick

non mail urls out to the operating system.

Also, break out a method on nsIMessenger for thunderbird which can be used to launch urls externally instead of doubling up inside
of loadUrl.
This commit is contained in:
scott%scott-macgregor.org 2003-08-02 05:45:21 +00:00
Родитель 3e34664534
Коммит 4dc3a1f88f
5 изменённых файлов: 17 добавлений и 6 удалений

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

@ -63,6 +63,17 @@
versionField.value = hidversionField.value;
versionField.width = hidversionField.width;
}
function loadExternalLink() {
try {
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.launchExternalURL(document.getElementById('copyrightLink').getAttribute("href"));
} catch (ex) {}
// return false, so we don't load the href in the about dialog
return false;
}
]]>
</script>
@ -78,7 +89,7 @@
<separator class="thin"/>
<html:a href="&copyrightLink;" style="display: block; color: blue; text-decoration: underline;" tabindex="3">&copyright;</html:a>
<html:a id="copyrightLink" onclick="return loadExternalLink();" href="&copyrightLink;" style="display: block; color: blue; text-decoration: underline;" tabindex="3">&copyright;</html:a>
</vbox>
<separator class="groove"/>

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

@ -2238,6 +2238,6 @@ function loadThrobberUrl(urlPref)
var url;
try {
url = gPrefs.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data;
messenger.loadURL(window, url);
messenger.launchExternalURL(url);
} catch (ex) {}
}

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

@ -487,7 +487,7 @@ function MapIt(id)
try {
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.loadURL(window, button.getAttribute('url'));
messenger.launchExternalURL(button.getAttribute('url'));
} catch (ex) {}
}
@ -512,7 +512,7 @@ function openLink(id)
try {
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.loadURL(window, document.getElementById(id).getAttribute("href"));
messenger.launchExternalURL(document.getElementById(id).getAttribute("href"));
} catch (ex) {}
// return false, so we don't load the href in the addressbook window

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

@ -830,6 +830,6 @@ function loadThrobberUrl(urlPref)
url = gPrefs.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data;
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.loadURL(window, url);
messenger.launchExternalURL(url);
} catch (ex) {}
}

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

@ -2928,7 +2928,7 @@ function loadThrobberUrl(urlPref)
url = sPrefs.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data;
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
messenger.loadURL(window, url);
messenger.launchExternalURL(url);
} catch (ex) {}
}