Created
January 7, 2021 16:56
-
-
Save cahva/e44800dd2334063f3b758881b675057e to your computer and use it in GitHub Desktop.
Redirects to the event page after agreeing to disclaimer
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
<script src="https://getvideosync.com/js/vs-helpers.js"></script> | |
<script> | |
var isRegister = window.location.href.indexOf('register') > -1; | |
if (isRegister) { | |
waitForElement('.modal', handleModalClose); | |
} | |
function handleModalClose(modalNode) { | |
var config = { | |
childList: true | |
}; | |
var callback = function callback(mutationsList, observer) { | |
for (var i = 0; i < mutationsList.length; i++) { | |
var mutation = mutationsList[i]; | |
if (mutation.type === 'childList') { | |
if (mutation.removedNodes.length > 0) { | |
// Click the priv policy if its there (setting it to checked won't work) | |
var checkbox = document.querySelector('input[type=checkbox]'); | |
if (checkbox) { | |
checkbox.click(); | |
} | |
document.getElementById('submit-button').click(); | |
observer.disconnect(); | |
} | |
} | |
} | |
}; | |
var observer = new MutationObserver(callback); | |
observer.observe(modalNode, config); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment