Created
August 3, 2018 07:24
-
-
Save aereal/905ace0dfaf67314fb5b007309c0aa08 to your computer and use it in GitHub Desktop.
This file contains 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
(() => { | |
const submitBtn = document.querySelector('input[type=submit]'); | |
let startedAt; | |
const flash = (ts) => { | |
if (!startedAt) startedAt = ts; | |
const elapsed = ts - startedAt; | |
if (elapsed > 100) { | |
const e = new MouseEvent('click', { | |
view: window, | |
bubbles: true, | |
cancelable: true, | |
}) | |
submitBtn.dispatchEvent(e); | |
startedAt = undefined; | |
} | |
window.requestAnimationFrame(flash); | |
}; | |
window.requestAnimationFrame(flash); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://cho45.stfuawsc.com/String_random.js/demo.html?regexp=%E5%BF%83%E9%85%8D%E3%82%B4%E3%83%A0%E7%94%A8+%5C%28%EF%BC%BE%CF%89%EF%BC%BE%5C%29%E3%83%8B%2B%E3%81%A4+%EF%BE%8B%EF%BE%9E%EF%BE%96%EF%BD%B0%EF%BE%9D#%E5%BF%83%E9%85%8D%E3%82%B4%E3%83%A0%E7%94%A8%20%5C(%EF%BC%BE%CF%89%EF%BC%BE%5C)%E3%83%8B%2B%E3%81%A4%20%EF%BE%8B%EF%BE%9E%EF%BE%96%EF%BD%B0%EF%BE%9D