[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-11-19 Thread Sergey Grebnov (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013398#comment-15013398
 ] 

Sergey Grebnov edited comment on CB-9445 at 11/19/15 11:41 AM:
---

If I add executeScript inside callback (as showed below) then it works correct 
so I think proposed solution is not ideal, but covers most cases and ready to 
send a PR. But I'm wondering why we use such a tricky way instead of just 
calling 'stringByEvaluatingJavaScriptFromString'?

{code}
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstart', function() {
ref.executeScript({code: "window.some_var = 'some 
value';"},function(){
 ref.executeScript({code: "window.some_var2 = 'some 
value2';"},function(){
alert('loadstart2 callback');
  });

alert('loadstart1 callback');

});

});

ref.addEventListener('loadstop', function() {
ref.executeScript({code: "alert('loadstop code:' + window.some_var 
+ ' '+ window.some_var2);"},function(){alert('loadstop callback');});
});
{code}


was (Author: sgrebnov):
If I add executeScript inside callback (as showed below) then it works correct 
so I think proposed solution is not ideal, but but covers most cases and ready 
to send a PR. But I'm wondering why we use such a tricky way instead of just 
calling 'stringByEvaluatingJavaScriptFromString'?

{code}
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstart', function() {
ref.executeScript({code: "window.some_var = 'some 
value';"},function(){
 ref.executeScript({code: "window.some_var2 = 'some 
value2';"},function(){
alert('loadstart2 callback');
  });

alert('loadstart1 callback');

});

});

ref.addEventListener('loadstop', function() {
ref.executeScript({code: "alert('loadstop code:' + window.some_var 
+ ' '+ window.some_var2);"},function(){alert('loadstop callback');});
});
{code}

> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>  Labels: Triaged, iOS
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-11-19 Thread Sergey Grebnov (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013379#comment-15013379
 ] 

Sergey Grebnov edited comment on CB-9445 at 11/19/15 11:25 AM:
---

Here is my code (no other changes)

{code}
- (void)injectDeferredObject:(NSString*)source withWrapper:(NSString*)jsWrapper
{
NSLog(@"injectDeferredObject source: %@; wrapper: %@", source, jsWrapper);

// Ensure an iframe bridge is created to communicate with the 
CDVInAppBrowserViewController
[self.inAppBrowserViewController.webView 
stringByEvaluatingJavaScriptFromString:@"(function(d){if(d.getElementById('_cdvIframeBridge'))
 return; var e = _cdvIframeBridge = 
d.createElement('iframe');e.id='_cdvIframeBridge'; 
e.style.display='none';d.body.appendChild(e);})(document)"];

if (jsWrapper != nil) {
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:@[source] 
options:0 error:nil];
NSString* sourceArrayString = [[NSString alloc] initWithData:jsonData 
encoding:NSUTF8StringEncoding];
if (sourceArrayString) {
NSString* sourceString = [sourceArrayString 
substringWithRange:NSMakeRange(1, [sourceArrayString length] - 2)];
NSString* jsToInject = [NSString stringWithFormat:jsWrapper, 
sourceString];
NSLog(@"stringByEvaluatingJavaScriptFromString %@", jsToInject);
[self.inAppBrowserViewController.webView 
stringByEvaluatingJavaScriptFromString:jsToInject];
}
} else {
[self.inAppBrowserViewController.webView 
stringByEvaluatingJavaScriptFromString:source];
}
}
{code}


was (Author: sgrebnov):
Here is my code (no other changes)

{code}
- (void)injectDeferredObject:(NSString*)source withWrapper:(NSString*)jsWrapper
{
NSLog(@"injectDeferredObject source: %@; wrapper: %@", source, jsWrapper);

// Ensure an iframe bridge is created to communicate with the 
CDVInAppBrowserViewController
[self.inAppBrowserViewController.webView 
stringByEvaluatingJavaScriptFromString:@"(function(d){if(document.getElementById('_cdvIframeBridge'))
 return; var e = _cdvIframeBridge = 
d.createElement('iframe');e.id='_cdvIframeBridge'; 
e.style.display='none';d.body.appendChild(e);})(document)"];

if (jsWrapper != nil) {
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:@[source] 
options:0 error:nil];
NSString* sourceArrayString = [[NSString alloc] initWithData:jsonData 
encoding:NSUTF8StringEncoding];
if (sourceArrayString) {
NSString* sourceString = [sourceArrayString 
substringWithRange:NSMakeRange(1, [sourceArrayString length] - 2)];
NSString* jsToInject = [NSString stringWithFormat:jsWrapper, 
sourceString];
NSLog(@"stringByEvaluatingJavaScriptFromString %@", jsToInject);
[self.inAppBrowserViewController.webView 
stringByEvaluatingJavaScriptFromString:jsToInject];
}
} else {
[self.inAppBrowserViewController.webView 
stringByEvaluatingJavaScriptFromString:source];
}
}
{code}

> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>  Labels: Triaged, iOS
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-11-19 Thread Sergey Grebnov (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013235#comment-15013235
 ] 

Sergey Grebnov edited comment on CB-9445 at 11/19/15 10:32 AM:
---

if I modify code to re-create _cdvIframeBridge iframe for every 
injectScriptCode call then shouldStartLoadWithRequest is called every time and 
callbacks work.


was (Author: sgrebnov):
if modify code to re-create _cdvIframeBridge iframe for every injectScriptCode 
call then shouldStartLoadWithRequest is called every time and callbacks work.

> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>  Labels: Triaged, iOS
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-11-19 Thread jcesarmobile (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013251#comment-15013251
 ] 

jcesarmobile edited comment on CB-9445 at 11/19/15 9:51 AM:


[~sgrebnov] in my tests, the problem was if you use the executeScript on 
loadstart, the cordova iframe is added to an empty page, but when the page is 
loaded the iframe disappears (as the page is loaded and the webview content is 
replaced)

So I kept the issue open to document that executeScript shouldn't be called on 
loadstart.

I've though on another option that might work, I saw this on the cordova.js 
(part of pokeNative funcion that creates the iframe)
{code}
// CB-5488 - Don't attempt to create iframe before document.body is available.
if (!document.body) {
setTimeout(pokeNative);
return;
}
{code}



was (Author: jcesarmobile):
[~sgrebnov] in my tests, the problem was if you use the executeScript on 
loadstart, the cordova iframe is added to an empty page, but when the page is 
loaded the iframe disappears (as the page is loaded and the webview content is 
replaced)

So I kept the issue open to document that executeScript shouldn't be called on 
loadstart.

I've though on another option that might work, I saw this on the cordova.js 
(part of pokeNative funcion that creates the iframe)

// CB-5488 - Don't attempt to create iframe before document.body is available.
if (!document.body) {
setTimeout(pokeNative);
return;
}



> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>  Labels: Triaged, iOS
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-11-19 Thread jcesarmobile (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013251#comment-15013251
 ] 

jcesarmobile edited comment on CB-9445 at 11/19/15 9:50 AM:


[~sgrebnov] in my tests, the problem was if you use the executeScript on 
loadstart, the cordova iframe is added to an empty page, but when the page is 
loaded the iframe disappears (as the page is loaded and the webview content is 
replaced)

So I kept the issue open to document that executeScript shouldn't be called on 
loadstart.

I've though on another option that might work, I saw this on the cordova.js 
(part of pokeNative funcion that creates the iframe)

// CB-5488 - Don't attempt to create iframe before document.body is available.
if (!document.body) {
setTimeout(pokeNative);
return;
}




was (Author: jcesarmobile):
[~sgrebnov] in my tests, the problem was if you use the executeScript on 
loadstart, the cordova iframe is added to an empty page, but when the page is 
loaded the iframe disappears (as the page is loaded and the webview content is 
replaced)

So I kept the issue open to document that executeScript shouldn't be called on 
loadstart.

I've though on another option that might work, I saw this on the cordova.js 
(part of pokeNative funcion that creates the iframe)

// CB-5488 - Don't attempt to create iframe before document.body is available.
if (!document.body) {
setTimeout(pokeNative);
return;
}



> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>  Labels: Triaged, iOS
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-11-19 Thread jcesarmobile (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013251#comment-15013251
 ] 

jcesarmobile edited comment on CB-9445 at 11/19/15 9:50 AM:


[~sgrebnov] in my tests, the problem was if you use the executeScript on 
loadstart, the cordova iframe is added to an empty page, but when the page is 
loaded the iframe disappears (as the page is loaded and the webview content is 
replaced)

So I kept the issue open to document that executeScript shouldn't be called on 
loadstart.

I've though on another option that might work, I saw this on the cordova.js 
(part of pokeNative funcion that creates the iframe)

// CB-5488 - Don't attempt to create iframe before document.body is available.
if (!document.body) {
setTimeout(pokeNative);
return;
}




was (Author: jcesarmobile):
[~sgrebnov] in my tests, the problem was if you use the executeScript on 
loadstart, the cordova iframe is added to an empty page, but when the page is 
loaded the iframe disappears (as the page is loaded and the webview content is 
replaced)

So I kept the issue open to document that executeScript shouldn't be called on 
loadstart.

I've though on another option that might work, I saw this on the cordova.js 
(part of pokeNative funcion that creates the iframe)

// CB-5488 - Don't attempt to create iframe before document.body is available.
if (!document.body) {
setTimeout(pokeNative);
return;
}



> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>  Labels: Triaged, iOS
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-11-19 Thread Sergey Grebnov (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013206#comment-15013206
 ] 

Sergey Grebnov edited comment on CB-9445 at 11/19/15 9:42 AM:
--

Confirm callbacks issue, from what I see 

_cdvIframeBridge.src is correctly set every time so code is invoked.

but the shouldStartLoadWithRequest for gap-iab://InAppBrowser is called 
only once so no callbacks are called anymore


was (Author: sgrebnov):
Confirm callbacks issue, from what I see 

_cdvIframeBridge.src is correctly set every time so code is invoked.

but the the shouldStartLoadWithRequest for gap-iab://InAppBrowser is called 
only once so no callbacks are called anymore

> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>  Labels: Triaged, iOS
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-08-20 Thread Scott Seitz (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14705836#comment-14705836
 ] 

Scott Seitz edited comment on CB-9445 at 8/20/15 10:02 PM:
---

If that's the case, then it should definitely be documented.  However, as to 
verifying across devices, running executeScript upon the loadstart event most 
certainly runs the script in the inappbrowser window and fires the callback for 
both iOS and Android.

The problem I ran into was that a subsequent executeScript upon the loadstop 
event worked on both platforms, but only Android fired the callback.  When I 
removed the executeScript from the loadstart event, the executeScript triggered 
by the loadstop event fired the callback just fine on iOS.  

What I failed to test was something akin to polling to see if all callbacks 
(after the loadstop event) work, or whether only one executeScript will work 
per inappbrowser instance.  If jcesarmobile is correct that the reason the 
iFrame (used prior to the loadstop event occuring) disappears is due to the 
page actually finishing loading, then it would stand to reason that an iFrame 
created AFTER the page has loaded would NOT disappear, and you would not have 
to create a new iFrame for every time you call executeScript.

Is it possible (and less onerous) for executeScript to only create a new iFrame 
if it can't find an existing one?

And again...why the heck does the Android platform seem to work just fine?



was (Author: dtc7240):
If that's the case, then it should definitely be documented.  However, as to 
verifying across devices, running executeScript upon the loadstart event most 
certainly runs the script in the inappbrowser window and fires the callback for 
both iOS and Android.

The problem I ran into was that a subsequent executeScript upon the loadstop 
event worked on both platforms, but only Android fired the callback.  When I 
removed the executeScript from the loadstart event, the executeScript triggered 
by the loadstop event fired the callback just fine on iOS.  

What I failed to test was something akin to polling to see if all callbacks 
(after the loadstop event) work, or whether only one executeScript will work 
per inappbrowser instance.  If jcesarmobile is correct that the reason the 
iFrame (used prior to the loadstop event occuring) disappears is due to the 
page actually finishing loading, then it would stand to reason that an iFrame 
created AFTER the page has loaded would NOT disappear, and you would not have 
to create a new one for every time you call executeScript.

Is it possible (and less onerous) for executeScript to only create a new iFrame 
if it can't find an existing one?

And again...why the heck does the Android platform seem to work just fine?


> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: iOS, Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>Assignee: jcesarmobile
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-08-07 Thread jcesarmobile (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14661482#comment-14661482
 ] 

jcesarmobile edited comment on CB-9445 at 8/7/15 8:20 AM:
--

just tried this code and worked

{code:javascript}
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {
ref.executeScript({code: 
"alert('loadStop');"},function(){alert('executed');});
});
{code}

Please, provide your sample code that didn't work


was (Author: jcesarmobile):
just tried this code and worked

{code:javascript}
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {
ref.executeScript({code: 
"alert('loadStop');"},function(){alert('executed');});
});
{code}

> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: iOS, Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-08-07 Thread jcesarmobile (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14661482#comment-14661482
 ] 

jcesarmobile edited comment on CB-9445 at 8/7/15 8:16 AM:
--

just tried this code and worked

{code:javascript}
var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 
'location=yes');
ref.addEventListener('loadstop', function() {
ref.executeScript({code: 
"alert('loadStop');"},function(){alert('executed');});
});
{code}


was (Author: jcesarmobile):
just tried this code and worked

var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 
'location=yes');
ref.addEventListener('loadstop', function() {
ref.executeScript({code: 
"alert('loadStop');"},function(){alert('executed');});
});

> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: iOS, Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-9445) executeScript callbacks not working for iOS

2015-08-07 Thread jcesarmobile (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-9445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14661482#comment-14661482
 ] 

jcesarmobile edited comment on CB-9445 at 8/7/15 8:17 AM:
--

just tried this code and worked

{code:javascript}
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {
ref.executeScript({code: 
"alert('loadStop');"},function(){alert('executed');});
});
{code}


was (Author: jcesarmobile):
just tried this code and worked

{code:javascript}
var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 
'location=yes');
ref.addEventListener('loadstop', function() {
ref.executeScript({code: 
"alert('loadStop');"},function(){alert('executed');});
});
{code}

> executeScript callbacks not working for iOS
> ---
>
> Key: CB-9445
> URL: https://issues.apache.org/jira/browse/CB-9445
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: iOS, Plugin InAppBrowser
>Affects Versions: 5.1.1
> Environment: Cordova 5.1.1 (CLI), ios 3.8.0, android 4.0.2, 
> cordova-plugin-inappbrowser 1.0.1 (NPM)
>Reporter: Scott Seitz
>
> Can someone please check to see if they are encountering the same problem I 
> am in the environment I've listed? (latest released builds of everything I 
> think)
> I open an inappbrowser window and then run an executeScript command using 
> "code:" (not "file:").  Everything works fine on Android, but on iOS, it 
> simply will NOT fire the callback function after executing the injected code. 
>  Make the "code:" as simple as you like to test it and see if you can get a 
> callback to fire.  I've dumbed it down as much as possible and can't get one 
> to fire.  I know that all instances of code I've injected have run fine in 
> the iab by using the console (against the iab) to check for the variables I 
> was creating in the code.  I can't even get a callback to fire that doesn't 
> expect a parameter to be passed back...
> Many thanks,
> Scott



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org