MozillaZine

IE Ctrl+Enter Add-On for Mozilla 1.1

Thursday September 5th, 2002

Oliver Schulze has written an add-on for Mozilla 1.1 that emulates Internet Explorer's Ctrl+Enter behaviour (adds "www." to the beginning and ".com" to the end of what you have typed into the Location Bar). A fair bit of tweaking is required to set up this add-on but it's worth it if you're addicted to this particular aspect of Internet Explorer.


#12 Hmm

by locka <adamlock@eircom.net>

Friday September 6th, 2002 12:52 PM

You are replying to this message

Mozilla already has a fixup service. It would be better to invoke that from js when ctrl+enter is pressed. Just get the service ("@mozilla.org/docshell/urifixup;1") and call nsIURIFixup::createFixupURI() with FIXUP_FLAGS_MAKE_ALTERNATE_URI in the second argument.

e.g. (pseudo-js)

const nsIURIFixup = Components.interfaces.nsIURIFixup; var fixup = Components.classes["@mozilla.org/docshell/urifixup;1"].getService(nsIURIFixup) newURI = fixup.createFixupURI("foo", nsIURIFixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI);