Skip to content

Instantly share code, notes, and snippets.

Created August 27, 2020 12:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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