Results 1 to 9 of 9

Thread: IE 11 in documentMode 11 with compatibility userAgent still recognized as IE7

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-25551 in 6.5.1.
  1. #1
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    324

    Default IE 11 in documentMode 11 with compatibility userAgent still recognized as IE7

    I have set the following meta tag in my index.html: <meta http-equiv="X-UA-Compatible" content="IE=edge">

    The web server the site is on is set to compatibility mode, so the user agent delivered by IE is: "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"

    This causes the following behaviour:

    - IE reports document.documentMode as "11" (which clearly indicates the render mode and the available javascript engine as the IE11 render mode/JS engine)
    - but ExtJS 6.2.1 reports Ext.isIE7 as true, Ext.isIE8m as true, Ext.isIE9m as true.

    Subsequently the following error is thrown

    SCRIPT438: Object doesn't support property or method "attachEvent"
    - ext-all-rtl-debug.js line 18861 character 21


    This error was already reported by me and others in ExtJS 4.2.2, 4.2.4 and 6.0.1, but the code was **never** amended to fully support IE's documentMode property.

    So, Ext.env.Browser does very much hokey-pokey to read the wrong IE version from the user agent, while they should be able to read document.documentMode and be done with it.

    Furthermore, Ext.Boot does solve the same problem, detecting the user agent once again, even differently, but also incorrect!

    Ext.Boot.isIE8 = false, Ext.Boot.isIE9 = false, Ext.Boot.isIE10 = false, Ext.Boot.isIE11 = false, although document.documentMode is clearly 11.

    So, why does Sencha use two different methods for the same, both yield different results, both results are wrong, and it even seems as if I can override neither of them using standard Sencha overrides, because the methods are inlined in bigger methods, which are inlined in even bigger methods.

    What can I do? I am now, for the fourth time, fixing the same bug in your source code again, because I cannot override it. Every time I update the framework, I have to add the same bugfix again!

    WTF!?

    Amendment: I tried to add an override in Application.js:

    Code:
    Ext.define('MyApp.Application',{
        extend:'Ext.app.Application',
        requires:[
            'MyApp.override.Browser',
        ],
        ...
    });
    with the override defined as (console output for debugging)

    Code:
    Ext.define('MyApp.override.Browser',{
        override:'Ext.env.Browser',
        constructor:function() {
                    console.log('override!');
            this.callParent(arguments);
            if(document.documentMode) {
                for(int i=5;i<=this.maxIEVersion;i++) {
                    Ext['isIE'+i]=(document.documentMode==i);
                    Ext['isIE'+i+'p']=(document.documentMode>=i);
                    Ext['isIE'+i+'m']=(document.documentMode<=i);
                }
            }
        }
    })
    but the override is not used.

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report. Unfortunately, IE compatibility modes are not supported in Ext JS.

  3. #3
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    324

    Default

    So you are selling Sencha to corporate for their intranet applications but you do not support a basic thing they always need in their intranet?

    Once again: WTF!?

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    Please post a relevant test case, it seems as though there may be an issue with your environment. So if we can run the same thing, we can establish whether this the case,
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    324

    Default

    Hello Evan,

    I was able to reproduce the very same issue in Kitchen Sink, by using Emulation from the IE browser console.

    https://i.imgur.com/f5POhZ1.png
    https://i.imgur.com/jHOQD9K.png
    https://i.imgur.com/Xi9D4Iw.png

    If that does not suffice, I need a bit of time to come up with a full test case.

    Kind regards,

    Alexander

  6. #6
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    I'm not really clear, why are you setting the document mode to 7? How do you end up in a scenario where that is set?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  7. #7
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    324

    Default

    This value can be set via the GPO, Use Policy List of Windows Internet Explorer 7 sites

    https://technet.microsoft.com/en-us/...lity-with-ie11

    If there is a single legacy application on a server, the server has to be added to the Compatibility List for the legacy app to work. The ExtJS application on the same server then has to adapt.

    Furthermore, if you set the compatibility view value, but you use documentMode 10, ExtJS works and correctly detects IE 10.
    https://i.imgur.com/r5wJSEu.png
    https://i.imgur.com/PLCBj5F.png

    The reason why it does not work with IE 11 is because the code was not correctly adapted when IE 11 support was added.

    E.g. in this code - the conditions always end in !== 10, missing !== 11:
    Code:
                if (mode === 7 || (majorVer === 7 && mode !== 8 && mode !== 9 && mode !== 10)) {
                    majorVer = 7;
                } else if (mode === 8 || (majorVer === 8 && mode !== 8 && mode !== 9 && mode !== 10)) {
                    majorVer = 8;
                } else if (mode === 9 || (majorVer === 9 && mode !== 7 && mode !== 8 && mode !== 10)) {
                    majorVer = 9;
                } else if (mode === 10 || (majorVer === 10 && mode !== 7 && mode !== 8 && mode !== 9)) {
                    majorVer = 10;
                } else if (mode === 11 || (majorVer === 11 && mode !== 7 && mode !== 8 && mode !== 9 && mode !== 10)) {
                    majorVer = 11;
                }
    On a side note, I'd like to point out that when documentMode is numeric and higher than majorVer, you can safely set majorVer = documentMode. No need to use this ultra-long if...else if...else if...else condition, that has to be amended for every version of IE.

  8. #8
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748

    Default

    Hi Alexander,

    Thanks for the details and explanation on the difference of this mode vs the old (unsupported) Compatibility Modes of IE.

    To confirm, the logic below (from your override) replacing the if-cascade in packages/core/src/env/Browser.js would resolve this in your case:

    Code:
            if (me.is.IE) {
                majorVer = document.documentMode || parseInt(majorVer, 10);
    
                for (i = 7; i <= 11; ++i) {
                    prefix = 'isIE' + i;
                    
                    Ext[prefix] = majorVer === i;
                    Ext[prefix + 'm'] = majorVer <= i;
                    Ext[prefix + 'p'] = majorVer >= i;
                }
            }
    ?

    Thanks!
    Don
    Don Griffin

    "Use the source, Luke!"

  9. #9
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    324

    Default

    Yes, it does.

Similar Threads

  1. [OPEN] Desktop Packager for Touch? Override UserAgent value.
    By dave_aps in forum Desktop Packager
    Replies: 6
    Last Post: 1 May 2013, 9:51 AM
  2. Sencha Touch 2.1 infinite loading screen if UserAgent is set to iOS
    By Ullrich in forum Sencha Touch 2.x: Discussion
    Replies: 1
    Last Post: 14 Dec 2012, 5:35 AM
  3. Sencha GXT does not respect doc.documentMode
    By Jaro in forum Community Discussion
    Replies: 0
    Last Post: 5 Jun 2012, 12:37 AM
  4. Replies: 3
    Last Post: 13 Oct 2009, 4:17 AM
  5. Replies: 2
    Last Post: 16 Jul 2009, 3:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •