I believe that this will have issues (on most if not all browser) when opening links in new tabs.

In two of the common ways of opening links in new tabs (at least on Chrome) this approach has the following issues.

1. Right-click + Open in new tab - No search context updated
2. Command + Click - Search context is not updated but counter is (e.g. result set is most recent in session and not updated from click event but the counter is).

I believe that the 2nd issue I reference isn't necessarily tied to your PR, but I wasn't sure if that's something that you're trying to solve with this or not.