Class: Common::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(page, lib) ⇒ Loader

Returns a new instance of Loader.



7
8
9
10
11
# File 'lib/loader.rb', line 7

def initialize(page, lib)
  @page = page
  @lib = lib
  @loaded_top_level = false
end

Instance Method Details

#call(source, is_top_level = true) ⇒ Object



19
20
21
22
23
24
# File 'lib/loader.rb', line 19

def call(source, is_top_level = true)
  @page.execute_script source unless (@loaded_top_level and is_top_level)
  set_allowed_origins
  Common::Hooks.run_after_load @lib
  load_into_iframes(source) unless Axe::Configuration.instance.skip_iframes
end

#load_top_level(source) ⇒ Object



13
14
15
16
17
# File 'lib/loader.rb', line 13

def load_top_level(source)
  @page.execute_script source
  @loaded_top_level = true
  Common::Hooks.run_after_load @lib
end