diff --git a/src/config/app.ts b/src/config/app.ts index 71ac411..0e34c6c 100644 --- a/src/config/app.ts +++ b/src/config/app.ts @@ -32,6 +32,7 @@ export const gotoMainPage = async (url: string) => { const browser = await getBrowser(); const page = await browser.newPage(); + await page.setViewport({ width: 1400, height: 800 }); const ctx = { getState, @@ -86,6 +87,7 @@ export const gotoAppPage = async (job: AppJob) => { const resume = await getResume(); const browser = await getBrowser(); const page = await browser.newPage(); + await page.setViewport({ width: 1400, height: 800 }); const close = () => { appEvents.emit(APPEVENTS.APP_STOP, job.id); diff --git a/src/config/browser.ts b/src/config/browser.ts index 14eec7e..68140d3 100644 --- a/src/config/browser.ts +++ b/src/config/browser.ts @@ -43,6 +43,7 @@ export const getBrowser = async () => { browser = await puppeteer.launch({ headless: false, args: [ + // `--window-size=1920,1080`, '--disable-extensions', '--disable-gpu', '--disable-dev-shm-usage', diff --git a/src/index.ts b/src/index.ts index 7a8546a..74ab088 100644 --- a/src/index.ts +++ b/src/index.ts @@ -298,6 +298,11 @@ ipcMain.handle('state', async (event) => { return state; }); +ipcMain.handle('state:set', async (event, newState: BEState) => { + const state = await setState(newState); + return state; +}); + ipcMain.handle('questions:read', async (event, question) => { // console.log("questions:read", question); const savedQuestion = await readQuestion(question as any);