diff --git a/mozilla/suite/common/history/history.js b/mozilla/suite/common/history/history.js index b832a1da48b..49cfc58d38c 100644 --- a/mozilla/suite/common/history/history.js +++ b/mozilla/suite/common/history/history.js @@ -278,7 +278,22 @@ function OpenURL(aInNewWindow) var currentIndex = gHistoryTree.currentIndex; var builder = gHistoryTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder); var url = builder.getResourceAtIndex(currentIndex).Value; - + var uri = Components.classes["@mozilla.org/network/standard-url;1"]. + createInstance(Components.interfaces.nsIURI); + uri.spec = url; + if (uri.schemeIs("javascript") || uri.schemeIs("data")) { + var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"] + .getService(Components.interfaces.nsIStringBundleService); + var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + var historyBundle = strBundleService.createBundle("chrome://communicator/locale/history/history.properties"); + var brandBundle = strBundleService.createBundle("chrome://global/locale/brand.properties"); + var brandStr = brandBundle.GetStringFromName("brandShortName"); + var errorStr = historyBundle.GetStringFromName("load-js-data-url-error"); + promptService.alert(window, brandStr, errorStr); + return false; + } + if (aInNewWindow) { var count = gHistoryTree.treeBoxObject.view.selection.count; if (count == 1) { diff --git a/mozilla/suite/locales/en-US/chrome/common/history/history.properties b/mozilla/suite/locales/en-US/chrome/common/history/history.properties index 13c7104a1b7..94d90217af9 100644 --- a/mozilla/suite/locales/en-US/chrome/common/history/history.properties +++ b/mozilla/suite/locales/en-US/chrome/common/history/history.properties @@ -17,3 +17,5 @@ collapseLabel=Collapse expandLabel=Expand collapseAccesskey=C expandAccesskey=x + +load-js-data-url-error=For security reasons, javascript or data urls cannot be loaded from the history window or sidebar.