0

I am trying to click a button on a website in tampermonkey and for some reason i cannot get it to work. The weird thing is that if I type the code in on the console of google chrome it works perfectly but when I use tampermonkey it does nothing. No errors are listed. code:

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://shop.palaceskateboards.com/cart
// @grant        none
// ==/UserScript==
document.getElementById("checkout").click();

Just for reference this code is for "https://shop.palaceskateboards.com/cart" and it is clicking the checkout button at the bottom of the page (only shows up if you have something in your cart)

Alfie F
  • 1
  • 1
  • 6
  • Have you made sure it matches the site? Did you check the console for UserScript errors? – Andrew Li May 12 '17 at 16:23
  • No, in the console there are no errors listed and the code runs flawlessly, but just doesn't do anything. And yes, the code definitely matches the site and runs. – Alfie F May 12 '17 at 16:44
  • Make sure the page has loaded before executing the script: https://stackoverflow.com/questions/12897446/greasemonkey-wait-for-page-to-load-before-executing-code-techniques – Originato May 12 '17 at 16:58

0 Answers0