nsCOMPtr<nsIPrincipal> principal; scriptObjectPrincipal->GetPrincipal(getter_AddRefs(principal));
nsIPrincipal *principal = scriptObjectPrincipal->GetPrincipal();
static nsresult getScriptCodebase(JSContext* cx, nsIURI* *result){    nsIScriptContext *scriptContext = GetScriptContextFromJSContext(cx);    if (scriptContext) {        nsCOMPtr<nsIScriptObjectPrincipal> scriptObjectPrincipal =            do_QueryInterface(scriptContext->GetGlobalObject());        if (scriptObjectPrincipal) {            nsCOMPtr<nsIPrincipal> principal;            scriptObjectPrincipal->GetPrincipal(getter_AddRefs(principal));            if (principal) {                return principal->GetURI(result);            }        }    }    return NS_ERROR_FAILURE;}