Mouse middle click in Mac OS — Misson Control and Close Tab at the same time: How To?
There is one program that I have found that does this really well:  ControllerMate

Technically, it's very much overkill in comparison to what you need and what is provided by the commonly known apps like Karabiner, BetterTouchTool and Keyboard Maestro.

With ControllerMate, you can create a a sequence of events depending on what button is pressed with whatever modifier in whatever application you specify.

For example, I created a sample workflow that checks to see if the middle button of the mouse is pressed and if the mouse is on a Chrome Tab (this will have to be written outside this example), it will issue the Command W (Close) keyboard shortcut.



If you notice, I have this setup specifically for the "Chrome Group."  With this setting, you can create a "programming page" that is only active when you specify:



Bottom line:  this can be done, with a little Apple Script programming (so that you can detect when your Chrome Tab is in Focus) or when you are on a URL.