Now, finally after 12 years, when all the world is hopping into CSS3 media query and responsive design bandwagon a problem remains.
How one can know from Javascript which media queries are
present in HTML code: this should be simple element traversing, but are there smarter ways?
effective (query evaluates to true)
... so you can add special code paths to support mobile, tablets, etc. in Javascript code? Eventually one could write function isMobile() and use it as a flag for certain actions specific to small screen estate.
document.styleSheets[i].media[j]