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

Function _ec_replace

js/evercookie.js:90–109  ·  view source on GitHub ↗
(str, key, value)

Source from the content-addressed store, hash-verified

88 img.src = src;
89 }
90 function _ec_replace(str, key, value) {
91 if (str.indexOf("&" + key + "=") > -1 || str.indexOf(key + "=") === 0) {
92 // find start
93 var idx = str.indexOf("&" + key + "="),
94 end, newstr;
95 if (idx === -1) {
96 idx = str.indexOf(key + "=");
97 }
98 // find end
99 end = str.indexOf("&", idx + 1);
100 if (end !== -1) {
101 newstr = str.substr(0, idx) + str.substr(end + (idx ? 0 : 1)) + "&" + key + "=" + value;
102 } else {
103 newstr = str.substr(0, idx) + "&" + key + "=" + value;
104 }
105 return newstr;
106 } else {
107 return str + "&" + key + "=" + value;
108 }
109 }
110
111 function idb() {
112 if ('indexedDB' in window) {

Callers 1

EvercookieFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected