File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
tns-core-modules/debugger Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -212,9 +212,15 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
212212 * Loads a resource in the context of a frame on the inspected page without cross origin checks.
213213 */
214214 loadResource ( params : inspectorCommandTypes . NetworkDomain . LoadResourceMethodArguments ) : { content : string , mimeType : string , status : number } {
215+ let appPath = NSBundle . mainBundle ( ) . bundlePath ;
216+ let pathUrl = params . url . replace ( "file://" , appPath ) ;
217+ let fileManager = NSFileManager . defaultManager ( ) ;
218+ let data = fileManager . fileExistsAtPath ( pathUrl ) ? fileManager . contentsAtPath ( pathUrl ) : undefined ;
219+ let content = data ? NSString . alloc ( ) . initWithDataEncoding ( data , NSUTF8StringEncoding ) : "" ;
220+
215221 return {
216- content : "" ,
217- mimeType : "" ,
222+ content : content . toString ( ) , // Not sure why however we need to call toString() for NSString
223+ mimeType : "application/octet-stream " ,
218224 status : 200
219225 }
220226 }
You can’t perform that action at this time.
0 commit comments