Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE 11 - developer tools and detecting old IE browsers

I'm using IE11 now, I thought it would be nice to have some additional tools for web developing. I was always using these tags to detect old crappy IE browsers:

<!--[if lt IE 7]><html class="ie ie6 some-custom-class"><![endif]-->
<!--[if IE 7]><html class="ie ie7 some-custom-class"><![endif]-->
<!--[if IE 8]><html class="ie ie8 some-custom-class"><![endif]-->
<!--[if IE 9]><html class="ie ie9 some-custom-class"><![endif]-->
<!--[if gt IE 9]><html class="ie some-custom-class"><![endif]-->
<!--[if !IE]><!--><html class="some-custom-class"><!--<![endif]-->

I set IE11 to IE8-9 compatibility but it ignores the above tags. If there's no way to turn them ON then i don't understand why they made these tools -.-' Where is the logic ?

Anyway do I need to install win 7 only for IE 8-9 ?

http://www.browserstack.com < - I'd prefer client than remote access.

Is there something like patch for this "modern" browser to make developer tools usable ?

Or maybe there is another way to detect old browsers with a really lightweight script.

like image 898
Macko Tarana Avatar asked Nov 29 '13 11:11

Macko Tarana


People also ask

What are the Internet Explorer developer tools?

Previously known as the Internet Explorer Developer Toolbar, the tools were introduced as a toolbar for Internet Explorer 6 and 7. Later versions, such as Internet Explorer 8, have the developer tools built in.

Why are the DevTools not working in Internet Explorer 11?

If a tab is using IE mode, the DevTools do not work and the following conditions occur. If you select F12 or select Ctrl + Shift + I, a blank instance of the Microsoft Edge (Chromium) DevTools is launched displays the following message. Developer Tools are not available in Internet Explorer mode. To debug the page, open it in Internet Explorer 11.

What is Internet Explorer 11 (IE 11)?

Internet Explorer 11 is an updated version of the IE web browser developed by Microsoft. And if previous versions saw you move to other browsers, then this article will help you reconsider. The previous versions of Internet Explorer didn’t have a developer-friendly browser, but vast improvement can be seen in its latest version.

How to use IE Developer Tools to find errors quickly?

Apart from having coding expertise to write great web pages, you also require the right tools to help you find errors quickly. To access IE Developer Tools, you launch Internet Explorer and press F12 on your keyboard or select “F12 Developer Tools” on the “Tools” menu. This opens the developer tools inside the browser tab.


2 Answers

Conditional statements has been removed since IE10. But the developer tools of this version of IE still able to interprete them. Nevertheless, it isn't the case for the version of IE11. I don't know if it's possible to make back this feature. I guess no, anyway not for now I'm afraid. For me too, it's not logical. The emulation should support conditional statements. So, I think Microsoft will make a fix for that one day.

For the previous version of IE, you can install Windows 7 or use a WM. Make your own choice.

I confirm, that's right, you can use Modernizr to detect the browser.


Source : Conditional statements support by IE 11 and IE 10 Developer Tool
Support conditional comments by IE

like image 86
Wagner_SOFC Avatar answered Nov 01 '22 16:11

Wagner_SOFC


The easiest and simplest way I've found is to play with this tag in the HTML:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"

If you set the IE11 render mode to '8' and set the above to content="IE=8" you'll get a browser version that respects the conditional comments. I only use this for lightweight testing of CSS positioning, etc. It's still an inconvenience but it's not as bad as needing a half-dozen VMs.

I see @Lonard actually has this solution in the second link posted, but doesn't mention it in the answer. Unfortunately, "removing the dependency", which is the typical answer, isn't a solution when you have clients that insist your pages work in IE7 and IE7 doesn't understand what is now very basic CSS layout.

like image 28
rand'Chris Avatar answered Nov 01 '22 17:11

rand'Chris