Skip to content

Instantly share code, notes, and snippets.

@fgnass
Created May 4, 2018 08:58
Show Gist options
  • Save fgnass/6e0bf145864fc42453dc0dfc4233e737 to your computer and use it in GitHub Desktop.
Save fgnass/6e0bf145864fc42453dc0dfc4233e737 to your computer and use it in GitHub Desktop.
Re-submit Alexa requests by clicking on previous inputs
// 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 })
);
}
});
@fgnass
Copy link
Author

fgnass commented May 7, 2018

Or use the arrow keys to scroll through the history: https://gist.github.com/fgnass/3f1a8845163aacba5f9a851a1d5d190d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment