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