feat: 新增脚本录制功能
This commit is contained in:
18
electron/scripts/pause-resume.mjs
Normal file
18
electron/scripts/pause-resume.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
import { chromium } from 'playwright';
|
||||
import { preparePage, safeDisconnectBrowser } from './common/tabs.js';
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.connectOverCDP('http://127.0.0.1:9222');
|
||||
const { page } = await preparePage(browser, {
|
||||
targetUrl: 'about:blank',
|
||||
});
|
||||
|
||||
// Example: fill a form and submit
|
||||
// await page.fill('input[name="username"]', 'test');
|
||||
// await page.click('button[type="submit"]');
|
||||
|
||||
console.log('Pause resume script executed');
|
||||
|
||||
await safeDisconnectBrowser(browser);
|
||||
process.exit(0);
|
||||
})();
|
||||
Reference in New Issue
Block a user