Javascript Chrome标识未处理拒绝(TypeError):无法读取属性';启动WebAuthFlow';未定义的

Javascript Chrome标识未处理拒绝(TypeError):无法读取属性';启动WebAuthFlow';未定义的,javascript,reactjs,google-chrome-extension,oauth,msal,Javascript,Reactjs,Google Chrome Extension,Oauth,Msal,我正在使用ReatJS开发一个Chrome扩展。我不能用这个电话。我相信在chrome扩展中使用全局chrome API的唯一要求是使用API在我的文件顶部声明这个/*全局chrome*/ 我确保在我的清单中包含身份许可。 { “名称”:“公共数据服务”, “版本”:“1.0.0”, “清单版本”:2, “说明”:“公共数据服务”, “图标”:{ “512”:“images/database.png” }, “浏览器操作”:{ “默认图标”:“images/database.png”, “默认

我正在使用ReatJS开发一个Chrome扩展。我不能用这个电话。我相信在chrome扩展中使用全局chrome API的唯一要求是使用API在我的文件顶部声明这个
/*全局chrome*/

我确保在我的清单中包含身份许可。

{
“名称”:“公共数据服务”,
“版本”:“1.0.0”,
“清单版本”:2,
“说明”:“公共数据服务”,
“图标”:{
“512”:“images/database.png”
},
“浏览器操作”:{
“默认图标”:“images/database.png”,
“默认弹出窗口”:“popup.html”
},
“网络可访问资源”:[
“popup.html”
],
“权限”:[
“身份”
]
}
我的主要目标是使用以下方法调用
chrome.identity.launchWebAuthFlow
,为我在Azure Active Directory中注册的应用程序启动Microsoft OUATH登录流

const authUrl = "https://login.microsoftonline.com/common/oauth2/authorize?client_id=" + process.env.REACT_APP_MICROSOFT_COMMON_DATA_SERVICE_CLIENT_ID + "&response_type=code&redirect_uri=" + "https%3A%2F%2F172.17.207.107:3000" + "&response_mode=query&scope=https%3A%2F%2Fadmin.services.crm.dynamics.com/user_impersonation%20openid%20https%3A%2F%2Fgraph.microsoft.com%2Fuser.read&state=12345&&resource=https%3A%2F%2Fadmin.services.crm.dynamics.com/";
但是当我调用此方法时,我得到了以下错误:Chrome Identity Unhandled Rejection(TypeError):无法读取未定义的属性“launchWebAuthFlow”

chrome.identity.launchWebAuthFlow(
    {
        url: authUrl,
        interactive: true
    },
    function (responseWithToken) {
        alert(responseWithToken);
    }
); 

如果在编辑manifest.json后没有加载扩展,请尝试重新加载扩展。