This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trigger(el, eventType) { | |
if (typeof eventType === 'string' && typeof el[eventType] === 'function') { | |
el[eventType](); | |
} else { | |
const event = | |
eventType === 'string' | |
? new Event(eventType, {bubbles: true}) | |
: eventType; | |
el.dispatchEvent(event); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resource: http://ktkr3d.github.io/2020/01/27/Puppeteer-on-WSL/ | |
// install puppeteer | |
// > npm i -g puppeteer | |
// use chrome from windows: add this to ~/.profile | |
// PATH=/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application:$PATH | |
const puppeteer = require('puppeteer'); |