axe-core-api 4.4.0.pre.f437c8e → 4.4.0.8fa09ad

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: 65bdbe2cbe9019fcc7fcfc6fdafba9feea853e1de9a485e95c328bbf5e61f637
4
- data.tar.gz: d4492b7b04f8fa87657b17530a2d9ac79a18b30f575770bf1ff11cf4d44c3507
3
+ metadata.gz: b308e111b8108d40533b23840643ecbc160f9435660c01fde2879b3f09a1c121
4
+ data.tar.gz: 756ec5214b9c7c19bc640dacf71e883469f873731046e8cfa40bf93ba8366764
5
5
  SHA512:
6
- metadata.gz: 98a4942e38ca0707680da9123f303c4be5827a9f2da117a16652120065a18ea190d32227f36b6c91e88676cf666dd261e04aa61fefbd9b98c322f2f7bb047a76
7
- data.tar.gz: 80d48c852f7b396d90a527b7614683f6e73511831c98274dab528e6bfaf07ab92aac062a4593414c905e5214ece7e0e19a7085a0150ce5fdf718c28975546bf1
6
+ metadata.gz: ea26aa294d433e92851590e3688d2ba5c7a11e8940ed37973dc50b9cc38d4340a79088f3b71ed004a71c8b58b90fac25f432d87991ee6a25874ef4f6c0729c49
7
+ data.tar.gz: 2d21e4046f519b7d34d24b30bca21e4d12ed2541522823d188331cdfc074aea57ad8369ab088d4902ec90275d63a295aab3bb127be39f4e468369b348bd8fe74
@@ -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