os->NotifyObservers(globalObject->GetDocShell(), "xpinstall-install-blocked",
os->NotifyObservers(win->GetDocShell(), "xpinstall-install-blocked",
InstallTriggerGlobalStartSoftwareUpdate(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsIDOMInstallTriggerGlobal *nativeThis = getTriggerNative(cx, obj);  if (!nativeThis)    return JS_FALSE;  PRBool       nativeRet;  PRInt32      flags = 0;  *rval = JSVAL_FALSE;  // make sure XPInstall is enabled, return if not  nsIScriptGlobalObject *globalObject = nsnull;  nsIScriptContext *scriptContext = GetScriptContextFromJSContext(cx);  if (scriptContext)      globalObject = scriptContext->GetGlobalObject();  PRBool enabled = PR_FALSE;  nativeThis->UpdateEnabled(globalObject, XPI_WHITELIST, &enabled);  if (!enabled || !globalObject)  {    nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));    if (os)    {      os->NotifyObservers(globalObject->GetDocShell(),                          "xpinstall-install-blocked",                           NS_LITERAL_STRING("install").get());    }    return JS_TRUE;  }  // get window.location to construct relative URLs  nsCOMPtr<nsIURI> baseURL;  JSObject* global = JS_GetGlobalObject(cx);  if (global)  {    jsval v;    if (JS_GetProperty(cx,global,"location",&v))    {      nsAutoString location;      ConvertJSValToStr( location, cx, v );      NS_NewURI(getter_AddRefs(baseURL), location);    }  }    if ( argc >= 1 )  {    nsAutoString xpiURL;    ConvertJSValToStr(xpiURL, cx, argv[0]);    if (baseURL)    {        nsCAutoString resolvedURL;        baseURL->Resolve(NS_ConvertUTF16toUTF8(xpiURL), resolvedURL);        xpiURL = NS_ConvertUTF8toUTF16(resolvedURL);    }    // Make sure caller is allowed to load this url.    nsresult rv = InstallTriggerCheckLoadURIFromScript(cx, xpiURL);    if (NS_FAILED(rv))        return JS_FALSE;    if (argc >= 2 && !JS_ValueToInt32(cx, argv[1], (int32 *)&flags))    {        JS_ReportError(cx, "StartSoftwareUpdate() 2nd parameter must be a number");        return JS_FALSE;    }    if(NS_OK == nativeThis->StartSoftwareUpdate(globalObject, xpiURL, flags, &nativeRet))    {        *rval = BOOLEAN_TO_JSVAL(nativeRet);    }  }  else  {    JS_ReportError(cx, "Function StartSoftwareUpdate requires 2 parameters");    return JS_FALSE;  }  return JS_TRUE;}