Created
May 4, 2018 08:58
-
-
Save fgnass/6e0bf145864fc42453dc0dfc4233e737 to your computer and use it in GitHub Desktop.
Re-submit Alexa requests by clicking on previous inputs
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
// Paste this into your borwser's console on the Alexa Skill testing page: | |
document.addEventListener('click', ev => { | |
if (ev.target.matches('.askt-dialog__message--request')) { | |
const el = document.querySelector('.askt-utterance__input'); | |
el.focus(); | |
document.execCommand('insertText', false, ev.target.innerText); | |
el.dispatchEvent( | |
new KeyboardEvent('keypress', { bubbles: true, keyCode: 13 }) | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or use the arrow keys to scroll through the history: https://gist.github.com/fgnass/3f1a8845163aacba5f9a851a1d5d190d