I searched through SO and this question has been asked before several times, but I found no answers that explain how the behaviour I want to implement is actually realized.
What I have in mind is to mimic booking.com feature, in which when you open a search result from the search results list, a div indicating that the result has been opened in another tab (or window) appears, and it fades away when that other tab (or window) has been closed.
Screenshot:
First attempt was to check if some javascript has been attached to the links, but that's not the case, because if you simply copy the url from the page source, and open it, the feature works.
So I thought it could be someway managed on the server side, fired up wireshark to try to trap any ajax calls between the two opened pages and the server. There were many requests, but no one seems to pass the needed info (I guess the hotel ID or some url). Also note that opening the result item URL, which includes the session ID, in an incognito window or in another browser (I mean, firefox instead of chrome) window, breaks the feature; so that excludes any session or ip address tracking.
Last attempt I could think was the search results page is polling some cookie which is set on the domain when another page is opened and unset when it is closed. So I checked the cookies, whose content is actually a little cryptic to understand, but what I have seen is that no cookie actually is changed on other tab opening and closing, so, again, it cannot be done this way.
What's left?