是否可以使用xdotool输入Web控制台命令? [英] Is it possible to use xdotool to enter a web console command?

查看:71
本文介绍了是否可以使用xdotool输入Web控制台命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用xdotool输入Web控制台命令,例如以下命令:

Is it possible to use xdotool to enter a web console command like this command:

$("#var2").css("move", - 44 + "deg")

推荐答案

可以,您可以使用Web控制台或地址栏.通过此步骤:

Yes is possible, you can use web console or address bar. with this step:

  • 关注浏览器
  • 按F12
  • 类型代码

使用Web控制台的示例xdotool脚本:

this example xdotool script using web console:

search --sync --onlyvisible --name "chrome"
windowactivate --sync
keydown F12
sleep 1
type --clearmodifiers --delay 10 --args 1 "document.getElementsByTagName('body')[0].style.backgroundColor = 'green'"
sleep 1
key Return
sleep 0.5
key F12

将脚本另存为"xdt.txt",并使用xdotool运行它

save script as 'xdt.txt', run it with xdotool

xdotool - < xdt.txt

这篇关于是否可以使用xdotool输入Web控制台命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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