Is it possible to use xdotool to enter a web console command?

怎甘沉沦 提交于 2021-02-08 11:56:49

问题


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

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

回答1:


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

  • Focus on Browser
  • press F12
  • Type code

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

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

xdotool - < xdt.txt


来源:https://stackoverflow.com/questions/43286199/is-it-possible-to-use-xdotool-to-enter-a-web-console-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!