JS库来模拟Internet Explorer? [英] JS library to simulate Internet Explorer?

查看:160
本文介绍了JS库来模拟Internet Explorer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一些JS库来模拟Webkit中的IE吗?例如:IE8目前不支持 border-radius (可能在IE10上)。所以我运行一个JS库,检查我是否使用 border-radius 然后删除它类似于IE vision。



这是一个疯狂的想法,我知道,但在IE上的工作太慢,如果我可以在Webkit上模拟它,将是伟大的!

注意:我知道存在Chrome扩展程序以创建IE选项卡,但是提案是不同的:我需要在Webkit上运行,但消除了IE不支持的功能。



Edit1 :我正在使用一个基于Webkit的IDE到开发人员HTML模板。基本上,我需要一个模拟IE视图版本的按钮,而不需要安装IE(Mac,Linux)。将有趣的是有一个Mozilla模拟器,例如。基本上我会为每个浏览器生成一个CSS文件。例如: -webkit 属性不会包括在MSIE CSS中。 filter 不会包含在Webkit CSS中(但可以模拟)。



因此,我将复制当前HTML页面,然后再应用一个JS方法,该方法将编辑或删除不支持的内容,使其类似于IE。如果IE8不支持 border-radius ,它会被删除,我会看到一个IE版本的页面。如果Mozilla不支持 -webkit-box-sizing ,如果disponible,它将被重命名为 -moz-box-sizing

解决方案

我知道没有脚本,坦率地说,我不期望看到任何时间,创建IE的支持在各种版本的浏览器的CSS的地形将是一个巨大的承诺。如果支持 _height 的未记录的黑客,这会进一步复杂的。



坦率地说,测试的最好方法你的网站在IE8是使用IE8 +。在IE8及以上版本中,Microsoft引入了浏览器仿真,允许您通过单个浏览器回退并模拟任意数量的IE版本 - 我每天使用这个版本,这是一个奇妙的功能。



在IE中,按F12打开开发人员工具,然后您可以将浏览器模式更改为IE8。不需要刷新,因为浏览器会自己处理。使用此方法,您可以通过单击按钮快速测试版本7至10(假设您正在从IE10测试)。



禁用CSS3



如果你想要做的是禁用CSS3功能,你可以使用 Strip Tease bookmarklet。这不是一个完全开发的解决方案,所以请记住,它不会处理像高级选择器等。


There are some JS library to simulate the IE in Webkit? For instance: IE8 doesn't support border-radius currently (maybe on IE10). So I run a JS library that check if I'm using the border-radius then remove it to make similar to IE vision.

It's a crazy idea, I know, but work on IE is too slow, and if I can simulate it on Webkit, will be great! I need do it to an own project too.

Note: I know that exists a Chrome extension to make a IE tab, but the proposal is different: I need run on Webkit, but eliminating features not supported on IE.

Edit1: I'm working on a Webkit based IDE to developer HTML templates. Basically I need a button that emulate the IE view version without need a IE installed too (Mac, Linux for instance). Will be interesting have a Mozilla emulator too, for instance. Basically I will generate a CSS file to each browser too. For instance: -webkit properties not will be included to MSIE CSS. filter not will be included in Webkit CSS (but can be emulated).

So, I'll make a copy of current HTML page before apply a JS method that will edit or delete the unsupported content, make it similar to IE. If IE8 not support border-radius, it'll be removed and I'll see basically an IE version of page. If Mozilla not support -webkit-box-sizing it will be renamed to -moz-box-sizing if disponible.

解决方案

I know of no script, and frankly I don't expect to see one any time soon as the task of re-creating the topography of IE's support for CSS in various versions of the browser would be a massive undertaking. It would further complicate things if the undocumented hacks like _height were supported too.

Frankly, the best way to test your site in IE8 is to use IE8+. In versions IE8 and up Microsoft introduced Browser Emulation, permitting you to fallback and emulate any number of IE versions all from a single browser - I use this daily, and it's a fantastic feature.

Within IE, open up the Developer Tools by pressing F12 and from there you can change the Browser Mode to IE8. No refresh will be necessary as the browser will handle that on its own. Using this method you can quickly test versions 7 through 10 (assuming you're testing from IE10) with the click of a button.

Disabling CSS3

If all you would like to do is disable CSS3 features, you can use the Strip Tease bookmarklet. It's not a fully-developed solution, so keep in mind that it won't handle things like advanced selectors, etc.

这篇关于JS库来模拟Internet Explorer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆