Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8361

The use of phonegap WebView JS injection in the Android 4.3 system version, return the results of delays, that is to use JS loadurl method to load caused by thread occlusion, how to solve?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.6.3
    • 3.6.3
    • cordova-android
    • cordova 3.6.3
      android 4.3

    Description

      JS injection in the onpageFinsh method in WebView
      This is my code
      public void onPageFinished(WebView view, String arg1) {
      // TODO Auto-generated method stub

      setTitle(cordovaWebView.getTitle());
      if (!TextUtils.isEmpty(jsStr)) {
      final StringBuilder js = new StringBuilder();
      js.append(
      "var newscript = document.createElement(\"script\");")
      .append(jsStr)
      .append("document.body.appendChild(newscript);");
      if (android.os.Build.VERSION.SDK_INT < 19)

      { cordovaWebView.loadUrl("javascript:" + js.toString()); }

      else

      { cordovaWebView.evaluateJavascript( "javascript:" + js.toString(), null); }

      }
      }
      Android 4.4 using evaluateJavascript does not appear to delay.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gaobin881201 space
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 96h
                96h
                Remaining:
                Remaining Estimate - 96h
                96h
                Logged:
                Time Spent - Not Specified
                Not Specified