I want to get the redirect URL of this link, https://goo.gl/maps/7jNqZtPa5Cjf333k7
Since Google URL Shortner API Service is no longer available Is there any way to get the redirect URL without redirecting to it? When the link, https://goo.gl/maps/7jNqZtPa5Cjf333k7 is clicked it redirects to,
My question is: How to get the redirecting URL using JavaScript without redirecting to the page? Thanks.
If you're using fetch, the url property on the response will contain the final url. Link here.
To quote from the docs:
The url read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.
The response also has a redirected property which indicates if a redirect occurred.