Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
263701c499 |
@@ -141,15 +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,
|
||||||
console.log(href, this.webiframe.nativeElement.contentWindow);
|
// but 'about:blank' contentWindow on (load) events
|
||||||
const match = href.match(/.*?\/\/.*?(\/.*)/);
|
setTimeout(() => {
|
||||||
if (match !== null) {
|
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
|
||||||
// iframes on Firefox can have an about:blank
|
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
|
||||||
// contentWindow after firing a (load) event
|
|
||||||
const niceURL = match[1];
|
|
||||||
this.actualIframeUrl = niceURL;
|
this.actualIframeUrl = niceURL;
|
||||||
}
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user