Wicket
  1. Wicket
  2. WICKET-3887

Problems concerning IE9 with "ActiveX Filtering" enabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.17
    • Fix Version/s: 1.4.18, 1.5-RC6
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows 7, Internet Explorer 9, "ActiveX Filtering" enabled (for example as a domain policy in a company)

      Description

      Internet Explorer 9 contains a new feature to block all ActiveX content by default:

      http://ie.microsoft.com/testdrive/Browser/ActiveXFiltering/About.html

      If the feature is enabled, all ActiveX controls are blocked silently. With Wicket this currently results in a lot of JavaScript content (but not all of it) being blocked as well. The user can allow an exception by clicking on a small icon in the address bar, however, he usually will be only able to do so, if he knows exactly what causes the problem.

      A user who enabled the feature himself might still see what is wrong, but the feature can be also enabled in a domain policy, which might make solving the problem much more difficult and have adverse effects on customers.

      The reason that some JavaScript content is blocked along with blocking ActiveX elements is the usage of window.ActiveXObject:

      wicket-ajax.js:

      >if (window.ActiveXObject)

      { > transport = new ActiveXObject("Microsoft.XMLHTTP"); > Wicket.Log.info("Using ActiveX transport"); >}

      else if (window.XMLHttpRequest)

      { > transport = new XMLHttpRequest(); > Wicket.Log.info("Using XMLHttpRequest transport"); >}

      According to

      http://blogs.msdn.com/b/ie/archive/2011/05/02/activex-filtering-for-developers.aspx

      the usage of this pattern is not advisable and the order should be changed to:

      >// Best Practice: Use Native XHR, if available
      >if (window.XMLHttpRequest)

      { > // If IE7+, Gecko, WebKit: Use native object > var xmlHttp = new XMLHttpRequest(); >}

      >else if (window.ActiveXObject)

      { > // ...if not, try the ActiveX control > var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); >}

      The problem is reported to be fixed in JQuery 1.5.1, for instance.

        Activity

        Hide
        Martin Grigorov added a comment -

        This is fixed in 1.5 long ago.
        I think it is safe to back port to 1.4

        Show
        Martin Grigorov added a comment - This is fixed in 1.5 long ago. I think it is safe to back port to 1.4
        Hide
        Martin Grigorov added a comment -

        Backported the fix to 1.4.x.
        Tested wicket-examples/ajax/autocomplete with IE8.

        Show
        Martin Grigorov added a comment - Backported the fix to 1.4.x. Tested wicket-examples/ajax/autocomplete with IE8.
        Hide
        Walter B. Rasmann added a comment - - edited

        Thank you for your fast response and for dealing with this issue!

        Unfortunately there is still a problem.

        I tested the latest Wicket-1.4 SNAPSHOT with IE9:

        https://repository.apache.org/content/groups/snapshots/org/apache/wicket/wicket/1.4-SNAPSHOT/wicket-1.4-20110713.000152-600.jar

        Here is an excerpt from the WICKET-AJAX-DEBUG log:

        INFO: Using XMLHttpRequest transport
        […]
        INFO: Received ajax response (1114 characters)
        […]
        ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Automation server can't create object

        The following three sections of code have been executed in that order:

        wicket-ajax.js(724):

        >var transport = null;
        >if (window.XMLHttpRequest)

        { > transport = new XMLHttpRequest(); > Wicket.Log.info("Using XMLHttpRequest transport"); >}

        else if (window.ActiveXObject)

        { > transport = new ActiveXObject("Microsoft.XMLHTTP"); > Wicket.Log.info("Using ActiveX transport"); >}

        wicket-ajax.js(1038):

        >var xmldoc;
        >if (typeof(window.XMLHttpRequest) != "undefined" && typeof(DOMParser) != "undefined")

        { > var parser = new DOMParser(); > xmldoc = parser.parseFromString(responseAsText, "text/xml"); >}

        else if (window.ActiveXObject)

        { > xmldoc = t.responseXML; >}

        wicket-ajax.js(1516):

        >var xmldoc;
        >if (window.ActiveXObject) {
        > xmldoc = new ActiveXObject("Microsoft.XMLDOM");
        > if (!xmldoc.loadXML(text))

        { > Wicket.Log.error("Error parsing response: "+text); > }


        >} else

        { > var parser = new DOMParser(); > xmldoc = parser.parseFromString(text, "text/xml"); >}

        The last one caused an exception.

        Show
        Walter B. Rasmann added a comment - - edited Thank you for your fast response and for dealing with this issue! Unfortunately there is still a problem. I tested the latest Wicket-1.4 SNAPSHOT with IE9: https://repository.apache.org/content/groups/snapshots/org/apache/wicket/wicket/1.4-SNAPSHOT/wicket-1.4-20110713.000152-600.jar Here is an excerpt from the WICKET-AJAX-DEBUG log: INFO: Using XMLHttpRequest transport […] INFO: Received ajax response (1114 characters) […] ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Automation server can't create object The following three sections of code have been executed in that order: wicket-ajax.js(724): >var transport = null; >if (window.XMLHttpRequest) { > transport = new XMLHttpRequest(); > Wicket.Log.info("Using XMLHttpRequest transport"); >} else if (window.ActiveXObject) { > transport = new ActiveXObject("Microsoft.XMLHTTP"); > Wicket.Log.info("Using ActiveX transport"); >} wicket-ajax.js(1038): >var xmldoc; >if (typeof(window.XMLHttpRequest) != "undefined" && typeof(DOMParser) != "undefined") { > var parser = new DOMParser(); > xmldoc = parser.parseFromString(responseAsText, "text/xml"); >} else if (window.ActiveXObject) { > xmldoc = t.responseXML; >} wicket-ajax.js(1516): >var xmldoc; >if (window.ActiveXObject) { > xmldoc = new ActiveXObject("Microsoft.XMLDOM"); > if (!xmldoc.loadXML(text)) { > Wicket.Log.error("Error parsing response: "+text); > } >} else { > var parser = new DOMParser(); > xmldoc = parser.parseFromString(text, "text/xml"); >} The last one caused an exception.
        Hide
        Martin Grigorov added a comment -

        Improved!
        Thanks!

        There are no more usages of ActiveXObject in Wicket's .js files

        Show
        Martin Grigorov added a comment - Improved! Thanks! There are no more usages of ActiveXObject in Wicket's .js files
        Hide
        Walter B. Rasmann added a comment -

        Thank you very much!

        I have tested the changes with the latest snapshot of Wicket-1.4:

        https://repository.apache.org/content/groups/snapshots/org/apache/wicket/wicket/1.4-SNAPSHOT/wicket-1.4-20110719.085454-611.jar

        Everything seemed fine with IE9 ("ActiveX Filtering" enabled) and IE6 (security level "medium").

        Show
        Walter B. Rasmann added a comment - Thank you very much! I have tested the changes with the latest snapshot of Wicket-1.4: https://repository.apache.org/content/groups/snapshots/org/apache/wicket/wicket/1.4-SNAPSHOT/wicket-1.4-20110719.085454-611.jar Everything seemed fine with IE9 ("ActiveX Filtering" enabled) and IE6 (security level "medium").

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Walter B. Rasmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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

                Development