mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-15 20:51:57 +00:00
Fix Firefox about:blank iframe braindeath
This commit is contained in:
parent
ac1bb81162
commit
263701c499
@ -141,9 +141,13 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
iframeLoad() {
|
iframeLoad() {
|
||||||
if (this.webiframe && this.iframeUrl.value) {
|
if (this.webiframe && this.iframeUrl.value) {
|
||||||
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
|
// This hack deals with Firefox iframes having a valid src,
|
||||||
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
|
// but 'about:blank' contentWindow on (load) events
|
||||||
this.actualIframeUrl = niceURL;
|
setTimeout(() => {
|
||||||
|
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
|
||||||
|
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
|
||||||
|
this.actualIframeUrl = niceURL;
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user