Created
August 27, 2020 12:29
-
-
Save igrep/a41d2f9678621b5bb5e5e0d7c79ae6e5 to your computer and use it in GitHub Desktop.
Function to a given item to Google Shopping List. Paste the code in the DevTools' console!
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 input = document.getElementsByClassName("listItemInput")[0]; | |
const form = document.getElementsByClassName("addForm")[0]; | |
function addItem(name){ | |
input.dispatchEvent(new Event("focus")); | |
input.value = name; | |
input.dispatchEvent(new Event("input")); | |
form.dispatchEvent(new Event("submit")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment