css_browser_selector
css_browser_selector copied to clipboard
Hi using IE 11.0.9 and its showing Red (win 7 64bit)
your page say should be Yellow ?
Me to ... the same issue on two different PCs. If you are running windoz and ie, it adds .gecko to the html tag, not .ie
Damn. it's this shit: http://www.nczonline.net/blog/2013/07/02/internet-explorer-11-dont-call-me-ie
I've been detecting IE11 using this conditional (jQuery, but could be converted to raw JS):
if ( Object.hasOwnProperty.call(window, "ActiveXObject") && !window.ActiveXObject ) {
jQuery('html').addClass('ie ie11');
}
I fixed it by detecting the Trident token. Forked the repo here: https://github.com/jl2035/css_browser_selector
I will try to add a special ie 11 detection, distinguishable from other ie versions.
@jl2035 On line 111, update your repo to:
(is('windows nt 6.3')?' win8.1'
:is('windows nt 6.2')?' win8'
Should give you the matching set.
Actually, you'll want all of this:
(!(/opera|webtv/i.test(ua))&&/msie\s(\d+)/.test(ua))?('ie ie'+(/trident\/7\.0/.test(ua) ? '11' : RegExp.$1))
:is (!(/opera|webtv/i.test(ua))&&/msie\s(\d+)/.test(ua))?('ie ie'+(/trident\/6\.0/.test(ua) ? '10' : RegExp.$1))
:is (!(/opera|webtv/i.test(ua))&&/msie\s(\d+)/.test(ua))?('ie ie'+(/trident\/5\.0/.test(ua) ? '9' : RegExp.$1))
:is (!(/opera|webtv/i.test(ua))&&/msie\s(\d+)/.test(ua))?('ie ie'+(/trident\/4\.0/.test(ua) ? '8' : RegExp.$1))
~~Although my script still tags IE6 as both 6 and 7.... debugging~~
All good actually, was an unrelated mistake.
Updated. Thanks.
It's been a while.. is my repo still relevant?
In a Modernizr era, people are obviously encouraged to use feature detection. I can see how that would make the repo seem irrelevant.
I updated it because my client has a product which, put simply, they don't intend to ever fix for IE. It happens to work on IE11 though. The marketing team wanted a way to politely disable the submission form and ask IE 5-10 users to download an alternate browser. A standard IE conditional comment seemed messy compared with .ie11 .selector {display: inherit}, or the ability to disable a field via jQuery based on .hasClass.
So the entire script isn't something I use very often - but in special circumstances, it beats writing up my own regex test.
It can also be useful for resolving typography differences between Firefox/IE and Webkit on Windows when the grid is highly specific.
On Wed, Dec 3, 2014 at 1:58 PM, p2035e [email protected] wrote:
Updated. Thanks.
It's been a while.. is my repo still relevant?
— Reply to this email directly or view it on GitHub.
Whoops, I thought that was the OP. Neevermind. Feel free to merge the rest of my changes. https://github.com/isarmstrong/css_browser_selector
Oh. But my repo was created just beacuse of ie11 issue. This is fixed in your repo by now, if I understand correctly. So yeah.. mine is irelevant, I think.
I guess I will just delete..
Yeah I added support for all missing IE versions, Win 8.1, and a new index.html that tests the user's browser + lists classes applied. It should really be merged in here.
Rafel is still around and very active on Github. I have to assume he is waiting for this project to die. Unfortunately, there are still times when detecting a browser is useful.
On Wed, Dec 3, 2014 at 3:40 PM, p2035e [email protected] wrote:
Oh. But my repo was created just beacuse of ie11 issue. This is fixed in your repo by now, if I understand correctly. So yeah.. mine is irelevant, I think.
I guess I will just delete..
— Reply to this email directly or view it on GitHub https://github.com/rafaelp/css_browser_selector/issues/30#issuecomment-65512938 .