let cookieInstance = win.webContents.session.cookies; cookieInstance.on('changed', (e, cookie, cause, removed) => { let obj = { e, cookie, cause, removed } console.log(obj); }); cookieInstance.get({ domain: 'dayu.com' }, (error, cookies) => { let tarCookie = cookies.find(v => v.name == "USER_TMP") });
代碼如上↑javascript