const map = {
}

function urlCapture (url) {
  let newUrl = new URL(url);
  let baseUrl = "https://docs.tibco.com/emp/mdm/9.3.0/doc/html/Default.htm";  //Add the product base url here - https://docs.tibco.com/emp/mdm/9.3.0/doc/html/Default.htm
  const queryString = newUrl.search;
  const urlParams = new URLSearchParams(queryString);
  const context = urlParams.get('context');
    if(map[context]){
    	console.log('inside if condition')
    	// let output = new URL(newUrl.origin);
      // output.host = newUrl.host;
      // let pathname = `${path}#${map[context]}`
      // output.pathname = pathname;
      let updatedUrl = `${baseUrl}#${map[context]}`
      // window.location = output.href;
      window.location = updatedUrl;
    }
}

urlCapture(window.location.href);