mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Apply getter check to determine if API is exposed as property or as method for iOS backward compatibility
This commit is contained in:
@@ -3,6 +3,8 @@ var inspectorCommands: typeof inspectorCommandTypes = require("./InspectorBacken
|
||||
|
||||
import * as debuggerDomains from "./debugger";
|
||||
|
||||
import * as utils from "utils/utils";
|
||||
|
||||
declare var __inspectorTimestamp;
|
||||
|
||||
const frameId = "NativeScriptMainFrameIdentifier";
|
||||
@@ -212,9 +214,9 @@ export class NetworkDomainDebugger implements inspectorCommandTypes.NetworkDomai
|
||||
* Loads a resource in the context of a frame on the inspected page without cross origin checks.
|
||||
*/
|
||||
loadResource(params: inspectorCommandTypes.NetworkDomain.LoadResourceMethodArguments): { content: string, mimeType: string, status: number } {
|
||||
let appPath = NSBundle.mainBundle().bundlePath;
|
||||
let appPath = utils.ios.getter(NSBundle, NSBundle.mainBundle).bundlePath;
|
||||
let pathUrl = params.url.replace("file://", appPath);
|
||||
let fileManager = NSFileManager.defaultManager();
|
||||
let fileManager = utils.ios.getter(NSFileManager, NSFileManager.defaultManager);
|
||||
let data = fileManager.fileExistsAtPath(pathUrl) ? fileManager.contentsAtPath(pathUrl) : undefined;
|
||||
let content = data ? NSString.alloc().initWithDataEncoding(data, NSUTF8StringEncoding) : "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user