[ReactNative] Fix Chrome debugger
This commit is contained in:
parent
2434512847
commit
a8a1798449
|
@ -136,7 +136,7 @@ typedef void (^WSMessageCallback)(NSError *error, NSDictionary *reply);
|
|||
|
||||
- (void)executeApplicationScript:(NSString *)script sourceURL:(NSURL *)URL onComplete:(RCTJavaScriptCompleteBlock)onComplete
|
||||
{
|
||||
NSDictionary *message = @{@"method": NSStringFromSelector(_cmd), @"url": [URL absoluteString], @"inject": _injectedObjects};
|
||||
NSDictionary *message = @{@"method": @"executeApplicationScript", @"url": [URL absoluteString], @"inject": _injectedObjects};
|
||||
[self sendMessage:message context:nil waitForReply:^(NSError *error, NSDictionary *reply) {
|
||||
onComplete(error);
|
||||
}];
|
||||
|
@ -146,7 +146,7 @@ typedef void (^WSMessageCallback)(NSError *error, NSDictionary *reply);
|
|||
{
|
||||
RCTAssert(onComplete != nil, @"callback was missing for exec JS call");
|
||||
NSDictionary *message = @{
|
||||
@"method": NSStringFromSelector(_cmd),
|
||||
@"method": @"executeJSCall",
|
||||
@"moduleName": name,
|
||||
@"moduleMethod": method,
|
||||
@"arguments": arguments
|
||||
|
|
|
@ -41,13 +41,13 @@ var messageHandlers = {
|
|||
window.localStorage.setItem('sessionID', message.id);
|
||||
window.location.reload();
|
||||
},
|
||||
'executeApplicationScript:sourceURL:onComplete:': function(message, sendReply) {
|
||||
'executeApplicationScript': function(message, sendReply) {
|
||||
for (var key in message.inject) {
|
||||
window[key] = JSON.parse(message.inject[key]);
|
||||
}
|
||||
loadScript(message.url, sendReply.bind(null, null));
|
||||
},
|
||||
'executeJSCall:method:arguments:context:callback:': function(message, sendReply) {
|
||||
'executeJSCall': function(message, sendReply) {
|
||||
var returnValue = [[], [], [], [], []];
|
||||
try {
|
||||
if (window && window.require) {
|
||||
|
|
Loading…
Reference in New Issue