 
 @links = []
 @linksForFilter = {}
+@previewAmount = 0
+@previewLinks = {}
 
 onInstalledHandler = ->
 	chrome.contextMenus.create({contexts:["all"], id:"parent", title:chrome.i18n.getMessage("menu_main")})

	chrome.contextMenus.update(id, {title:title, enabled:links.length > 0})

onClickHandler = (info, tab) ->
	links = @linksForFilter[info.menuItemId]
	if links.length <= LINK_WARNING_AMOUNT or confirm(chrome.i18n.getMessage("selection_alert_tooManyLinks", [links.length]))
		for link in links
			chrome.tabs.create({url:link,index:tab.index+1})

chrome.runtime.onInstalled.addListener(onInstalledHandler)
chrome.extension.onMessage.addListener(onMessageHandler)

# THE SOFTWARE.

LINK_WARNING_AMOUNT = 20
LINK_PREVIEW_THRESHOLD = 10
BLACKLIST = /^javascript/i
FILTERS = {
						all: ".*",
