Module: Harmony::Page::Window
Overview
Window factory
Constant Summary
- BASE_RUNTIME =
Cache the initial runtime. Parsing env.js (done automatically when Envjs::Runtime is extended) takes a while, so we only want to do this once.
Johnson::Runtime.new
Instance Method Summary (collapse)
Instance Method Details
- (Object) blank
33 34 35 |
# File 'lib/harmony/page.rb', line 33 def blank from_uri('about:blank') end |
- (Object) from_document(document)
28 29 30 31 |
# File 'lib/harmony/page.rb', line 28 def from_document(document) Tempfile.open('harmony') {|f| f << document; @path = f.path } from_uri("file://#{@path}") end |
- (Object) from_uri(uri)
24 25 26 |
# File 'lib/harmony/page.rb', line 24 def from_uri(uri) BASE_RUNTIME.evaluate("window.open('#{uri}')") end |