Chrome: "open link in new tab" not firing the click event?

Use mousedown event in place of click:

var myTd = document.getElementById("mytest");
myTd.addEventListener("mousedown", function() {
    localStorage["foobar"] = 1;
});

In this way even if the user chooses to "Open link in a new tab", it still works.


nice question...

There is not a rightclick event on browser, chrome send the events mousedown, mouseup and contextmenu,

I found the following webpage quite useful, though I've not checked the rightbutton part, the general description of chain of events is quite faithful.

For a quick reference: http://unixpapa.com/js/mouse.html