Skip to content

Commit

Permalink
fix: 解决jquery的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lumozx committed Jan 26, 2024
1 parent 4ff1fe1 commit e997049
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions resources/common/preload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const { ipcRenderer } = require('electron')
const package_json = require('../../package.json')
window.nodeRequire = require;
delete window.require;
delete window.exports;
delete window.module;

const { ipcRenderer } = nodeRequire('electron')
const package_json = nodeRequire('../../package.json')

const EVENTS = {
Preload_Can_Auto_Login: 'can_auto_login',
Expand Down
8 changes: 5 additions & 3 deletions src/main/mainEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ const viewInit = () => {

// 打开开发者工具
eventEmitter.on(ViewEvent.openDevTools, () => {
mainWindow.webContents.openDevTools()
mainWindow.webContents.openDevTools({
mode: 'undocked',
})
})

// 回到首页
Expand Down Expand Up @@ -172,10 +174,10 @@ const viewInit = () => {

app.on('before-quit', () => app.exit(0))

app.on('browser-window-focus',() => {
app.on('browser-window-focus', () => {
eventEmitter.emit(ViewEvent.clientFocus, true)
})
app.on('browser-window-blur',() => {
app.on('browser-window-blur', () => {
eventEmitter.emit(ViewEvent.clientFocus, false)
})
}
Expand Down

0 comments on commit e997049

Please sign in to comment.