I visited a Stack Overflow page from Google, and this message popped up:
Why does Stack Overflow need to know my location? Note that I'm using a userscript that only hides the ads, so Stack Overflow doesn't get penalized, but if it was an advertisement requesting this, I would have expected the domain of an advertisement in the message, and not Stack Overflow itself.
google_ads_iframe_...
) and then runnavigator.geolocation.getCurrentPosition(()=>{});
. You'll see that the request is made on behalf of stackoverflow.com, just like in the screenshot. It can still very well be a sneaky ad.