Index: tools/chrome_remote_control/chrome_remote_control/click_element.js |
diff --git a/tools/chrome_remote_control/chrome_remote_control/click_element.js b/tools/chrome_remote_control/chrome_remote_control/click_element.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cebdc51fee610669fb2001df7e1ea05ef0151f69 |
--- /dev/null |
+++ b/tools/chrome_remote_control/chrome_remote_control/click_element.js |
@@ -0,0 +1,18 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
nduca
2012/11/07 04:13:49
how about click_element_interaction.js? we'd of co
marja
2012/11/07 10:52:27
This file is removed, and I renamed the python fil
|
+ |
+// Inject this script on any page to click elements specified by a selector. |
+ |
+(function() { |
+ function clickElement(interaction) { |
nduca
2012/11/07 04:13:49
I'm kind of skeptical why youre even injecting jav
marja
2012/11/07 10:52:27
Ok, this makes sense since the abstraction "all in
|
+ var element = document.querySelector(interaction['selector']); |
+ if (element) { |
+ element.click(); |
+ return true; |
+ } |
+ return false; |
+ } |
+ |
+ window.__clickElement = clickElement; |
+})(); |