Search code examples
javascripthtmlgoogle-chromechrome-datasaver

How to check whether Data Saver is on or not in Mobile Chrome Browser?


Website behaves differently when Data Saver option is on in Mobile Chrome Browser. What is the best way to determine whether Data Saver is enabled or not using JavaScript.


Solution

  • Now in 2018, official documentation is saying that you can detect data save option in JS like that:

    if ("connection" in navigator) {
        if (navigator.connection.saveData === true) {
            // Implement data saving operations here.
        }
    }