PluginProbe
Unique Headers / trunk
Unique Headers vtrunk
2.1.3 2.1 2.1.1 2.0.1 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1 1.2 1.2.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.7 1.3.8 1.3.9 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 All 54 releases
unique-headers / kill.js

kill.js in Unique Headers trunk, at kill.js

42 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Add/read cookie
3 *
4 * Based on code from
5 * http://www.quirksmode.org/js/cookies.html
6 */
7 function sdCreateCookie(name) {
8 var unix = Math.round(+new Date()/1000); // Current time in seconds
9 var expire = new Date(); // Current time in miliseconds
10 expire.setTime(expire.getTime()+(spam_destroyer.lifetime*1000)); // Cookie lifetime in seconds * 1000 miliseconds
11 var expires = "; expires="+expire.toUTCString();
12 document.cookie = name+"="+unix+expires+"; path=/";
13 }
14
15 function sdReadCookie(name) {
16 var nameEQ = name + "=";
17 var ca = document.cookie.split(';');
18 for(var i=0;i < ca.length;i++) {
19 var c = ca[i];
20 while (c.charAt(0)==' ') c = c.substring(1,c.length);
21 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
22 }
23 return null;
24 }
25
26 /**
27 * Set cookie if not exists
28 */
29 function sdCheckCookies() {
30 var x = sdReadCookie(spam_destroyer.key)
31 if (x) {
32 // If cookie is set, do nothing
33 } else {
34 sdCreateCookie(spam_destroyer.key);
35 }
36 }
37 sdCheckCookies();
38
39 // Replace hidden input field with key
40 try {
41 document.getElementById('killer_value').value = spam_destroyer.key;
42 } catch (e) {}