function safelyAssign (target) {
  target = parseTarget(target)
  if (navigated || !isGoodLink(target)) return false
  navigated = true
  let url = new URL(target)
  if (!url || !url.hash) target += location.hash
  unsafelyAssign(target)
  return true
}
Will check if the URL is safe to navigate to before calling unsafelyAssign. This is used to prevent the user from navigating to a malicious or nonexistent site.
@param {String} u - The URL to navigate to