I'm dealing with the same challenge of detecting whether the browser is implementing data saving mode by using a proxy server, but that would include more than Opera Mini in Extreme mode. It would include UC Browser Mini for Android in Speed Mode (very popular in China, India and Indonesia) and Chrome for Android's Data Saver mode. Fortunately, this mode can now be turned off on all three browsers - though many people in the developing world can't afford to, which is probably why the option is so popular.
Dean Hume gives an example of how to detect if the user has turned data saver mode in any browser. But to get those request headers, you would need to use server side scripts, or in his example, a service worker, but not traditional Javascript.
This answer explains how to detect UC Browser Mini in Speed Mode.
Tiffany Brown's article on Dev.Opera, which @Jared Drake cited, does reluctantly recommend browser detection for Opera rather than feature detection. As Jared mentioned, you could use:
var isOperaMini = (navigator.userAgent.indexOf('Opera Mini') > -1);
var isOperaMini = Object.prototype.toString.call(window.operamini) === "[object OperaMini]"
But she lists some unsupported browser events that maybe you could sniff for, such as mousemove
or scroll
. And she has written a whole article on Viewing and Exporting Source in Opera Mini. She points out that Opera Mini, at least with the Extreme Data Saver mode, is actually displaying OPML instead of HTML.
Thankfully, Opera Mini offers the ability to inspect the current DOM
tree as rendered by Opera's proxy servers. Enter server:source
in the
Opera Mini address bar to view the source of the currently loaded
page.
You might see something in that source that would help your detection, though I didn't see it in mine.