<commit_before>var performCommand = function(event) {
	if(event.command === 'hibernateTabs') {
		var c = 0;

		var xmlHttp = new XMLHttpRequest();
		xmlHttp.open('GET', safari.extension.baseURI + 'lib/hibernationPage/index.html', true);
		xmlHttp.onreadystatechange = function() {
			if(xmlHttp.readyState === 4) {
				var html = xmlHttp.responseText;

				_.each(safari.application.browserWindows, function(win) {
					_.each(win.tabs, function(tab) {
						if(tab === win.activeTab) return;
						if(!tab.url.match(/^https?:\/\//)) return;

						_.delay(function() {
							var pageInfo = {
								url: tab.url,
								title: tab.title
							};

							var pageHtml = html.replace(/\{\/\*pageInfoObject\*\/\}/, JSON.stringify(pageInfo));
							var dataURL = 'data:text/html;charset=utf-8,' + encodeURIComponent(pageHtml);
							tab.url = dataURL;
						}, c * 100);

						c++;
					});
				});
			}
		};
		xmlHttp.send(null);<commit_msg>Check if tab’s url is defined before hibernating<commit_after>var performCommand = function(event) {
	if(event.command === 'hibernateTabs') {
		var c = 0;

		var xmlHttp = new XMLHttpRequest();
		xmlHttp.open('GET', safari.extension.baseURI + 'lib/hibernationPage/index.html', true);
		xmlHttp.onreadystatechange = function() {
			if(xmlHttp.readyState === 4) {
				var html = xmlHttp.responseText;

				_.each(safari.application.browserWindows, function(win) {
					_.each(win.tabs, function(tab) {
						if(typeof tab.url !== 'undefined') {
							if(tab === win.activeTab) return;
							if(!tab.url.match(/^https?:\/\//)) return;

							_.delay(function() {
								var pageInfo = {
									url: tab.url,
									title: tab.title
								};

								var pageHtml = html.replace(/\{\/\*pageInfoObject\*\/\}/, JSON.stringify(pageInfo));
								var dataURL = 'data:text/html;charset=utf-8,' + encodeURIComponent(pageHtml);
								tab.url = dataURL;
							}, c * 100);

							c++;
						}
					});
				});
			}
		};
		xmlHttp.send(null);
{'fraction_non_alphanumeric': 0.17236180904522613, 'fraction_numerical': 0.006030150753768844, 'mean_word_length': 2.680221811460259, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '926445', 'n_tokens_mistral': 897, 'n_tokens_neox': 662, 'n_words': 115}