<commit_before>// TODO: don't serve this script from codecombat.com; serve it from a harmless extra domain we don't have yet.

var lastSource = null;
var lastOrigin = null;
window.onerror = function(message, url, line, column, error){
  console.log("User script error on line " + line + ", column " + column + ": ", error);
  lastSource.postMessage({ type: 'error', message: message, url: url, line: line, column: column }, lastOrigin);
}
window.addEventListener('message', receiveMessage, false);

var concreteDom;
var concreteStyles;
var concreteScripts;
var virtualDom;
var virtualStyles;
var virtualScripts;
var goalStates;
var createFailed;

var allowedOrigins = [
    /^https?:\/\/(.*\.)?codecombat\.com$/,
    /^https?:\/\/localhost:3000$/,
    /^https?:\/\/.*codecombat-staging-codecombat\.runnableapp\.com$/,
];

function receiveMessage(event) {
    var origin = event.origin || event.originalEvent.origin; // For Chrome, the origin property is in the event.originalEvent object.<commit_msg>Add coco.code.ninja to web dev allowed origins<commit_after>// TODO: don't serve this script from codecombat.com; serve it from a harmless extra domain we don't have yet.

var lastSource = null;
var lastOrigin = null;
window.onerror = function(message, url, line, column, error){
  console.log("User script error on line " + line + ", column " + column + ": ", error);
  lastSource.postMessage({ type: 'error', message: message, url: url, line: line, column: column }, lastOrigin);
}
window.addEventListener('message', receiveMessage, false);

var concreteDom;
var concreteStyles;
var concreteScripts;
var virtualDom;
var virtualStyles;
var virtualScripts;
var goalStates;
var createFailed;

var allowedOrigins = [
    /^https?:\/\/(.*\.)?codecombat\.com$/,
    /^https?:\/\/localhost:3000$/,
    /^https?:\/\/coco\.code\.ninja$/,
    /^https?:\/\/.*codecombat-staging-codecombat\.runnableapp\.com$/,
];

function receiveMessage(event) {
    var origin = event.origin || event.originalEvent.origin; // For Chrome, the origin property is in the event.originalEvent object.
{'fraction_non_alphanumeric': 0.14920328343795267, 'fraction_numerical': 0.00386286817962337, 'mean_word_length': 4.367875647668394, 'pattern_counts': {'":': 2, '<': 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': '965158', 'n_tokens_mistral': 648, 'n_tokens_neox': 627, 'n_words': 190}