class WXWebView implements IWebView {

    @Override
    public void postMessage(Object msg) {
        if (getWebView() == null) return;

        try {
            JSONObject initData = new JSONObject();
            initData.put("type", "message");
            initData.put("data", msg);
            initData.put("origin", mOrigin);
            evaluateJS("javascript:(function () {"
                + "var initData = " + initData.toString() + ";"
                + "try {"
                + "var event = new MessageEvent('message', initData);"
                + "window.dispatchEvent(event);"
                + "} catch (e) {}"
                + "})();");
        } catch (JSONException e) {
            throw new RuntimeException(e);
        }
    }

    public  WXWebView(Context context, String origin);

}