mirror of
https://github.com/NoCrypt/migu.git
synced 2026-01-11 20:10:22 +00:00
fix: #583
This commit is contained in:
parent
9be05949fc
commit
7039262404
3 changed files with 16 additions and 6 deletions
|
|
@ -259,8 +259,7 @@ class AnilistClient {
|
|||
credentials: 'omit',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
Referer: 'https://anilist.co'
|
||||
Accept: 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: query.replace(/\s/g, '').replaceAll(' ', ' '),
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@
|
|||
"directories": {
|
||||
"buildResources": "buildResources"
|
||||
},
|
||||
"electronDist": "electron-dist",
|
||||
"asarUnpack": "**/*.node",
|
||||
"electronDist": "./electron-dist",
|
||||
"protocols": {
|
||||
"name": "miru",
|
||||
"schemes": [
|
||||
|
|
@ -58,6 +58,9 @@
|
|||
}
|
||||
],
|
||||
"appId": "com.github.thaunknown.miru",
|
||||
"electronLanguages": [
|
||||
"en-US"
|
||||
],
|
||||
"productName": "Miru",
|
||||
"files": [
|
||||
"build/**/*",
|
||||
|
|
@ -115,6 +118,7 @@
|
|||
"nsis": {
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"oneClick": false,
|
||||
"perMachine": true,
|
||||
"artifactName": "${os}-${name}-${version}-installer.${ext}"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { join } from 'node:path'
|
||||
import process from 'node:process'
|
||||
|
||||
import { BrowserWindow, MessageChannelMain, Notification, app, dialog, ipcMain, nativeImage, powerMonitor, shell } from 'electron'
|
||||
import { BrowserWindow, MessageChannelMain, Notification, app, dialog, ipcMain, nativeImage, powerMonitor, session, shell } from 'electron'
|
||||
import electronShutdownHandler from '@paymoapp/electron-shutdown-handler'
|
||||
|
||||
import { development } from './util.js'
|
||||
|
|
@ -64,7 +64,7 @@ export default class App {
|
|||
ipcMain.on('maximize', () => {
|
||||
const focusedWindow = this.mainWindow
|
||||
focusedWindow?.isMaximized() ? focusedWindow.unmaximize() : focusedWindow.maximize()
|
||||
});
|
||||
})
|
||||
app.on('before-quit', e => {
|
||||
if (this.destroyed) return
|
||||
e.preventDefault()
|
||||
|
|
@ -117,6 +117,13 @@ export default class App {
|
|||
this.mainWindow.webContents.openDevTools()
|
||||
}
|
||||
|
||||
session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
|
||||
if (details.url.startsWith('https://graphql.anilist.co')) {
|
||||
details.requestHeaders.Referer = 'https://anilist.co'
|
||||
}
|
||||
callback({ cancel: false, requestHeaders: details.requestHeaders })
|
||||
})
|
||||
|
||||
let crashcount = 0
|
||||
this.mainWindow.webContents.on('render-process-gone', async (e, { reason }) => {
|
||||
if (reason === 'crashed') {
|
||||
|
|
@ -158,4 +165,4 @@ export default class App {
|
|||
this.destroyed = true
|
||||
if (!this.updater.install(forceRunAfter)) app.quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue