From 2b2c5c6b6aeafdfa3434010bb450a53907eccd3d Mon Sep 17 00:00:00 2001 From: Mark Rickert Date: Tue, 18 Jun 2013 16:36:19 -0400 Subject: [PATCH] Helper method to evaluate a javascript string in WebScreen. --- lib/ProMotion/screen/web_screen_module.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ProMotion/screen/web_screen_module.rb b/lib/ProMotion/screen/web_screen_module.rb index f085bfb..75d06a7 100644 --- a/lib/ProMotion/screen/web_screen_module.rb +++ b/lib/ProMotion/screen/web_screen_module.rb @@ -77,6 +77,10 @@ module ProMotion self.webview.stringByEvaluatingJavaScriptFromString("document.body.innerHTML") end + def evaluate(js) + self.webview.stringByEvaluatingJavaScriptFromString(js) + end + # Navigation def can_go_back; web.canGoBack; end def can_go_forward; web.canGoForward; end