<commit_before>$('form').submit(function () {

  var origin = decodeURIComponent(location.search.slice(1)),
      $submitIcon = $('.canvas-submit-icon'), // submit button in Promotions form
      checkSubmitIcon = function () {
        console.log(2);
        console.log($submitIcon.css('display'));
        if ($submitIcon.css('display') === 'block') { // if submit loader is showing
          clearInterval(interval); // stop checking
          window.parent.postMessage('submitted', origin); // send success message to parent page
          console.log('message sent');
          console.log(origin);
        }
      },
      interval = setInterval(checkSubmitIcon, 100); // check every 1/10th second

  console.log(1);
  console.log(location);

  checkSubmitIcon(); // check initially
  setTimeout(function () { // check for up to 2 seconds
    clearInterval(interval);
  }, 2000);

});
<commit_msg>add debugging<commit_after>$('form').submit(function () {

  var origin = decodeURIComponent(location.search.slice(1)),
      $submitIcon = $('.canvas-submit-icon'), // submit button in Promotions form
      checkSubmitIcon = function () {
        console.log(2);
        console.log($submitIcon.css('display'));
        if ($submitIcon.css('display') === 'block') { // if submit loader is showing
          clearInterval(interval); // stop checking
          top.postMessage('submitted', origin); // send success message to parent page
          console.log('message sent');
          console.log(origin);
        }
      },
      interval = setInterval(checkSubmitIcon, 100); // check every 1/10th second

  console.log(1);
  console.log(location);
  console.log(origin);

  checkSubmitIcon(); // check initially
  setTimeout(function () { // check for up to 2 seconds
    clearInterval(interval);
  }, 2000);

});

{'fraction_non_alphanumeric': 0.14772103239978035, 'fraction_numerical': 0.015376166941241077, 'mean_word_length': 2.9522776572668112, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1165702', 'n_tokens_mistral': 511, 'n_tokens_neox': 483, 'n_words': 118}