<commit_before>jsio('import std.uri as uri'); 
jsio('import std.base64 as base64');
jsio('from util.browserdetect import BrowserDetect');

;(function() {
	var doc;
	exports.getDoc = function() {
		if (doc) { return doc; }
		try {
			doc = window.ActiveXObject && new ActiveXObject('htmlfile');
			if (doc) {
				doc.open().write('<html></html>');
				doc.close();
				window.attachEvent('onunload', function() {
					try { doc.body.innerHTML = ''; } catch(e) {}
					doc = null;
				});
			}
		} catch(e) {}
		
		if (!doc) { doc = document; }
		return doc;
	};

	exports.XHR = function() {
		var win = window,
			doc = exports.getDoc();
		//if (doc.parentWindow) { win = doc.parentWindow; }
		
		return new (exports.XHR = win.XDomainRequest ? win.XDomainRequest
			: win.XMLHttpRequest ? win.XMLHttpRequest
			: function() { return win.ActiveXObject && new win.ActiveXObject('Msxml2.XMLHTTP') || null; });
	}
	
	exports.createXHR = function() { return new exports.XHR(); }

})();
<commit_msg>remove XDomainRequest - it doesn't really work properly and XMLHttpRequest works fine for xd in IE8 anyway<commit_after>jsio('import std.uri as uri'); 
jsio('import std.base64 as base64');
jsio('from util.browserdetect import BrowserDetect');

;(function() {
	var doc;
	exports.getDoc = function() {
		if (doc) { return doc; }
		try {
			doc = window.ActiveXObject && new ActiveXObject('htmlfile');
			if (doc) {
				doc.open().write('<html></html>');
				doc.close();
				window.attachEvent('onunload', function() {
					try { doc.body.innerHTML = ''; } catch(e) {}
					doc = null;
				});
			}
		} catch(e) {}
		
		if (!doc) { doc = document; }
		return doc;
	};

	exports.XHR = function() {
		var win = window,
			doc = exports.getDoc();
		//if (doc.parentWindow) { win = doc.parentWindow; }
		
		return new (exports.XHR = win.XMLHttpRequest ? win.XMLHttpRequest
			: function() { return win.ActiveXObject && new win.ActiveXObject('Msxml2.XMLHTTP') || null; });
	}
	
	exports.createXHR = function() { return new exports.XHR(); }

})();

{'fraction_non_alphanumeric': 0.17224409448818898, 'fraction_numerical': 0.0054133858267716535, 'mean_word_length': 3.448577680525164, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2337987', 'n_tokens_mistral': 785, 'n_tokens_neox': 679, 'n_words': 159}