<commit_before>
url = decodeURIComponent document.location.search.substr(1)

getTopLevelWindowContext = ->
	Ci = Components.interfaces
	window.QueryInterface(Ci.nsIInterfaceRequestor)
		.getInterface(Ci.nsIWebNavigation)
		.QueryInterface(Ci.nsIDocShellTreeItem)
		.rootTreeItem
		.QueryInterface(Ci.nsIInterfaceRequestor)
		.getInterface(Ci.nsIDOMWindow)

if url
	getTopLevelWindowContext().XUNLEI_LIXIAN_WEB?.download_url url

window.close()
<commit_msg>go back if the ed2k/magnet is opened in current tab; else close tab.<commit_after>
url = decodeURIComponent document.location.search.substr(1)

Ci = Components.interfaces

getTopLevelWindowContext = ->
	window.QueryInterface(Ci.nsIInterfaceRequestor)
		.getInterface(Ci.nsIWebNavigation)
		.QueryInterface(Ci.nsIDocShellTreeItem)
		.rootTreeItem
		.QueryInterface(Ci.nsIInterfaceRequestor)
		.getInterface(Ci.nsIDOMWindow)

getBrowser = ->
	window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation)

if url
	getTopLevelWindowContext().XUNLEI_LIXIAN_WEB?.download_url url

browser = getBrowser()
if browser.canGoBack
	browser.goBack()
else
	window.close()

{'fraction_non_alphanumeric': 0.09427312775330396, 'fraction_numerical': 0.0026431718061674008, 'mean_word_length': 6.52317880794702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3854221', 'n_tokens_mistral': 405, 'n_tokens_neox': 382, 'n_words': 56}