cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <>
Subject Android: Deprecate WebView.sendJavascript()?
Date Mon, 26 May 2014 16:59:05 GMT

It's a fairly common anti-pattern to use sendJavascript() to communicate
with native side. Not sure if deprecating the call is the right move, but
wanted to pitch the idea.

There are multiple pitfalls:
1. As in the bug, it doesn't work if cordova.js isn't loaded yet
2. It's ripe for escaping bugs
3. It's less performant than using PluginResults

Given that you can implement sendJavascript via PluginResults by just
eval()ing the results, maybe we could just deprecate the function?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message