mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 12:22:54 +00:00 
			
		
		
		
	Fix Firefox iframe about:blank after load braindeath
This commit is contained in:
		@@ -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;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user