axe-core-api 4.3.2 → 4.4.0.pre.f5e246c

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5d787c229f75bd5281d30ab61093e906073960bf4a0ccc8a62cbf98eed602f8
4
- data.tar.gz: 9c1a5c4e3a0e82c408c62faa105b7912a4368f1bf9d392b23ad3c7e0f7bbf15f
3
+ metadata.gz: 449e4fcea2dd893dd0503e7951d609825ae463e6b13fd334e2dc125b498065be
4
+ data.tar.gz: 3e82af730b765f1bb5fba01a994b88d95c38e9023ec534a0a24a484dd9c0d27c
5
5
  SHA512:
6
- metadata.gz: b1f95c49a8cf4d149f805976a7f0ae0a2ea10e425d0e64f97abcc8b3caba59773729c8f092e1ec6daa8b251a8319fbfddb8369cdaba7d00a7fd991fc4515055f
7
- data.tar.gz: 788a484236564e382f27cd48ceff7e7b6b4468f8417b58fcd5ea0bde64e52fe68593b2acd8b2e0cdb114ee3ce2662d2f6b9ffd9ff724a8f75d25bf3a86a41e27
6
+ metadata.gz: 428d6218915cbf17dc582b9c7f31b13f1dbc73473d06111dba8df5023d699f72d2322560f68652989b1c24c29f750c5fc92e257f7caa0d6a4c035d790aeb0131
7
+ data.tar.gz: f7bda46ff4129ad7195e65f129a4fefea201956782f5950deaf7985e46f00b5a091a88791c46196991bd672b3893173627da8342398be5b2e470b708291abf55
@@ -3,7 +3,7 @@ require 'virtus'
3
3
  module Axe
4
4
  module API
5
5
  class ValueObject
6
- include ::Virtus.value_object mass_assignment: false, nullify_blank: true
6
+ include ::Virtus.value_object mass_assignment: false, nullify_blank: false
7
7
  end
8
8
  end
9
9
  end
data/lib/axe/core.rb CHANGED
@@ -25,10 +25,16 @@ module Axe
25
25
  callable.call @page
26
26
  end
27
27
 
28
+ def self.has_run_partial?(page)
29
+ page.evaluate_script <<-JS
30
+ typeof window.axe.runPartial === 'function'
31
+ JS
32
+ end
33
+
28
34
  private
29
35
 
30
36
  def use_run_partial
31
- has_run_partial? and not Axe::Configuration.instance.legacy_mode
37
+ Core.has_run_partial?(@page) and not Axe::Configuration.instance.legacy_mode
32
38
  end
33
39
 
34
40
  def load_axe_core(source)
@@ -40,12 +46,6 @@ module Axe
40
46
  loader.call source
41
47
  end
42
48
 
43
- def has_run_partial?
44
- @page.evaluate_script <<-JS
45
- typeof window.axe.runPartial === 'function'
46
- JS
47
- end
48
-
49
49
  def already_loaded?
50
50
  @page.evaluate_script <<-JS
51
51
  window.#{JS_NAME} &&
data/lib/loader.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require_relative "./axe/configuration"
2
+ require_relative "./axe/core"
2
3
  require_relative "./hooks"
3
4
 
4
5
  module Common
@@ -25,8 +26,8 @@ module Common
25
26
  private
26
27
 
27
28
  def set_allowed_origins
28
- allowed_origins = "<unsafe_all_origins>"
29
- allowed_origins = "<same_origin>" if Axe::Configuration.instance.legacy_mode
29
+ allowed_origins = "<same_origin>"
30
+ allowed_origins = "<unsafe_all_origins>" if !Axe::Configuration.instance.legacy_mode && !Axe::Core::has_run_partial?(@page)
30
31
  @page.execute_script "axe.configure({ allowedOrigins: ['#{allowed_origins}'] });"
31
32
  end
32
33