0

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

$("#var2").css("move", - 44 + "deg")
dur
  • 15,689
  • 25
  • 79
  • 125
alberto
  • 29
  • 6
  • I would think no because xdotool only does what you can do with keyboard and mouse... it doesn't communicate directly with the browser... Maybe one work-around is to have it enter the Javascript into a hidden text field and use the evil eval() to execute it...! – TheStoryCoder Apr 19 '17 at 08:57
  • This sounds like an [XY Problem](https://mywiki.wooledge.org/XyProblem). What are you *really* trying to achieve here? It might be better to figure out a better way to approach the problem that your question attempts to solve. – ghoti Jan 20 '18 at 14:03

1 Answers1

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
Mochamad Arifin
  • 418
  • 5
  • 9