From 24d7eccfe1ef8db2f20cdf6b31d6dcc4567172fa Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 26 Nov 2012 16:35:28 -0500 Subject: [PATCH] add cool splash screen --- lib/persistent_selenium/browser.rb | 42 +++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/persistent_selenium/browser.rb b/lib/persistent_selenium/browser.rb index ada1beb..e9c8eba 100644 --- a/lib/persistent_selenium/browser.rb +++ b/lib/persistent_selenium/browser.rb @@ -1,5 +1,6 @@ require 'capybara' require 'capybara/selenium/driver' +require 'base64' module PersistentSelenium class Browser < Capybara::Selenium::Driver @@ -26,7 +27,7 @@ module PersistentSelenium def set_app_host(host) @app_host = host - browser.navigate.to('about:blank') + browser.navigate.to("data:text/html;base64,#{Base64.encode64(starting_page)}") end def reset! @@ -40,6 +41,45 @@ module PersistentSelenium end end end + + def starting_page + <<-HTML + + + Persistent Selenium -- Starting up... + + + + + + + +
+

Persistent Selenium

+

Starting up...

+
+ + + HTML + end end end