зеркало из https://github.com/mozilla/brackets.git
Fix https://github.com/mozilla/thimble.webmaker.org/issues/1182 - allow javascript: and other common non-http schemes
This commit is contained in:
Родитель
6c1f10d592
Коммит
805489ea72
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче