I am using a JS popup window for an Oauth2 Implicit Grant. I'm using JS to monitor for URL changes to get the code grant.
newWindow.addEventListener('unload', function(e)
{
console.log(e.currentTarget.location);
if (e.currentTarget.location.href.includes('code='))
{
var url = new URL(e.currentTarget.location.href);
alert(url.searchParams.get('code'));
}
});
The problem I am having is that the location field is giving two different values for the href parameter.
As you can see in the image, the href parameter has two different values. How do I make sure I always get the second value?

e.currentTarget.location.hrefshow?about:blank... but console.log lists the other address in the drop down.consolevalues, working as expected?