From 92e60e0541b61070690c233548ab4d6e278cac61 Mon Sep 17 00:00:00 2001 From: Andrew Benner Date: Tue, 24 Mar 2015 13:07:26 -0400 Subject: [PATCH] fix #128 - Cannot open helpful links within the HTMLHinter --- src/brackets.js | 10 ---------- src/thirdparty/browser-appshell.js | 3 ++- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/brackets.js b/src/brackets.js index e6e853134..4bf08b723 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -431,16 +431,6 @@ define(function (require, exports, module) { PreferencesManager.definePreference("_windowsScrollFix", "boolean", true).on("change", enableOrDisableWinScrollFix); enableOrDisableWinScrollFix(); } - - // Prevent extensions from using window.open() to insecurely load untrusted web content - var real_windowOpen = window.open; - window.open = function (url) { - // Allow file:// URLs, relative URLs (implicitly file: also), and about:blank - if (!url.match(/^file:\/\//) && !url.match(/^about:blank/) && url.indexOf(":") !== -1) { - throw new Error("Brackets-shell is not a secure general purpose web browser. Use NativeApp.openURLInDefaultBrowser() to open URLs in the user's main browser"); - } - return real_windowOpen.apply(window, arguments); - }; // jQuery patch to shim deprecated usage of $() on EventDispatchers var DefaultCtor = jQuery.fn.init; diff --git a/src/thirdparty/browser-appshell.js b/src/thirdparty/browser-appshell.js index 5ce95f09b..b6ac406d1 100644 --- a/src/thirdparty/browser-appshell.js +++ b/src/thirdparty/browser-appshell.js @@ -75,7 +75,8 @@ functionNotImplemented(); }, openURLInDefaultBrowser: function(url, callback) { - functionNotImplemented(); + global.open(url); + callback(); }, quit: function() { functionNotImplemented();