B2G/gecko/browser/components/places/src/PlacesUIUtils.jsm
/**
   * Allows opening of javascript/data URI only if the given node is
   * bookmarked (see bug 224521).
   * @param aURINode
   *        a URI node
   * @param aWindow
   *        a window on which a potential error alert is shown on.
   * @return true if it's safe to open the node in the browser, false otherwise.
   *
   */
Allows opening of javascript/data URI only if the given node is
bookmarked .
@param aURINode
a URI node
@param aWindow
a window on which a potential error alert is shown on.
@return true if it's safe to open the node in the browser, false otherwise.
Allows opening of javascript / data URI only if the given node is bookmarked . @param aURINode a URI node @param aWindow a window on which a potential error alert is shown on . @return true if it ' s safe to open the node in the browser false otherwise .
function PUIU_checkURLSecurity(aURINode, aWindow) {
    if (PlacesUtils.nodeIsBookmark(aURINode))
      return true;
    var uri = PlacesUtils._uri(aURINode.uri);
    if (uri.schemeIs("javascript") || uri.schemeIs("data")) {
      const BRANDING_BUNDLE_URI = "chrome://branding/locale/brand.properties";
      var brandShortName = Cc["@mozilla.org/intl/stringbundle;1"].
                           getService(Ci.nsIStringBundleService).
                           createBundle(BRANDING_BUNDLE_URI).
                           GetStringFromName("brandShortName");
      var errorStr = this.getString("load-js-data-url-error");
      Services.prompt.alert(aWindow, brandShortName, errorStr);
      return false;
    }
    return true;
  }
function PUIU_checkURLSecurity ( aURINode , aWindow ) { if ( PlacesUtils . nodeIsBookmark ( aURINode ) ) return true ; var uri = PlacesUtils . _uri ( aURINode . uri ) ; if ( uri . schemeIs ( "javascript" ) || uri . schemeIs ( "data" ) ) { const BRANDING_BUNDLE_URI = "chrome://branding/locale/brand.properties" ; var brandShortName = Cc [ "@mozilla.org/intl/stringbundle;1" ] . getService ( Ci . nsIStringBundleService ) . createBundle ( BRANDING_BUNDLE_URI ) . GetStringFromName ( "brandShortName" ) ; var errorStr = this . getString ( "load-js-data-url-error" ) ; Services . prompt . alert ( aWindow , brandShortName , errorStr ) ; return false ; } return true ; }
Allows opening of javascript/data URI only if the given node is
 bookmarked (see bug 224521).
Allows opening of javascript / data URI only if the given node is bookmarked ( see bug 224521 ) .