MOBILE-4303 iframe: Avoid trying to access inaccessible iframes
With this change, the error about trying to access an iframe with different protocol, domain or port should no longer appear in console
This commit is contained in:
		
							parent
							
								
									28b48ac524
								
							
						
					
					
						commit
						9211b350dc
					
				| @ -231,6 +231,12 @@ export class CoreIframeUtilsProvider { | ||||
|      * @returns Window and Document. | ||||
|      */ | ||||
|     getContentWindowAndDocument(element: CoreFrameElement): { window: Window | null; document: Document | null } { | ||||
|         const src = 'src' in element ? element.src : element.data; | ||||
|         if (!CoreUrlUtils.isLocalFileUrl(src)) { | ||||
|             // No permissions to access the iframe.
 | ||||
|             return { window: null, document: null }; | ||||
|         } | ||||
| 
 | ||||
|         let contentWindow: Window | null = 'contentWindow' in element ? element.contentWindow : null; | ||||
|         let contentDocument: Document | null = null; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user