1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Browser / Device Detection - Body Classes Added

Discussion in 'Free Divi Community Forum' started by Kenny H, Dec 12, 2022.

  1. Kenny H

    Kenny H New Member

    Hi, I'm curious to know if anyone has knowledge or links to any documentation that describes a bit more what Divi is doing to detect different browsers or platforms and add appropriate classes to the main 'body' tag?

    Specifically, I see a class of 'et_mobile_device' added when I'm inspecting as a 'mobile' device. But I'm trying to better understand how this is generated and mostly just how reliable it can be. Searching the interwebs for that class name doesn't really turn up anything. And it would be impossible to test enough different devices to see how reliably its implemented or how.

    I'm guessing there is some elaborate user agent detection going on behind the scenes?!? But as this can sometimes not be the most reliable feature, really wanting to know how well Divi's implementation is.

    The main reason for asking in this instance is that I have an embedded 'app' of sorts (its an HTML-based page that renders a nice eBook), via an iFrame, that displays a bit differently on mobile vs. desktop devices. But it's not entirely dependent on viewport width, so I can't just use typical min/max width-based media queries to target, especially when accounting for using a mobile device in landscape orientation. It's probably doing a similar sort of 'user agent sniffing' to serve up the different implementations.

    Thanks for any insight here or tips on where better to find this type of info.
     
    1. PRO MEMBER PERKS Divi Mini Cart Pro Plugin - Instantly add 3 different types of mini cart to your Divi site:Learn More