Bug 219378

Make middle mouse button pasting fix up the pasted URIs before trying to load them so that pasting a domain name by itself will work.
r=bryner sr=jst a=chofmann
This commit is contained in:
caillon%redhat.com 2004-03-19 01:34:40 +00:00
parent 6fd24e3f8a
commit 9cfbf0705d

View File

@ -258,12 +258,19 @@
if (!url)
return false;
url = getShortcutOrURI(url);
if (!url)
return false;
// On ctrl-middleclick, open in new window or tab. Do not send referrer.
if (event.ctrlKey)
if (event.ctrlKey) {
// fix up our pasted URI in case it is malformed.
const nsIURIFixup = Components.interfaces.nsIURIFixup;
if (!gURIFixup)
gURIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
.getService(nsIURIFixup);
url = gURIFixup.createFixupURI(url, nsIURIFixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI).spec;
return openNewTabOrWindow(event, url, false);
}
// If ctrl wasn't down, then just load the url in the current win/tab.
if (url != "about:blank") {