I would use a query parameter here. In the selection handler, when building the URL that you will pass to window.open()
, append ?key=value
, where value
is the value you want to pass and key
is some parameter name (anything you like).
Then your second page can refer to the value of the page parameters in location.search
.