axe-core-api 4.6.0 → 4.6.1.pre.4dbab74

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: 3aab520a9802aec04f5a6b25c1659562aa524cea8d90433013d113db11cabef9
4
- data.tar.gz: d34fc0d83f208585ee5d6fa586639ac83027f3bf85ec79817fc00074772ec482
3
+ metadata.gz: c19428d49bde472439182b6fef875e3947a6e30928cb221ebdf08e81289b55b6
4
+ data.tar.gz: 9c98c5d635252b54c99ff688e37372a2f3543eb4f221a68e619ef588b7289e50
5
5
  SHA512:
6
- metadata.gz: 9a5f3fce4857eaf9e4855bb3f84553077737c4c9f37371c96b1d2945795170a3dbecf743ff5fd666e060dbccd72ba46c6b450331150144f52c2ae05c668787b3
7
- data.tar.gz: f7c0d32661a74860100f0cf080f93c4bb03c62f4c6b26ff6c7acb96c76ced119dddf66bcdc32a4fedaeb94787cbe3d409ef8940d03ae562178688c3a193ba828
6
+ metadata.gz: b9c1d9e1a3c5ffb4932daa669b025c333696d55f3688746d6001537daf093f7d522b10f9878d02a7b8e91718a2c9fda7977db39f4071320fd6e6e4a9ed94fcad
7
+ data.tar.gz: 88a3656c5b5e88da1e5ba33776aab0201f77d1abad54ca368cc40fa83ea3f36f8a3986e5af4c4dec31c6542f5c762422dcd7ca2cb84a49bd05d722e627377bd9
@@ -40,7 +40,7 @@ module Axe
40
40
  end
41
41
 
42
42
  def timestamp=(ts)
43
- timestamp = ts
43
+ @timestamp = ts
44
44
  end
45
45
 
46
46
 
data/lib/axe/api/run.rb CHANGED
@@ -36,9 +36,19 @@ module Axe
36
36
  partial_results = run_partial_recursive(page, @context, lib, true)
37
37
  throw partial_results if partial_results.respond_to?("key?") and partial_results.key?("errorMessage")
38
38
  results = within_about_blank_context(page) { |page|
39
+ partial_res_str = partial_results.to_json
40
+ size_limit = 20_000_000
41
+ while not partial_res_str.empty? do
42
+ chunk_size = size_limit
43
+ chunk_size = partial_res_str.length if chunk_size > partial_res_str.length
44
+ chunk = partial_res_str[0..chunk_size-1]
45
+ partial_res_str = partial_res_str[chunk_size..-1]
46
+ store_chunk page, chunk
47
+ end
48
+
39
49
  Common::Loader.new(page, lib).load_top_level Axe::Configuration.instance.jslib
40
50
  begin
41
- axe_finish_run page, partial_results
51
+ axe_finish_run page
42
52
  rescue
43
53
  raise StandardError.new "axe.finishRun failed. Please check out https://github.com/dequelabs/axe-core-gems/blob/develop/error-handling.md"
44
54
  end
@@ -138,12 +148,20 @@ module Axe
138
148
  return results
139
149
  end
140
150
 
141
- def axe_finish_run(page, partial_results)
151
+ def store_chunk(page, chunk)
152
+ script = <<-JS
153
+ const chunk = arguments[0];
154
+ window.partialResults ??= '';
155
+ window.partialResults += chunk;
156
+ JS
157
+ page.execute_script_fixed script, chunk
158
+ end
159
+ def axe_finish_run(page)
142
160
  script = <<-JS
143
- const partialResults = arguments[0];
161
+ const partialResults = JSON.parse(window.partialResults || '[]');
144
162
  return axe.finishRun(partialResults);
145
163
  JS
146
- page.execute_script_fixed script, partial_results
164
+ page.execute_script_fixed script
147
165
  end
148
166
 
149
167
  def axe_shadow_select(page, frame_selector)