mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
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:
parent
6fd24e3f8a
commit
9cfbf0705d
@ -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") {
|
||||
|
Loading…
Reference in New Issue
Block a user