* Parses the provided URL and its relative URL. * * @param url The full URL string. * @param relHref A URL string relative to the full URL string.
(url: string, relHref?: string | null)
| 444 | * @param relHref A URL string relative to the full URL string. |
| 445 | */ |
| 446 | $$parseLinkUrl(url: string, relHref?: string | null): boolean { |
| 447 | // When relHref is passed, it should be a hash and is handled separately |
| 448 | if (relHref && relHref[0] === '#') { |
| 449 | this.hash(relHref.slice(1)); |
| 450 | return true; |
| 451 | } |
| 452 | let rewrittenUrl; |
| 453 | let appUrl = this.stripBaseUrl(this.getServerBase(), url); |
| 454 | if (typeof appUrl !== 'undefined') { |
| 455 | rewrittenUrl = this.getServerBase() + appUrl; |
| 456 | } else if (this.getServerBase() === url + '/') { |
| 457 | rewrittenUrl = this.getServerBase(); |
| 458 | } |
| 459 | // Set the URL |
| 460 | if (rewrittenUrl) { |
| 461 | this.$$parse(rewrittenUrl); |
| 462 | } |
| 463 | return !!rewrittenUrl; |
| 464 | } |
| 465 | |
| 466 | private setBrowserUrlWithFallback(url: string, replace: boolean, state: unknown) { |
| 467 | const oldUrl = this.url(); |