axe-core-api 4.4.1 → 4.4.2.pre.0506e1f
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/axe/core.rb +7 -7
- data/lib/loader.rb +3 -2
- data/node_modules/axe-core/axe.min.js +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ad05e47d778d0560035d134a518d87b946289428026272b87edeef2b84f684e
|
4
|
+
data.tar.gz: 77dc6093d4916226609b24ce47e6f56d881c23a8c281e2e7313ba56cafb962d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c57795535c105c8653bdaef79fb9dedd99ae884086c1c83d3f0cc51ca7e6b9dee340275624b7114575ec4c9ffc5170fe7ccac09370daa39e8675477c4d3a1867
|
7
|
+
data.tar.gz: de4298e017c35d1fece22d9544c7364413c081a9583ab2d90e8cb4463aa3b781cb7573a2f177d7c83c2cf235124c08a3bfabf6d1f8bfc79e4fa8fcfa514f4424
|
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 = "<
|
29
|
-
allowed_origins = "<
|
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
|
|