GithubHelp home page GithubHelp logo

Comments (7)

triblondon avatar triblondon commented on May 9, 2024

Good point. Seems switching in and out of compatibility mode changes the UA, so that would be supported, but document mode doesn't, so isn't. Would be interested to hear about possible implications of that and any workarounds you can suggest.

Hi, by the way.

from polyfill-service.

tmaslen avatar tmaslen commented on May 9, 2024

Hello :-)

DocumentMode is detectable in the DOM, we do this...

var browserType;
if ('querySelector' in document && 'localStorage' in window && 'addEventListener' in window) {
    browserType = 'html5';
}
else if (
    (document.documentMode && (document.documentMode < 9)) ||
    (/MSIE (7)/.test(navigator.userAgent))
) {
    browserType = 'legacyie';
}

We load in a slightly different JS app if its legacy IE.

It's an adaptation of our original CTM but for the interactive specials content I mostly work on now.

/t

from polyfill-service.

triblondon avatar triblondon commented on May 9, 2024

OK, so if you cared about that, you could sniff those things and then set the UA query param. Otherwise all we have to go on is the user agent header sent by the browser.

from polyfill-service.

tmaslen avatar tmaslen commented on May 9, 2024

Yes that would work. DocumentMode is definitely an edge case and causes IEs to behave strangely. I've stopped using conditional comments because of it as they stop reporting accurately too.

from polyfill-service.

triblondon avatar triblondon commented on May 9, 2024

Would you consider using this service?

from polyfill-service.

tmaslen avatar tmaslen commented on May 9, 2024

I can't speak for the whole of BBC News and I'd have to look at it more but it does sound like we're trying to address similar issues as the FT.com right now. We'll need to support at least IE8 with all of our modern JS. Speak with John Cleveley, he'll have a better idea of what is going on for the responsive news' support of IE8.

It's definitely something I'm considering for my bespoke interactives.

from polyfill-service.

triblondon avatar triblondon commented on May 9, 2024

Wilco. Closing this then - if we have problems in future because we need to deliver different polyfills to the same IE UA depending on what its documentMode is, we'll have to have another head-scratch.

from polyfill-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.