mogoweb / chromium_webview

Android WebView wrapper based on chromium
http://mogoweb.github.com
BSD 3-Clause "New" or "Revised" License
514 stars 160 forks source link

JavascriptInterface is not being exposed in WebView #20

Closed MSDevs closed 10 years ago

MSDevs commented 10 years ago

Using addJavascriptInterface, non of the interface methods are being exposed in the WebView. All are "undefined".

ani29 commented 10 years ago

I have used this webView.addJavascriptInterface(new JsBindings(context), "JavaScriptBind");

where JsBindings is my class which have java script interfaces

Aniruddh Rathore

On Tue, Mar 25, 2014 at 6:45 PM, MSDevs notifications@github.com wrote:

Using addJavascriptInterface, non of the interface methods are being exposed in the WebView. All are "undefined".

Reply to this email directly or view it on GitHubhttps://github.com/mogoweb/chromium_webview/issues/20 .

MSDevs commented 10 years ago

Hi ani29,

Thanks for quick reply. I use it in the exact same way, it is working in the default WebView but not on the Chrome one.

MSDevs commented 10 years ago

SOLVED: Wrong import. You should import: import com.mogoweb.chrome.JavascriptInterface;

Instead of: import android.webkit.JavascriptInterface;