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
This commit is contained in:
caillon%redhat.com 2004-03-17 01:51:49 +00:00
Родитель 3285bc0c0f
Коммит 12ede3d032
1 изменённых файлов: 17 добавлений и 5 удалений

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

@ -3699,15 +3699,27 @@ function middleMousePaste(event)
return false;
// On ctrl-middleclick, open in new tab.
var openNewTab;
#ifdef XP_MACOSX
if (event.metaKey)
openNewTab = event.metaKey;
#else
if (event.ctrlKey)
openNewTab = event.ctrlKey;
#endif
openNewTabWith(url, null, event, true);
// If ctrl wasn't down, then just load the url in the current win/tab.
loadURI(url);
if (!openNewTab) {
// If ctrl wasn't down, then just load the url in the current win/tab.
loadURI(url);
} else {
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;
openNewTabWith(url, null, event, true);
}
event.preventBubble();
return true;
}