hot get access_token instead of url

JavaScript
var urlString = 'http://localhost:3000/_oauth/google#access_token=ya29.5HxuYol1Io8JLeGePDznbfkkwu_PC4uodKwG8_1clFYAn9AgdOV1WGpOTNQP3s76HAsn7Y4zWw&token_type=Bearer&expires_in=3600';

var url = new URL(urlString);
// OR: If you want to use the current page's URL
var url = window.location;

var access_token = new URLSearchParams(url.search).get('access_token');
Source

Also in JavaScript: