Automating a Series of Right-Click Actions in a Browser, in a Specific Section of a Page

OK, I can't work out if this is possible, but I have some of the parts.

I have a page that has a number of links in a table. I don't know how many rows there are in the table, so I need a script that will loop through the rows and open the link whether there are 5 or 50, then open those links in a new tab.

I know the Javascript to do this, but I cannot open in a new tab in JS. This page has a weird behaviour in that the page linked will only open if you click that link; if you copy the URL and try to open in a new tab, it errors. There must be some kind of referrer check.

So, I need to automate the process of doing a right click on these links, one at a time, regardless of the number. Assuming that I can identify the table (I can, it has an ID), is it possible to get KM to automate this somehow?