Bug 597019 - Don't open javascript: links in new tabs [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 16 Sep 2010 09:42:05 -0700
changeset 66658 d9f10f50819a15b62e8401d73c464ec80bbfd6aa
parent 66657 84612b0bd7e398248c89a290270abe4ae1c5f0d5
child 66659 feb9a75245377141705f7845c4650f9f53f6f9e6
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmfinkle
bugs597019
Bug 597019 - Don't open javascript: links in new tabs [r=mfinkle]
mobile/chrome/content/content.js
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -323,17 +323,17 @@ function Content() {
 }
 
 Content.prototype = {
   handleEvent: function handleEvent(aEvent) {
     switch (aEvent.type) {
       case "DOMActivate": {
         // In a local tab, open remote links in new tabs.
         let href = Util.getHrefForElement(aEvent.originalTarget);
-        if (!Util.isLocalScheme(href)) {
+        if (/^http(s?):/.test(href)) {
           aEvent.preventDefault();
           sendAsyncMessage("Browser:OpenURI", { uri: href, bringFront: true });
         }
         break;
       }
 
       case "MozApplicationManifest": {
         let doc = aEvent.originalTarget;