Skip to content

Instantly share code, notes, and snippets.

@mogsdad
Last active February 13, 2021 12:14
Show Gist options
  • Save mogsdad/0e7bb8e11b664be3cdbb5611499d8540 to your computer and use it in GitHub Desktop.
Save mogsdad/0e7bb8e11b664be3cdbb5611499d8540 to your computer and use it in GitHub Desktop.
Detect and fill checkboxes in checkout flow for Ontario Parks Reservations.
// ==UserScript==
// @name OntarioParksReservation-2-Checkboxes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Detect and fill checkboxes in checkout flow
// @author You
// @match https://reservations.ontarioparks.com/Messages.aspx
// @match https://reservations.ontarioparks.com/Account/Auth/Payment.aspx
// @require https://greasyfork.org/scripts/12228/code/setMutationHandler.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
// maybe the elements are already on the page
checkThem([].slice.call(document.querySelectorAll('input[type="checkbox"]')));
// but anyway set a MutationObserver handler for them
setMutationHandler(document, 'input[type="checkbox"]', checkThem);
function checkThem(nodes) {
nodes.forEach(function(n) { n.checked = true });
}
// click Continue
document.querySelector('#MainContentPlaceHolder_ContinueButton').click()
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment