Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to a given item to Google Shopping List. Paste the code in the DevTools' console!
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