For example, site A is in tab 1. Clicking on a link in site A loads site B in tab 2. No problem. But clicking on another link in site A loads site C in tab 2. Problem!
Please note that each link is unique every time site A is visited.
I don't have any other requirements. All Firefox extensions are automatically open-source, so that's a given. No OS or price constraints applicable.