修复MAC下xm音乐滑块验证问题
parent
9e37800426
commit
316f62c3c8
|
@ -1,3 +1,4 @@
|
||||||
### 修复
|
### 修复
|
||||||
|
|
||||||
- 修复非透明模式下右侧滚动条无法拖动的问题
|
- 修复非透明模式下右侧滚动条无法拖动的问题
|
||||||
|
- 修复MAC下xm音乐滑块验证问题
|
||||||
|
|
|
@ -27,12 +27,12 @@ mainHandle(ipcMainWindowNames.handle_xm_verify_open, (event, url) => new Promise
|
||||||
const windowSizeInfo = getWindowSizeInfo(global.appSetting)
|
const windowSizeInfo = getWindowSizeInfo(global.appSetting)
|
||||||
win = new BrowserWindow({
|
win = new BrowserWindow({
|
||||||
parent: global.modules.mainWindow,
|
parent: global.modules.mainWindow,
|
||||||
width: 460,
|
width: 1000,
|
||||||
height: 370,
|
height: 800,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
// transparent: true,
|
// transparent: true,
|
||||||
x: mainWindowSizeInfo.x + (windowSizeInfo.width - 460) / 2,
|
x: mainWindowSizeInfo.x + (windowSizeInfo.width - 1000) / 2,
|
||||||
y: mainWindowSizeInfo.y + (windowSizeInfo.height - 320 + 52) / 2,
|
y: mainWindowSizeInfo.y + (windowSizeInfo.height - 800 + 52) / 2,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
// movable: false,
|
// movable: false,
|
||||||
|
@ -43,20 +43,34 @@ mainHandle(ipcMainWindowNames.handle_xm_verify_open, (event, url) => new Promise
|
||||||
disableHtmlFullscreenWindowResize: true,
|
disableHtmlFullscreenWindowResize: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
win.webContents.on('did-finish-load', () => {
|
// win.webContents.on('did-finish-load', () => {
|
||||||
if (/punish\?/.test(win.webContents.getURL())) return
|
// if (/punish\?/.test(win.webContents.getURL())) return
|
||||||
let ses = win.webContents.session
|
// let ses = win.webContents.session
|
||||||
ses.cookies.get({ name: 'x5sec' })
|
// ses.cookies.get({ name: 'x5sec' })
|
||||||
.then(async([x5sec]) => {
|
// .then(async([x5sec]) => {
|
||||||
|
// isActioned = true
|
||||||
|
// await closeWin()
|
||||||
|
// if (!x5sec) return reject(new Error('get x5sec failed'))
|
||||||
|
// resolve(x5sec.value)
|
||||||
|
// }).catch(async err => {
|
||||||
|
// isActioned = true
|
||||||
|
// await closeWin()
|
||||||
|
// reject(err)
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
win.webContents.session.webRequest.onCompleted({ urls: ['*://www.xiami.com/*'] }, details => {
|
||||||
|
if (/\/_____tmd_____\/slide\?/.test(details.url)) {
|
||||||
|
for (const item of details.responseHeaders['set-cookie']) {
|
||||||
|
if (!/^x5sec=/.test(item)) continue
|
||||||
|
const x5sec = /x5sec=(\w+);.+$/.exec(item)
|
||||||
isActioned = true
|
isActioned = true
|
||||||
await closeWin()
|
closeWin().finally(() => {
|
||||||
if (!x5sec) return reject(new Error('get x5sec failed'))
|
if (!x5sec) return reject(new Error('get x5sec failed'))
|
||||||
resolve(x5sec.value)
|
resolve(x5sec[1])
|
||||||
}).catch(async err => {
|
|
||||||
isActioned = true
|
|
||||||
await closeWin()
|
|
||||||
reject(err)
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
win.webContents.loadURL(url, {
|
win.webContents.loadURL(url, {
|
||||||
|
|
Loading…
Reference in New Issue