 	@previewAmount = 0
 	@previewLinks = {}
 
-filterLinks = (filter) ->
-	link for link in @links.reverse() when link.match(new RegExp(filter, "i")) and not link.match(BLACKLIST)
+filterLinks = (filter, links) ->
+	link for link in links when link.match(new RegExp(filter, "i")) and not link.match(BLACKLIST)
 
 updateContextMenu = (id) -> 
 	links = @linksForFilter[id]

	else
		links = @linksForFilter[info.menuItemId]
		if links.length <= LINK_WARNING_AMOUNT or confirm(chrome.i18n.getMessage("selection_alert_tooManyLinks", [links.length]))
			for link in links
				openLink(link, tab)

openLink = (url, currentTab) ->


onMessageHandler = (request, sender, sendResponse) ->
	if request.type == "verifySelection"
		@links = filterLinks(FILTERS["all"], request.links)
		updateContextMenus()

updateContextMenus = ->
	renderPreviewContextMenus()
	for own key, value of FILTERS
		@linksForFilter[key] = filterLinks(value, @links)
		updateContextMenu(key)

renderPreviewContextMenus = ->
