diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 3faf602..ac9401e 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -142,8 +142,14 @@ export class DashboardComponent implements OnInit, OnDestroy { iframeLoad() { if (this.webiframe && this.iframeUrl.value) { const href = this.webiframe.nativeElement.contentWindow.frames.location.href; - const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1]; - this.actualIframeUrl = niceURL; + console.log(href, this.webiframe.nativeElement.contentWindow); + const match = href.match(/.*?\/\/.*?(\/.*)/); + if (match !== null) { + // iframes on Firefox can have an about:blank + // contentWindow after firing a (load) event + const niceURL = match[1]; + this.actualIframeUrl = niceURL; + } } }