Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- var TIME_GAP_TO_SHOW_CAMPAIGN = 4000;/* 1000 = 1 second */
- function checkThankYouElement() {
- var thankYouMessegeElement = document.querySelector('.main-thanks-container .main-title-container h1.custom-header-text');
- if (thankYouMessegeElement && thankYouMessegeElement.textContent.indexOf('תודה') != -1) {
- observer.disconnect();
- setTimeout(function() {
- adoric.trigger('showAdoricThankYouMessageCampaign');
- }, TIME_GAP_TO_SHOW_CAMPAIGN);
- }
- }
- if (adoric) {
- var targetNode = document.querySelector('body');
- var config = { attributes: true, childList: true, subtree: true };
- var callback = function(mutationsList, observer) {
- for(var i = 0; i < mutationsList.length; i++) {
- if (mutationsList[i].type === 'childList') {
- checkThankYouElement();
- }
- }
- };
- var observer = new MutationObserver(callback);
- observer.observe(targetNode, config);
- }
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment