New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] injectScript not work! #69
Comments
@peng051410 you should change your html code |
me either, the same code as iOS, but the injected code seems not work. |
@quentinzhang so can you load your page in Android? |
@peng051410 I solve this in iOS like #59 |
@YangYouYong 已加你qq! |
能加载出网页,只是注入的代码没有生效。已经在QQ上添加你了。 On Fri, Mar 18, 2016 at 4:54 PM, YangYouYong notifications@github.com
|
got the same issue |
I think what write handler() is old. change injectedScript
If you read example and tried it, you will solve problem |
I experienced something interesting. My script works on iOS but applying it to android did not work.
Illustration: const scriptNotWorking = `
// a comment <= erase all comments like this one!!!
alert('it won\'t work');
`; const scriptWorking = `
alert('it will work');
`; |
I also am unable to inject JS into a WebViewBridge on android. If I change the type to plain old WebView with all the same props then it works so I suspect it must be something with this library. Further, I'm seeing the same weird issue with comments as @MacKentoch but I'm seeing it with the plain old WebView. Any comments at all (even at the end of the line or at the end of all the JS) cause the javascript to not run. |
I got the same issue. The code works on iOS buy didn't work on Android even the simplest code as MacKentoch's. |
Any updates or eta on a resolution to this related to android injected javascript not working, please? |
I managed to get it working, thanks @alinz |
GEEEEEEEZUZ christ |
I write bellow code:
function webViewBridgeReady(cb) {
if (window.WebViewBridge) {
cb(window.WebViewBridge);
return;
}
}
function goDetail(id) {
WebViewBridge.send("jump:" + id);
}
webViewBridgeReady(function (webViewBridge) {
webViewBridge.send("message from webview");
});
the html is get from server, html have a button and click to invoke the goDetail function,but in android the
log cat say 'goDetail is not defined'.
can you help me?
The text was updated successfully, but these errors were encountered: