<commit_before><!doctype html>
<style>
  body {
    margin: 0;
    overflow: hidden;
  }

  body:before {
    border: 2px solid #ededed;
    border-left: none;
    border-bottom: none;
    position: absolute;
    content: '';
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
  }

  iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    opacity: 1;
    transition: -webkit-filter 500ms, opacity 300ms;
  }

  iframe.grey {
    -webkit-filter: grayscale(100%);
    z-index: 1;
  }

  iframe.fade {
    opacity: 0;
  }
</style>
<div id="container"></div>
<script>
  window.addEventListener('message', receiveMessage, false);
  var currentFrame;
  var loadingFrame;
  var sourceWindow;
  var timeoutId;
  var numberOfMeasures = 0;
  var demoId;

  function receiveMessage(event) {
    // Allow messaging back to original window.
    sourceWindow = event.source;
    demoId = event.data.id;

    var container = document.getElementById('container');
    if (currentFrame)
      currentFrame.classList.add('grey');

    if (loadingFrame) {
      loadingFrame.onload = null;
      container.removeChild(loadingFrame);
    }

    if (timeoutId)<commit_msg>Restrict inline demo post messages to trusted domains (#736)<commit_after><!doctype html>
<style>
  body {
    margin: 0;
    overflow: hidden;
  }

  body:before {
    border: 2px solid #ededed;
    border-left: none;
    border-bottom: none;
    position: absolute;
    content: '';
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
  }

  iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    opacity: 1;
    transition: -webkit-filter 500ms, opacity 300ms;
  }

  iframe.grey {
    -webkit-filter: grayscale(100%);
    z-index: 1;
  }

  iframe.fade {
    opacity: 0;
  }
</style>
<div id="container"></div>
<script>
  window.addEventListener('message', receiveMessage, false);
  var currentFrame;
  var loadingFrame;
  var sourceWindow;
  var timeoutId;
  var numberOfMeasures = 0;
  var demoId;

  function receiveMessage(event) {
    if (!event || !event.data || !event.data.id || !event.data.source)
      return;

    // Allow messaging back to original window.
    sourceWindow = event.source;
    demoId = event.data.id;

    var container = document.getElementById('container');
    if (currentFrame)
      currentFrame.classList.add('grey');

    if (loadingFrame) {
      loadingFrame.onload = null;
      container.removeChild(loadingFrame);
    }

    if (timeoutId)
{'fraction_non_alphanumeric': 0.12583826429980277, 'fraction_numerical': 0.021696252465483234, 'mean_word_length': 2.7738095238095237, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2046743', 'n_tokens_mistral': 915, 'n_tokens_neox': 813, 'n_words': 211}