From 805489ea7291ff950ede77ed2f3d66c79070c309 Mon Sep 17 00:00:00 2001 From: "David Humphrey (:humph) david.humphrey@senecacollege.ca" Date: Fri, 16 Oct 2015 19:08:28 -0400 Subject: [PATCH] Fix https://github.com/mozilla/thimble.webmaker.org/issues/1182 - allow javascript: and other common non-http schemes --- src/extensions/default/bramble/lib/LinkManagerRemote.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/extensions/default/bramble/lib/LinkManagerRemote.js b/src/extensions/default/bramble/lib/LinkManagerRemote.js index 668740d4f..fb9e5bfcd 100644 --- a/src/extensions/default/bramble/lib/LinkManagerRemote.js +++ b/src/extensions/default/bramble/lib/LinkManagerRemote.js @@ -6,7 +6,13 @@ function handleClick(e) { var url = e.target.getAttribute("href"); - // For local paths vs. absolute URLs, try to open the right file + // For local paths vs. absolute URLs, try to open the right file. + // Special case (i.e., pass through) some common, non-http(s) protocol + // schemes so they work as expected. + if(/^(javascript|mailto|data|blob):/.test(url)) { + return true; + } + if(!(/\:?\/\//.test(url)) && window._Brackets_LiveDev_Transport) { window._Brackets_LiveDev_Transport.send("bramble-navigate:" + url); } else {