MCPcopy Index your code
hub / github.com/samyk/evercookie / create_request

Function create_request

js/evercookie.js:154–174  ·  view source on GitHub ↗
(i, src, callback)

Source from the content-addressed store, hash-verified

152 var working = false;
153
154 function create_request(i, src, callback){
155 var img = document.createElement('img');
156 img.src = src + '#' + parseInt(Math.random()*32000); // prevent caching
157 img.onload = function(){
158 fields[i] = true;
159 remaining -= 1;
160 if(remaining <= 0){
161 working = false;
162 callback(fields);
163 }
164 };
165 img.onerror = function(){
166 fields[i] = false;
167 remaining -= 1;
168 if(remaining <= 0){
169 working = false;
170 callback(fields);
171 }
172 };
173 return img;
174 }
175 function pad(value, length) {
176 return (value.toString().length < length) ? pad("0"+value, length):value;
177 }

Callers 1

HSTS_CookieFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected