[MM-32946][MM-40602] Ensure URL is valid before showing tooltip link, allow parsed URLs that aren't valid to open in browser (#1925)

* [MM-40602] Ensure URL is valid before showing tooltip link

* Rework to allow invalid URLs to display

* [MM-32946] Allow parsable URLs and open invalid URIs in browser
This commit is contained in:
Devin Binnie
2021-12-16 10:06:11 -05:00
committed by GitHub
parent 5ef1f56d63
commit 9b1ee66c8c
5 changed files with 17 additions and 4 deletions

View File

@@ -40,7 +40,11 @@ function getHost(inputURL: URL | string) {
// isInternalURL determines if the target url is internal to the application.
// - currentURL is the current url inside the webview
function isInternalURL(targetURL: URL, currentURL: URL) {
function isInternalURL(targetURL: URL | undefined, currentURL: URL) {
if (!targetURL) {
return false;
}
if (targetURL.host !== currentURL.host) {
return false;
}