[英]How to use AutoIt to set Internet Explorer options?
I need to use AutoIt to change the emulation mode in Internet Explorer. 我需要使用AutoIt来更改Internet Explorer中的模拟模式。
Basically I need to open the "developer tools" (F12), change the document mode to emulate IE 10. 基本上我需要打开“开发人员工具”(F12),更改文档模式以模拟IE 10。
AutoIt is up and running in my IDE (Eclipse). AutoIt在我的IDE(Eclipse)中启动并运行。 I already can open IE, what are my doubts:
我已经可以打开IE,我有什么疑问:
I just created a new instance of AutoIt and know how to open 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");
}
}
I'd use keystrokes to do this: 我用键击来做到这一点:
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
I checked manually, this works on Explorer 11. The change is not very persistent though, watch for browser history resets etc ( http://appliedusers.ca/forums/index.php?topic=5330.0 ). 我手动检查,这适用于资源管理器11.虽然更改不是很持久,但请注意浏览器历史记录重置等( http://appliedusers.ca/forums/index.php?topic=5330.0 )。
References: 参考文献:
https://www.autoitscript.com/autoit3/docs/functions/Send.htm https://www.autoitscript.com/autoit3/docs/functions/Send.htm
https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.