如何使用 AutoIt 设置 Internet Explorer 选项?
How to use AutoIt to set Internet Explorer options?
我需要使用 AutoIt 更改 Internet Explorer 中的仿真模式。
基本上我需要打开 "developer tools" (F12),更改文档模式以模拟 IE 10。
AutoIt 已启动,运行 在我的 IDE (Eclipse) 中。我已经可以打开IE了,还有什么疑惑:
- 如何模拟打开调试选项?
- 如何更改仿真版本?
我刚刚创建了一个新的 AutoIt 实例并且知道如何打开 IE:
package autotioficial;
import java.io.File;
import com.jacob.com.LibraryLoader;
import autoitx4java.AutoItX;
public class App {
public static void main(String[] args) {
File file = new File("lib", "jacob-1.18-x86.dll"); //path to the jacob dll
System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
AutoItX x = new AutoItX();
x.run("C:/Program Files (x86)/Internet Explorer/iexplore.exe");
}
}
我会使用击键来执行此操作:
x.send("{F12}") //go to developer mode
x.send("^8") //control-8 to go to Emulation tab
x.send("{TAB}") //select the first field (Document mode)
x.send("10") //set emulated version to E10
我手动检查过,这适用于 Explorer 11。虽然更改不是很持久,但请注意浏览器历史记录重置等 (http://appliedusers.ca/forums/index.php?topic=5330.0)。
参考文献:
https://www.autoitscript.com/autoit3/docs/functions/Send.htm
https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm
我需要使用 AutoIt 更改 Internet Explorer 中的仿真模式。
基本上我需要打开 "developer tools" (F12),更改文档模式以模拟 IE 10。
AutoIt 已启动,运行 在我的 IDE (Eclipse) 中。我已经可以打开IE了,还有什么疑惑:
- 如何模拟打开调试选项?
- 如何更改仿真版本?
我刚刚创建了一个新的 AutoIt 实例并且知道如何打开 IE:
package autotioficial;
import java.io.File;
import com.jacob.com.LibraryLoader;
import autoitx4java.AutoItX;
public class App {
public static void main(String[] args) {
File file = new File("lib", "jacob-1.18-x86.dll"); //path to the jacob dll
System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
AutoItX x = new AutoItX();
x.run("C:/Program Files (x86)/Internet Explorer/iexplore.exe");
}
}
我会使用击键来执行此操作:
x.send("{F12}") //go to developer mode
x.send("^8") //control-8 to go to Emulation tab
x.send("{TAB}") //select the first field (Document mode)
x.send("10") //set emulated version to E10
我手动检查过,这适用于 Explorer 11。虽然更改不是很持久,但请注意浏览器历史记录重置等 (http://appliedusers.ca/forums/index.php?topic=5330.0)。
参考文献:
https://www.autoitscript.com/autoit3/docs/functions/Send.htm
https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm