gLoginBtn.onclick=(event)=>{
let gEmail=document.getElementById('gEmail').value;
let gPassword=document.getElementById('gPassword').value;
var provider = new firebase.auth.GoogleAuthProvider();
provider.addScope('https://www.googleapis.com/auth/contacts.readonly'); firebase.auth().signInWithPopup(provider).then(function(result) {
// The signed-in user info.
var user = result.user;
alert("Welcome "+user.displayName);
console.log(user);
}).catch(function(error) {
var errorMessage = error.message;
alert(errorMessage);
});
}

<h1>AUTHENTICATION USING GOOGLE</h1>
<div>
<form action="###">
<label for="googleEmail">Enter name</label> <input type="text" id="gEmail"/> <br> <br>
<label for="googlePassword">Enter Password</label> <input type="password" id="gPassword"/> <br> <br>
<input type="submit" id="gLoginBtn" value="Login With Google"/>
</form>
</div>
&#13;
这个代码在我的网络应用程序中工作正常,但是当我使用npm run electron运行电子时,它的给出错误。我需要做些什么更改,它也开始在桌面应用程序中工作。我尝试搜索找到一个链接enter link description here,但没有得到太多信息。