Spaces:
Running
Running
Upload 45 files
Browse files- .gitignore +5 -0
- ChangeLog +30 -0
- assets/EvercookieCacheServlet.java +80 -0
- assets/EvercookieEtagServlet.java +79 -0
- assets/EvercookiePngServlet.java +95 -0
- assets/evercookie.fla +0 -0
- assets/evercookie.jar +0 -0
- assets/evercookie.jnlp +23 -0
- assets/evercookie.swf +0 -0
- assets/evercookie.xap +0 -0
- assets/evercookie_sl/evercookie.sln +20 -0
- assets/evercookie_sl/evercookie.suo +0 -0
- assets/evercookie_sl/evercookie/App.xaml +8 -0
- assets/evercookie_sl/evercookie/App.xaml.cs +82 -0
- assets/evercookie_sl/evercookie/Bin/Debug/AppManifest.xaml +5 -0
- assets/evercookie_sl/evercookie/Bin/Debug/evercookie.dll +0 -0
- assets/evercookie_sl/evercookie/Bin/Debug/evercookie.pdb +0 -0
- assets/evercookie_sl/evercookie/Bin/Debug/evercookie.xap +0 -0
- assets/evercookie_sl/evercookie/Bin/Debug/evercookieTestPage.html +73 -0
- assets/evercookie_sl/evercookie/MainPage.xaml +11 -0
- assets/evercookie_sl/evercookie/MainPage.xaml.cs +67 -0
- assets/evercookie_sl/evercookie/Properties/AppManifest.xml +6 -0
- assets/evercookie_sl/evercookie/Properties/AssemblyInfo.cs +35 -0
- assets/evercookie_sl/evercookie/evercookie.csproj +111 -0
- assets/evercookie_sl/evercookie/evercookie.csproj.user +29 -0
- assets/evercookie_sl/evercookie/obj/Debug/App.g.cs +53 -0
- assets/evercookie_sl/evercookie/obj/Debug/App.g.i.cs +53 -0
- assets/evercookie_sl/evercookie/obj/Debug/DesignTimeResolveAssemblyReferences.cache +0 -0
- assets/evercookie_sl/evercookie/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache +0 -0
- assets/evercookie_sl/evercookie/obj/Debug/MainPage.g.cs +56 -0
- assets/evercookie_sl/evercookie/obj/Debug/MainPage.g.i.cs +56 -0
- assets/evercookie_sl/evercookie/obj/Debug/XapCacheFile.xml +4 -0
- assets/evercookie_sl/evercookie/obj/Debug/evercookie.csproj.FileListAbsolute.txt +12 -0
- assets/evercookie_sl/evercookie/obj/Debug/evercookie.dll +0 -0
- assets/evercookie_sl/evercookie/obj/Debug/evercookie.g.resources +0 -0
- assets/evercookie_sl/evercookie/obj/Debug/evercookie.pdb +0 -0
- css/master.css +229 -0
- index.html +269 -0
- js/evercookie.js +1293 -0
- js/swfobject-2.2.min.js +4 -0
- php/_cookie_name.php +14 -0
- php/evercookie_cache.php +25 -0
- php/evercookie_etag.php +59 -0
- php/evercookie_png.php +59 -0
- php/hsts_cookie.php +35 -0
.gitignore
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
evercookie.min.js
|
2 |
+
.settings
|
3 |
+
.project
|
4 |
+
.idea
|
5 |
+
*.iml
|
ChangeLog
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gabrielbauman/evercookie master :: as of now
|
2 |
+
- updated README.md (gabrielbauman)
|
3 |
+
- added .gitignore (gabrielbauman)
|
4 |
+
- fixed cookie domain on non-standard ports (gabrielbauman)
|
5 |
+
- removed evercookie.min.js to simplify merges (gabrielbauman)
|
6 |
+
- added domains to standard http cookies (Justin)
|
7 |
+
- added Java servlet port of PHP components (gabrielbauman)
|
8 |
+
- added Java applet persistence method, see http://github.com/gabrielbauman/evercookie-applet (gabrielbauman)
|
9 |
+
- disabled Silverlight auto-upgrade interruption (gabrielbauman)
|
10 |
+
- fixed Silverlight object appearing on screen (gabrielbauman)
|
11 |
+
- disabled Install Silverlight link (gabrielbauman)
|
12 |
+
- removed duplicate/unused evercookie.php (gabrielbauman)
|
13 |
+
- removed last remaining dependency on jQuery (gabrielbauman)
|
14 |
+
- added README.md (gabrielbauman)
|
15 |
+
|
16 |
+
evercookie 0.4 :: 10/13/2010
|
17 |
+
- added Silverlight Isolated Storage support
|
18 |
+
- added window.name storage support
|
19 |
+
- added standard cache support
|
20 |
+
- fixed some IE bugs
|
21 |
+
- fixed LSO bug so data is retrieved on first request
|
22 |
+
- fixed bug with PNG support
|
23 |
+
- fixed bug where null/empty values would reset others
|
24 |
+
|
25 |
+
evercookie 0.3 :: 09/23/2010
|
26 |
+
- added ETag storage support
|
27 |
+
- added IE userData storage support
|
28 |
+
- added jquery
|
29 |
+
- various bug fixes
|
30 |
+
- speed enhancements
|
assets/EvercookieCacheServlet.java
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
package evercookie;
|
2 |
+
|
3 |
+
import java.io.IOException;
|
4 |
+
|
5 |
+
import javax.servlet.ServletException;
|
6 |
+
import javax.servlet.ServletOutputStream;
|
7 |
+
import javax.servlet.annotation.WebServlet;
|
8 |
+
import javax.servlet.http.Cookie;
|
9 |
+
import javax.servlet.http.HttpServlet;
|
10 |
+
import javax.servlet.http.HttpServletRequest;
|
11 |
+
import javax.servlet.http.HttpServletResponse;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* This is a Java Servlet port of evercookie_cache.php, the server-side
|
15 |
+
* component of Evercookie's cacheData mechanism.
|
16 |
+
*
|
17 |
+
* Install this servlet at /evercookie_cache.php in your web.xml (or add a @WebServlet
|
18 |
+
* annotation) and you won't even need to modify evercookie.js! This assumes
|
19 |
+
* that Evercookie's assets are in your web root.
|
20 |
+
*
|
21 |
+
* Of course, if you have set $_ec_baseurl to something, you should install this
|
22 |
+
* at [$_ec_baseurl]evercookie_cache.php. Remember, $ec_baseurl needs a trailing
|
23 |
+
* slash in the evercookie.js.
|
24 |
+
*
|
25 |
+
* @author Gabriel Bauman <[email protected]>
|
26 |
+
*
|
27 |
+
*/
|
28 |
+
public class EvercookieCacheServlet extends HttpServlet {
|
29 |
+
|
30 |
+
private static final long serialVersionUID = 1L;
|
31 |
+
|
32 |
+
public EvercookieCacheServlet() {
|
33 |
+
super();
|
34 |
+
}
|
35 |
+
|
36 |
+
@Override
|
37 |
+
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
38 |
+
|
39 |
+
boolean cookieExists = false;
|
40 |
+
String cookieValue = null;
|
41 |
+
Cookie[] cookies = req.getCookies();
|
42 |
+
|
43 |
+
if (null != cookies) {
|
44 |
+
// Iterate over cookies until we find one named evercookie_cache
|
45 |
+
for (Cookie cookie : cookies)
|
46 |
+
{
|
47 |
+
if (cookie.getName().equals("evercookie_cache")) {
|
48 |
+
cookieExists = true;
|
49 |
+
cookieValue = cookie.getValue();
|
50 |
+
break;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
// If the cookie doesn't exist, send 304 Not Modified and exit.
|
56 |
+
if (!cookieExists) {
|
57 |
+
resp.setStatus(304);
|
58 |
+
return;
|
59 |
+
}
|
60 |
+
|
61 |
+
// The cookie was present; set up the response headers.
|
62 |
+
resp.setContentType("text/html");
|
63 |
+
resp.addHeader("Last-Modified", "Wed, 30 Jun 2010 21:36:48 GMT");
|
64 |
+
resp.addHeader("Expires", "Tue, 31 Dec 2030 23:30:45 GMT");
|
65 |
+
resp.addHeader("Cache-Control", "private, max-age=630720000");
|
66 |
+
|
67 |
+
// Print the contents of the cookie as the response body.
|
68 |
+
ServletOutputStream body = resp.getOutputStream();
|
69 |
+
|
70 |
+
try {
|
71 |
+
body.print(cookieValue);
|
72 |
+
} finally {
|
73 |
+
body.close();
|
74 |
+
}
|
75 |
+
|
76 |
+
// And we're done.
|
77 |
+
resp.setStatus(200);
|
78 |
+
resp.flushBuffer();
|
79 |
+
}
|
80 |
+
}
|
assets/EvercookieEtagServlet.java
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
package evercookie;
|
2 |
+
|
3 |
+
import java.io.IOException;
|
4 |
+
|
5 |
+
import javax.servlet.ServletException;
|
6 |
+
import javax.servlet.ServletOutputStream;
|
7 |
+
import javax.servlet.annotation.WebServlet;
|
8 |
+
import javax.servlet.http.Cookie;
|
9 |
+
import javax.servlet.http.HttpServlet;
|
10 |
+
import javax.servlet.http.HttpServletRequest;
|
11 |
+
import javax.servlet.http.HttpServletResponse;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* This is a Java Servlet port of evercookie_etag.php, the server-side component
|
15 |
+
* of Evercookie that uses the If-None-Match and Etag headers to keep track of
|
16 |
+
* persistent values.
|
17 |
+
*
|
18 |
+
* Install this servlet at /evercookie_etag.php in your web.xml (or add a @WebServlet
|
19 |
+
* annotation) and you won't even need to modify evercookie.js! This assumes
|
20 |
+
* that Evercookie's assets are in your web root.
|
21 |
+
*
|
22 |
+
* Of course, if you have set $_ec_baseurl to something, you should install this
|
23 |
+
* at [$_ec_baseurl]evercookie_etag.php. Remember, $ec_baseurl needs a trailing
|
24 |
+
* slash in the evercookie.js.
|
25 |
+
*
|
26 |
+
* @author Gabriel Bauman <[email protected]>
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
public class EvercookieEtagServlet extends HttpServlet {
|
30 |
+
|
31 |
+
private static final long serialVersionUID = 1L;
|
32 |
+
|
33 |
+
public EvercookieEtagServlet() {
|
34 |
+
super();
|
35 |
+
}
|
36 |
+
|
37 |
+
@Override
|
38 |
+
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
39 |
+
|
40 |
+
boolean cookieExists = false;
|
41 |
+
String cookieValue = null;
|
42 |
+
Cookie[] cookies = req.getCookies();
|
43 |
+
|
44 |
+
if (null != cookies) {
|
45 |
+
// Iterate over cookies until we find one named evercookie_etag
|
46 |
+
for (Cookie cookie : cookies)
|
47 |
+
{
|
48 |
+
if (cookie.getName().equals("evercookie_etag")) {
|
49 |
+
cookieExists = true;
|
50 |
+
cookieValue = cookie.getValue();
|
51 |
+
break;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
ServletOutputStream body = resp.getOutputStream();
|
57 |
+
|
58 |
+
try {
|
59 |
+
|
60 |
+
if (cookieExists) {
|
61 |
+
// Cookie set; send cookie value as Etag header/response body.
|
62 |
+
resp.addHeader("Etag", cookieValue);
|
63 |
+
body.print(cookieValue);
|
64 |
+
}
|
65 |
+
else
|
66 |
+
{
|
67 |
+
// No cookie; set the body to the request's If-None-Match value.
|
68 |
+
body.print(req.getHeader("If-None-Match"));
|
69 |
+
}
|
70 |
+
|
71 |
+
} finally {
|
72 |
+
// close the output stream.
|
73 |
+
body.close();
|
74 |
+
}
|
75 |
+
|
76 |
+
resp.setStatus(200);
|
77 |
+
|
78 |
+
}
|
79 |
+
}
|
assets/EvercookiePngServlet.java
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
package evercookie;
|
2 |
+
|
3 |
+
import java.awt.Color;
|
4 |
+
import java.awt.RenderingHints;
|
5 |
+
import java.awt.image.BufferedImage;
|
6 |
+
import java.io.IOException;
|
7 |
+
import java.io.OutputStream;
|
8 |
+
|
9 |
+
import javax.imageio.ImageIO;
|
10 |
+
import javax.servlet.ServletException;
|
11 |
+
import javax.servlet.annotation.WebServlet;
|
12 |
+
import javax.servlet.http.Cookie;
|
13 |
+
import javax.servlet.http.HttpServlet;
|
14 |
+
import javax.servlet.http.HttpServletRequest;
|
15 |
+
import javax.servlet.http.HttpServletResponse;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* This is a Java Servlet port of evercookie_png.php, the server-side component
|
19 |
+
* of Evercookie that stores values in force-cached PNG image data.
|
20 |
+
*
|
21 |
+
* Install this servlet at /evercookie_png.php in your web.xml (or add a @WebServlet
|
22 |
+
* annotation) and you won't even need to modify evercookie.js! This assumes
|
23 |
+
* that Evercookie's assets are in your web root.
|
24 |
+
*
|
25 |
+
* Of course, if you have set $_ec_baseurl to something, you should install this
|
26 |
+
* at [$_ec_baseurl]evercookie_png.php. Remember, $ec_baseurl needs a trailing
|
27 |
+
* slash in the evercookie.js.
|
28 |
+
*
|
29 |
+
* @author Gabriel Bauman <[email protected]>
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
public class EvercookiePngServlet extends HttpServlet {
|
33 |
+
|
34 |
+
private static final long serialVersionUID = 1L;
|
35 |
+
|
36 |
+
public EvercookiePngServlet() {
|
37 |
+
super();
|
38 |
+
}
|
39 |
+
|
40 |
+
@Override
|
41 |
+
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
42 |
+
|
43 |
+
boolean cookieExists = false;
|
44 |
+
String cookieValue = null;
|
45 |
+
Cookie[] cookies = req.getCookies();
|
46 |
+
|
47 |
+
if (null != cookies) {
|
48 |
+
// Iterate over cookies until we find one named evercookie_png
|
49 |
+
for (Cookie cookie : cookies)
|
50 |
+
{
|
51 |
+
if (cookie.getName().equals("evercookie_png")) {
|
52 |
+
cookieExists = true;
|
53 |
+
cookieValue = cookie.getValue();
|
54 |
+
break;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
// If the cookie doesn't exist, send 304 Not Modified and exit.
|
60 |
+
if (!cookieExists) {
|
61 |
+
resp.setStatus(304);
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
+
// Generate a PNG image from the cookie value.
|
66 |
+
BufferedImage image = new BufferedImage(200, 1, BufferedImage.TYPE_INT_ARGB);
|
67 |
+
image.createGraphics().setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
|
68 |
+
int x = 0;
|
69 |
+
|
70 |
+
for (int i = 0; i < cookieValue.length(); i += 3) {
|
71 |
+
// Treat every 3 chars of the cookie value as an {R,G,B} triplet.
|
72 |
+
Color c = new Color(cookieValue.charAt(i), cookieValue.charAt(i + 1), cookieValue.charAt(i + 2));
|
73 |
+
image.setRGB(x++, 0, c.getRGB());
|
74 |
+
}
|
75 |
+
|
76 |
+
// The cookie was present; set up the response headers.
|
77 |
+
resp.setContentType("image/png");
|
78 |
+
resp.addHeader("Last-Modified", "Wed, 30 Jun 2010 21:36:48 GMT");
|
79 |
+
resp.addHeader("Expires", "Tue, 31 Dec 2033 23:30:45 GMT");
|
80 |
+
resp.addHeader("Cache-Control", "private, max-age=630720000");
|
81 |
+
|
82 |
+
// Send the generate image data as the response body.
|
83 |
+
OutputStream body = resp.getOutputStream();
|
84 |
+
|
85 |
+
try {
|
86 |
+
ImageIO.write(image, "png", body);
|
87 |
+
} finally {
|
88 |
+
body.close();
|
89 |
+
}
|
90 |
+
|
91 |
+
// And we're done.
|
92 |
+
resp.setStatus(200);
|
93 |
+
resp.flushBuffer();
|
94 |
+
}
|
95 |
+
}
|
assets/evercookie.fla
ADDED
Binary file (5.22 kB). View file
|
|
assets/evercookie.jar
ADDED
Binary file (11.2 kB). View file
|
|
assets/evercookie.jnlp
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<jnlp>
|
3 |
+
<information>
|
4 |
+
<title>Evercookie Applet</title>
|
5 |
+
<vendor>Gabriel Bauman</vendor>
|
6 |
+
<offline-allowed />
|
7 |
+
</information>
|
8 |
+
<resources>
|
9 |
+
<j2se
|
10 |
+
version="1.5+"
|
11 |
+
href="http://java.sun.com/products/autodl/j2se" />
|
12 |
+
<!-- The following href must be the absolute path. -->
|
13 |
+
<jar
|
14 |
+
href="evercookie.jar"
|
15 |
+
main="true" />
|
16 |
+
</resources>
|
17 |
+
<applet-desc
|
18 |
+
name="Evercookie"
|
19 |
+
main-class="evercookie.EvercookieApplet"
|
20 |
+
width="1"
|
21 |
+
height="1">
|
22 |
+
</applet-desc>
|
23 |
+
</jnlp>
|
assets/evercookie.swf
ADDED
Binary file (362 Bytes). View file
|
|
assets/evercookie.xap
ADDED
Binary file (4.93 kB). View file
|
|
assets/evercookie_sl/evercookie.sln
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
Microsoft Visual Studio Solution File, Format Version 11.00
|
3 |
+
# Visual Web Developer Express 2010
|
4 |
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "evercookie", "evercookie\evercookie.csproj", "{4F1FD744-6C5A-4C7E-8DFB-702FBC6B9964}"
|
5 |
+
EndProject
|
6 |
+
Global
|
7 |
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
8 |
+
Debug|Any CPU = Debug|Any CPU
|
9 |
+
Release|Any CPU = Release|Any CPU
|
10 |
+
EndGlobalSection
|
11 |
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
12 |
+
{4F1FD744-6C5A-4C7E-8DFB-702FBC6B9964}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
13 |
+
{4F1FD744-6C5A-4C7E-8DFB-702FBC6B9964}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
14 |
+
{4F1FD744-6C5A-4C7E-8DFB-702FBC6B9964}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
15 |
+
{4F1FD744-6C5A-4C7E-8DFB-702FBC6B9964}.Release|Any CPU.Build.0 = Release|Any CPU
|
16 |
+
EndGlobalSection
|
17 |
+
GlobalSection(SolutionProperties) = preSolution
|
18 |
+
HideSolutionNode = FALSE
|
19 |
+
EndGlobalSection
|
20 |
+
EndGlobal
|
assets/evercookie_sl/evercookie.suo
ADDED
Binary file (25.6 kB). View file
|
|
assets/evercookie_sl/evercookie/App.xaml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2 |
+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
3 |
+
x:Class="evercookie.App"
|
4 |
+
>
|
5 |
+
<Application.Resources>
|
6 |
+
|
7 |
+
</Application.Resources>
|
8 |
+
</Application>
|
assets/evercookie_sl/evercookie/App.xaml.cs
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
using System;
|
2 |
+
using System.Collections.Generic;
|
3 |
+
using System.IO;
|
4 |
+
using System.IO.IsolatedStorage;
|
5 |
+
using System.Linq;
|
6 |
+
using System.Net;
|
7 |
+
using System.Windows;
|
8 |
+
using System.Windows.Browser;
|
9 |
+
using System.Windows.Controls;
|
10 |
+
using System.Windows.Documents;
|
11 |
+
using System.Windows.Input;
|
12 |
+
using System.Windows.Media;
|
13 |
+
using System.Windows.Media.Animation;
|
14 |
+
using System.Windows.Shapes;
|
15 |
+
|
16 |
+
namespace evercookie
|
17 |
+
{
|
18 |
+
public partial class App : Application
|
19 |
+
{
|
20 |
+
public App()
|
21 |
+
{
|
22 |
+
this.Startup += this.Application_Startup;
|
23 |
+
this.Exit += this.Application_Exit;
|
24 |
+
this.UnhandledException += this.Application_UnhandledException;
|
25 |
+
|
26 |
+
InitializeComponent();
|
27 |
+
}
|
28 |
+
|
29 |
+
private void Application_Startup(object sender, StartupEventArgs e)
|
30 |
+
{
|
31 |
+
MainPage scriptableControl = new MainPage();
|
32 |
+
this.RootVisual = scriptableControl;
|
33 |
+
HtmlPage.RegisterScriptableObject("App", scriptableControl);
|
34 |
+
|
35 |
+
MainPage.output.Text = "To save: " + e.InitParams.Count.ToString() + " values\n";
|
36 |
+
if (e.InitParams != null)
|
37 |
+
{
|
38 |
+
foreach (var item in e.InitParams)
|
39 |
+
{
|
40 |
+
this.Resources.Add(item.Key, item.Value);
|
41 |
+
MainPage.save(item.Key,item.Value);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
private void Application_Exit(object sender, EventArgs e)
|
47 |
+
{
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
|
52 |
+
{
|
53 |
+
// If the app is running outside of the debugger then report the exception using
|
54 |
+
// the browser's exception mechanism. On IE this will display it a yellow alert
|
55 |
+
// icon in the status bar and Firefox will display a script error.
|
56 |
+
if (!System.Diagnostics.Debugger.IsAttached)
|
57 |
+
{
|
58 |
+
|
59 |
+
// NOTE: This will allow the application to continue running after an exception has been thrown
|
60 |
+
// but not handled.
|
61 |
+
// For production applications this error handling should be replaced with something that will
|
62 |
+
// report the error to the website and stop the application.
|
63 |
+
e.Handled = true;
|
64 |
+
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
|
69 |
+
{
|
70 |
+
try
|
71 |
+
{
|
72 |
+
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
|
73 |
+
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
|
74 |
+
|
75 |
+
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
|
76 |
+
}
|
77 |
+
catch (Exception)
|
78 |
+
{
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
assets/evercookie_sl/evercookie/Bin/Debug/AppManifest.xaml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="evercookie" EntryPointType="evercookie.App" RuntimeVersion="4.0.50401.0">
|
2 |
+
<Deployment.Parts>
|
3 |
+
<AssemblyPart x:Name="evercookie" Source="evercookie.dll" />
|
4 |
+
</Deployment.Parts>
|
5 |
+
</Deployment>
|
assets/evercookie_sl/evercookie/Bin/Debug/evercookie.dll
ADDED
Binary file (10.2 kB). View file
|
|
assets/evercookie_sl/evercookie/Bin/Debug/evercookie.pdb
ADDED
Binary file (26.1 kB). View file
|
|
assets/evercookie_sl/evercookie/Bin/Debug/evercookie.xap
ADDED
Binary file (4.93 kB). View file
|
|
assets/evercookie_sl/evercookie/Bin/Debug/evercookieTestPage.html
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" >
|
3 |
+
<!-- saved from url=(0014)about:internet -->
|
4 |
+
<head>
|
5 |
+
<title>evercookie</title>
|
6 |
+
<style type="text/css">
|
7 |
+
html, body {
|
8 |
+
height: 100%;
|
9 |
+
overflow: auto;
|
10 |
+
}
|
11 |
+
body {
|
12 |
+
padding: 0;
|
13 |
+
margin: 0;
|
14 |
+
}
|
15 |
+
#silverlightControlHost {
|
16 |
+
height: 100%;
|
17 |
+
text-align:center;
|
18 |
+
}
|
19 |
+
</style>
|
20 |
+
|
21 |
+
<script type="text/javascript">
|
22 |
+
function onSilverlightError(sender, args) {
|
23 |
+
var appSource = "";
|
24 |
+
if (sender != null && sender != 0) {
|
25 |
+
appSource = sender.getHost().Source;
|
26 |
+
}
|
27 |
+
|
28 |
+
var errorType = args.ErrorType;
|
29 |
+
var iErrorCode = args.ErrorCode;
|
30 |
+
|
31 |
+
if (errorType == "ImageError" || errorType == "MediaError") {
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
|
35 |
+
var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n" ;
|
36 |
+
|
37 |
+
errMsg += "Code: "+ iErrorCode + " \n";
|
38 |
+
errMsg += "Category: " + errorType + " \n";
|
39 |
+
errMsg += "Message: " + args.ErrorMessage + " \n";
|
40 |
+
|
41 |
+
if (errorType == "ParserError") {
|
42 |
+
errMsg += "File: " + args.xamlFile + " \n";
|
43 |
+
errMsg += "Line: " + args.lineNumber + " \n";
|
44 |
+
errMsg += "Position: " + args.charPosition + " \n";
|
45 |
+
}
|
46 |
+
else if (errorType == "RuntimeError") {
|
47 |
+
if (args.lineNumber != 0) {
|
48 |
+
errMsg += "Line: " + args.lineNumber + " \n";
|
49 |
+
errMsg += "Position: " + args.charPosition + " \n";
|
50 |
+
}
|
51 |
+
errMsg += "MethodName: " + args.methodName + " \n";
|
52 |
+
}
|
53 |
+
|
54 |
+
throw new Error(errMsg);
|
55 |
+
}
|
56 |
+
</script>
|
57 |
+
</head>
|
58 |
+
<body>
|
59 |
+
<form id="form1" runat="server" style="height:100%">
|
60 |
+
<div id="silverlightControlHost">
|
61 |
+
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
|
62 |
+
<param name="source" value="evercookie.xap"/>
|
63 |
+
<param name="onError" value="onSilverlightError" />
|
64 |
+
<param name="background" value="white" />
|
65 |
+
<param name="minRuntimeVersion" value="4.0.50401.0" />
|
66 |
+
<param name="autoUpgrade" value="true" />
|
67 |
+
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration:none">
|
68 |
+
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
|
69 |
+
</a>
|
70 |
+
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
|
71 |
+
</form>
|
72 |
+
</body>
|
73 |
+
</html>
|
assets/evercookie_sl/evercookie/MainPage.xaml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<UserControl x:Class="evercookie.MainPage"
|
2 |
+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
3 |
+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
4 |
+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
5 |
+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
6 |
+
mc:Ignorable="d"
|
7 |
+
d:DesignHeight="200" d:DesignWidth="200">
|
8 |
+
<Canvas>
|
9 |
+
<TextBox x:Name="txtOut" Grid.Row="6" Grid.Column="1" TextWrapping="Wrap" Width="200" Height="200" ToolTipService.ToolTip="Enter Name" HorizontalAlignment="Left" VerticalAlignment="Top" TabIndex="1" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" Text="Loading..."></TextBox>
|
10 |
+
</Canvas>
|
11 |
+
</UserControl>
|
assets/evercookie_sl/evercookie/MainPage.xaml.cs
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
using System;
|
2 |
+
using System.Collections.Generic;
|
3 |
+
using System.IO;
|
4 |
+
using System.IO.IsolatedStorage;
|
5 |
+
using System.Linq;
|
6 |
+
using System.Net;
|
7 |
+
using System.Windows;
|
8 |
+
using System.Windows.Browser;
|
9 |
+
using System.Windows.Controls;
|
10 |
+
using System.Windows.Documents;
|
11 |
+
using System.Windows.Input;
|
12 |
+
using System.Windows.Media;
|
13 |
+
using System.Windows.Media.Animation;
|
14 |
+
using System.Windows.Shapes;
|
15 |
+
|
16 |
+
namespace evercookie
|
17 |
+
{
|
18 |
+
public partial class MainPage : UserControl
|
19 |
+
{
|
20 |
+
private static string isoFile = "evercookie_isoData.txt";
|
21 |
+
public static TextBox output;
|
22 |
+
public MainPage()
|
23 |
+
{
|
24 |
+
InitializeComponent();
|
25 |
+
output = txtOut;
|
26 |
+
}
|
27 |
+
|
28 |
+
[ScriptableMember()]
|
29 |
+
public string getIsolatedStorage()
|
30 |
+
{
|
31 |
+
output.Text += "Loading isoData...\n";
|
32 |
+
string data = String.Empty;
|
33 |
+
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
|
34 |
+
{
|
35 |
+
using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(isoFile, FileMode.Open, isf))
|
36 |
+
{
|
37 |
+
using (StreamReader sr = new StreamReader(isfs))
|
38 |
+
{
|
39 |
+
string lineOfData = String.Empty;
|
40 |
+
while ((lineOfData = sr.ReadLine()) != null)
|
41 |
+
{
|
42 |
+
data += lineOfData;
|
43 |
+
output.Text += "Loading: " + lineOfData + "\n";
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
return data;
|
49 |
+
}
|
50 |
+
|
51 |
+
public static void save(string name, string value)
|
52 |
+
{
|
53 |
+
output.Text += "Saving: " + name + "=" + value + "\n";
|
54 |
+
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
|
55 |
+
{
|
56 |
+
using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(isoFile, FileMode.Create, isf))
|
57 |
+
{
|
58 |
+
using (StreamWriter sw = new StreamWriter(isfs))
|
59 |
+
{
|
60 |
+
sw.Write(name+"="+value);
|
61 |
+
sw.Close();
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
assets/evercookie_sl/evercookie/Properties/AppManifest.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
|
2 |
+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
3 |
+
>
|
4 |
+
<Deployment.Parts>
|
5 |
+
</Deployment.Parts>
|
6 |
+
</Deployment>
|
assets/evercookie_sl/evercookie/Properties/AssemblyInfo.cs
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
using System.Reflection;
|
2 |
+
using System.Runtime.CompilerServices;
|
3 |
+
using System.Runtime.InteropServices;
|
4 |
+
|
5 |
+
// General Information about an assembly is controlled through the following
|
6 |
+
// set of attributes. Change these attribute values to modify the information
|
7 |
+
// associated with an assembly.
|
8 |
+
[assembly: AssemblyTitle("evercookie")]
|
9 |
+
[assembly: AssemblyDescription("")]
|
10 |
+
[assembly: AssemblyConfiguration("")]
|
11 |
+
[assembly: AssemblyCompany("Microsoft")]
|
12 |
+
[assembly: AssemblyProduct("evercookie")]
|
13 |
+
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
|
14 |
+
[assembly: AssemblyTrademark("")]
|
15 |
+
[assembly: AssemblyCulture("")]
|
16 |
+
|
17 |
+
// Setting ComVisible to false makes the types in this assembly not visible
|
18 |
+
// to COM components. If you need to access a type in this assembly from
|
19 |
+
// COM, set the ComVisible attribute to true on that type.
|
20 |
+
[assembly: ComVisible(false)]
|
21 |
+
|
22 |
+
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
23 |
+
[assembly: Guid("2677569e-14bc-4ec6-b4b1-3c7de7b21afd")]
|
24 |
+
|
25 |
+
// Version information for an assembly consists of the following four values:
|
26 |
+
//
|
27 |
+
// Major Version
|
28 |
+
// Minor Version
|
29 |
+
// Build Number
|
30 |
+
// Revision
|
31 |
+
//
|
32 |
+
// You can specify all the values or you can default the Revision and Build Numbers
|
33 |
+
// by using the '*' as shown below:
|
34 |
+
[assembly: AssemblyVersion("1.0.0.0")]
|
35 |
+
[assembly: AssemblyFileVersion("1.0.0.0")]
|
assets/evercookie_sl/evercookie/evercookie.csproj
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3 |
+
<PropertyGroup>
|
4 |
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
5 |
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
6 |
+
<ProductVersion>8.0.50727</ProductVersion>
|
7 |
+
<SchemaVersion>2.0</SchemaVersion>
|
8 |
+
<ProjectGuid>{4F1FD744-6C5A-4C7E-8DFB-702FBC6B9964}</ProjectGuid>
|
9 |
+
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
10 |
+
<OutputType>Library</OutputType>
|
11 |
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
12 |
+
<RootNamespace>evercookie</RootNamespace>
|
13 |
+
<AssemblyName>evercookie</AssemblyName>
|
14 |
+
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
|
15 |
+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
16 |
+
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
|
17 |
+
<SilverlightApplication>true</SilverlightApplication>
|
18 |
+
<SupportedCultures>
|
19 |
+
</SupportedCultures>
|
20 |
+
<XapOutputs>true</XapOutputs>
|
21 |
+
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
22 |
+
<XapFilename>evercookie.xap</XapFilename>
|
23 |
+
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
24 |
+
<SilverlightAppEntry>evercookie.App</SilverlightAppEntry>
|
25 |
+
<TestPageFileName>evercookieTestPage.html</TestPageFileName>
|
26 |
+
<CreateTestPage>true</CreateTestPage>
|
27 |
+
<ValidateXaml>true</ValidateXaml>
|
28 |
+
<EnableOutOfBrowser>false</EnableOutOfBrowser>
|
29 |
+
<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
|
30 |
+
<UsePlatformExtensions>false</UsePlatformExtensions>
|
31 |
+
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
32 |
+
<LinkedServerProject>
|
33 |
+
</LinkedServerProject>
|
34 |
+
</PropertyGroup>
|
35 |
+
<!-- This property group is only here to support building this project using the
|
36 |
+
MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
|
37 |
+
to set the TargetFrameworkVersion to v3.5 -->
|
38 |
+
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
|
39 |
+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
40 |
+
</PropertyGroup>
|
41 |
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
42 |
+
<DebugSymbols>true</DebugSymbols>
|
43 |
+
<DebugType>full</DebugType>
|
44 |
+
<Optimize>false</Optimize>
|
45 |
+
<OutputPath>Bin\Debug</OutputPath>
|
46 |
+
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
|
47 |
+
<NoStdLib>true</NoStdLib>
|
48 |
+
<NoConfig>true</NoConfig>
|
49 |
+
<ErrorReport>prompt</ErrorReport>
|
50 |
+
<WarningLevel>4</WarningLevel>
|
51 |
+
</PropertyGroup>
|
52 |
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
53 |
+
<DebugType>pdbonly</DebugType>
|
54 |
+
<Optimize>true</Optimize>
|
55 |
+
<OutputPath>Bin\Release</OutputPath>
|
56 |
+
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
|
57 |
+
<NoStdLib>true</NoStdLib>
|
58 |
+
<NoConfig>true</NoConfig>
|
59 |
+
<ErrorReport>prompt</ErrorReport>
|
60 |
+
<WarningLevel>4</WarningLevel>
|
61 |
+
</PropertyGroup>
|
62 |
+
<ItemGroup>
|
63 |
+
<Reference Include="mscorlib" />
|
64 |
+
<Reference Include="System.Windows" />
|
65 |
+
<Reference Include="system" />
|
66 |
+
<Reference Include="System.Core" />
|
67 |
+
<Reference Include="System.Net" />
|
68 |
+
<Reference Include="System.Xml" />
|
69 |
+
<Reference Include="System.Windows.Browser" />
|
70 |
+
</ItemGroup>
|
71 |
+
<ItemGroup>
|
72 |
+
<Compile Include="App.xaml.cs">
|
73 |
+
<DependentUpon>App.xaml</DependentUpon>
|
74 |
+
</Compile>
|
75 |
+
<Compile Include="MainPage.xaml.cs">
|
76 |
+
<DependentUpon>MainPage.xaml</DependentUpon>
|
77 |
+
</Compile>
|
78 |
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
79 |
+
</ItemGroup>
|
80 |
+
<ItemGroup>
|
81 |
+
<ApplicationDefinition Include="App.xaml">
|
82 |
+
<SubType>Designer</SubType>
|
83 |
+
<Generator>MSBuild:Compile</Generator>
|
84 |
+
</ApplicationDefinition>
|
85 |
+
<Page Include="MainPage.xaml">
|
86 |
+
<SubType>Designer</SubType>
|
87 |
+
<Generator>MSBuild:Compile</Generator>
|
88 |
+
</Page>
|
89 |
+
</ItemGroup>
|
90 |
+
<ItemGroup>
|
91 |
+
<None Include="Properties\AppManifest.xml" />
|
92 |
+
</ItemGroup>
|
93 |
+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
|
94 |
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
95 |
+
Other similar extension points exist, see Microsoft.Common.targets.
|
96 |
+
<Target Name="BeforeBuild">
|
97 |
+
</Target>
|
98 |
+
<Target Name="AfterBuild">
|
99 |
+
</Target>
|
100 |
+
-->
|
101 |
+
<ProjectExtensions>
|
102 |
+
<VisualStudio>
|
103 |
+
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
|
104 |
+
<SilverlightProjectProperties />
|
105 |
+
</FlavorProperties>
|
106 |
+
</VisualStudio>
|
107 |
+
</ProjectExtensions>
|
108 |
+
<PropertyGroup>
|
109 |
+
<PostBuildEvent>copy "$(TargetDir)$(TargetName).xap" "Y:\My Dropbox\www\evercookie\evercookie.xap"</PostBuildEvent>
|
110 |
+
</PropertyGroup>
|
111 |
+
</Project>
|
assets/evercookie_sl/evercookie/evercookie.csproj.user
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3 |
+
<ProjectExtensions>
|
4 |
+
<VisualStudio>
|
5 |
+
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
|
6 |
+
<SilverlightProjectProperties>
|
7 |
+
<StartPageUrl>
|
8 |
+
</StartPageUrl>
|
9 |
+
<StartAction>DynamicPage</StartAction>
|
10 |
+
<AspNetDebugging>True</AspNetDebugging>
|
11 |
+
<NativeDebugging>False</NativeDebugging>
|
12 |
+
<SQLDebugging>False</SQLDebugging>
|
13 |
+
<ExternalProgram>
|
14 |
+
</ExternalProgram>
|
15 |
+
<StartExternalURL>
|
16 |
+
</StartExternalURL>
|
17 |
+
<StartCmdLineArguments>
|
18 |
+
</StartCmdLineArguments>
|
19 |
+
<StartWorkingDirectory>
|
20 |
+
</StartWorkingDirectory>
|
21 |
+
<ShowWebRefOnDebugPrompt>True</ShowWebRefOnDebugPrompt>
|
22 |
+
<OutOfBrowserProjectToDebug>
|
23 |
+
</OutOfBrowserProjectToDebug>
|
24 |
+
<ShowRiaSvcsOnDebugPrompt>True</ShowRiaSvcsOnDebugPrompt>
|
25 |
+
</SilverlightProjectProperties>
|
26 |
+
</FlavorProperties>
|
27 |
+
</VisualStudio>
|
28 |
+
</ProjectExtensions>
|
29 |
+
</Project>
|
assets/evercookie_sl/evercookie/obj/Debug/App.g.cs
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#pragma checksum "C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "D9A8BE4B3DC1C91D368CA6B44F124B38"
|
2 |
+
//------------------------------------------------------------------------------
|
3 |
+
// <auto-generated>
|
4 |
+
// This code was generated by a tool.
|
5 |
+
// Runtime Version:4.0.30319.1
|
6 |
+
//
|
7 |
+
// Changes to this file may cause incorrect behavior and will be lost if
|
8 |
+
// the code is regenerated.
|
9 |
+
// </auto-generated>
|
10 |
+
//------------------------------------------------------------------------------
|
11 |
+
|
12 |
+
using System;
|
13 |
+
using System.Windows;
|
14 |
+
using System.Windows.Automation;
|
15 |
+
using System.Windows.Automation.Peers;
|
16 |
+
using System.Windows.Automation.Provider;
|
17 |
+
using System.Windows.Controls;
|
18 |
+
using System.Windows.Controls.Primitives;
|
19 |
+
using System.Windows.Data;
|
20 |
+
using System.Windows.Documents;
|
21 |
+
using System.Windows.Ink;
|
22 |
+
using System.Windows.Input;
|
23 |
+
using System.Windows.Interop;
|
24 |
+
using System.Windows.Markup;
|
25 |
+
using System.Windows.Media;
|
26 |
+
using System.Windows.Media.Animation;
|
27 |
+
using System.Windows.Media.Imaging;
|
28 |
+
using System.Windows.Resources;
|
29 |
+
using System.Windows.Shapes;
|
30 |
+
using System.Windows.Threading;
|
31 |
+
|
32 |
+
|
33 |
+
namespace evercookie {
|
34 |
+
|
35 |
+
|
36 |
+
public partial class App : System.Windows.Application {
|
37 |
+
|
38 |
+
private bool _contentLoaded;
|
39 |
+
|
40 |
+
/// <summary>
|
41 |
+
/// InitializeComponent
|
42 |
+
/// </summary>
|
43 |
+
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
44 |
+
public void InitializeComponent() {
|
45 |
+
if (_contentLoaded) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
_contentLoaded = true;
|
49 |
+
System.Windows.Application.LoadComponent(this, new System.Uri("/evercookie;component/App.xaml", System.UriKind.Relative));
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
assets/evercookie_sl/evercookie/obj/Debug/App.g.i.cs
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#pragma checksum "C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "D9A8BE4B3DC1C91D368CA6B44F124B38"
|
2 |
+
//------------------------------------------------------------------------------
|
3 |
+
// <auto-generated>
|
4 |
+
// This code was generated by a tool.
|
5 |
+
// Runtime Version:4.0.30319.1
|
6 |
+
//
|
7 |
+
// Changes to this file may cause incorrect behavior and will be lost if
|
8 |
+
// the code is regenerated.
|
9 |
+
// </auto-generated>
|
10 |
+
//------------------------------------------------------------------------------
|
11 |
+
|
12 |
+
using System;
|
13 |
+
using System.Windows;
|
14 |
+
using System.Windows.Automation;
|
15 |
+
using System.Windows.Automation.Peers;
|
16 |
+
using System.Windows.Automation.Provider;
|
17 |
+
using System.Windows.Controls;
|
18 |
+
using System.Windows.Controls.Primitives;
|
19 |
+
using System.Windows.Data;
|
20 |
+
using System.Windows.Documents;
|
21 |
+
using System.Windows.Ink;
|
22 |
+
using System.Windows.Input;
|
23 |
+
using System.Windows.Interop;
|
24 |
+
using System.Windows.Markup;
|
25 |
+
using System.Windows.Media;
|
26 |
+
using System.Windows.Media.Animation;
|
27 |
+
using System.Windows.Media.Imaging;
|
28 |
+
using System.Windows.Resources;
|
29 |
+
using System.Windows.Shapes;
|
30 |
+
using System.Windows.Threading;
|
31 |
+
|
32 |
+
|
33 |
+
namespace evercookie {
|
34 |
+
|
35 |
+
|
36 |
+
public partial class App : System.Windows.Application {
|
37 |
+
|
38 |
+
private bool _contentLoaded;
|
39 |
+
|
40 |
+
/// <summary>
|
41 |
+
/// InitializeComponent
|
42 |
+
/// </summary>
|
43 |
+
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
44 |
+
public void InitializeComponent() {
|
45 |
+
if (_contentLoaded) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
_contentLoaded = true;
|
49 |
+
System.Windows.Application.LoadComponent(this, new System.Uri("/evercookie;component/App.xaml", System.UriKind.Relative));
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
assets/evercookie_sl/evercookie/obj/Debug/DesignTimeResolveAssemblyReferences.cache
ADDED
Binary file (4.59 kB). View file
|
|
assets/evercookie_sl/evercookie/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
ADDED
Binary file (5.63 kB). View file
|
|
assets/evercookie_sl/evercookie/obj/Debug/MainPage.g.cs
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#pragma checksum "C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "EF5CB8E67DD7E04FA002328FDB17DC85"
|
2 |
+
//------------------------------------------------------------------------------
|
3 |
+
// <auto-generated>
|
4 |
+
// This code was generated by a tool.
|
5 |
+
// Runtime Version:4.0.30319.1
|
6 |
+
//
|
7 |
+
// Changes to this file may cause incorrect behavior and will be lost if
|
8 |
+
// the code is regenerated.
|
9 |
+
// </auto-generated>
|
10 |
+
//------------------------------------------------------------------------------
|
11 |
+
|
12 |
+
using System;
|
13 |
+
using System.Windows;
|
14 |
+
using System.Windows.Automation;
|
15 |
+
using System.Windows.Automation.Peers;
|
16 |
+
using System.Windows.Automation.Provider;
|
17 |
+
using System.Windows.Controls;
|
18 |
+
using System.Windows.Controls.Primitives;
|
19 |
+
using System.Windows.Data;
|
20 |
+
using System.Windows.Documents;
|
21 |
+
using System.Windows.Ink;
|
22 |
+
using System.Windows.Input;
|
23 |
+
using System.Windows.Interop;
|
24 |
+
using System.Windows.Markup;
|
25 |
+
using System.Windows.Media;
|
26 |
+
using System.Windows.Media.Animation;
|
27 |
+
using System.Windows.Media.Imaging;
|
28 |
+
using System.Windows.Resources;
|
29 |
+
using System.Windows.Shapes;
|
30 |
+
using System.Windows.Threading;
|
31 |
+
|
32 |
+
|
33 |
+
namespace evercookie {
|
34 |
+
|
35 |
+
|
36 |
+
public partial class MainPage : System.Windows.Controls.UserControl {
|
37 |
+
|
38 |
+
internal System.Windows.Controls.TextBox txtOut;
|
39 |
+
|
40 |
+
private bool _contentLoaded;
|
41 |
+
|
42 |
+
/// <summary>
|
43 |
+
/// InitializeComponent
|
44 |
+
/// </summary>
|
45 |
+
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
46 |
+
public void InitializeComponent() {
|
47 |
+
if (_contentLoaded) {
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
_contentLoaded = true;
|
51 |
+
System.Windows.Application.LoadComponent(this, new System.Uri("/evercookie;component/MainPage.xaml", System.UriKind.Relative));
|
52 |
+
this.txtOut = ((System.Windows.Controls.TextBox)(this.FindName("txtOut")));
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
assets/evercookie_sl/evercookie/obj/Debug/MainPage.g.i.cs
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#pragma checksum "C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "EF5CB8E67DD7E04FA002328FDB17DC85"
|
2 |
+
//------------------------------------------------------------------------------
|
3 |
+
// <auto-generated>
|
4 |
+
// This code was generated by a tool.
|
5 |
+
// Runtime Version:4.0.30319.1
|
6 |
+
//
|
7 |
+
// Changes to this file may cause incorrect behavior and will be lost if
|
8 |
+
// the code is regenerated.
|
9 |
+
// </auto-generated>
|
10 |
+
//------------------------------------------------------------------------------
|
11 |
+
|
12 |
+
using System;
|
13 |
+
using System.Windows;
|
14 |
+
using System.Windows.Automation;
|
15 |
+
using System.Windows.Automation.Peers;
|
16 |
+
using System.Windows.Automation.Provider;
|
17 |
+
using System.Windows.Controls;
|
18 |
+
using System.Windows.Controls.Primitives;
|
19 |
+
using System.Windows.Data;
|
20 |
+
using System.Windows.Documents;
|
21 |
+
using System.Windows.Ink;
|
22 |
+
using System.Windows.Input;
|
23 |
+
using System.Windows.Interop;
|
24 |
+
using System.Windows.Markup;
|
25 |
+
using System.Windows.Media;
|
26 |
+
using System.Windows.Media.Animation;
|
27 |
+
using System.Windows.Media.Imaging;
|
28 |
+
using System.Windows.Resources;
|
29 |
+
using System.Windows.Shapes;
|
30 |
+
using System.Windows.Threading;
|
31 |
+
|
32 |
+
|
33 |
+
namespace evercookie {
|
34 |
+
|
35 |
+
|
36 |
+
public partial class MainPage : System.Windows.Controls.UserControl {
|
37 |
+
|
38 |
+
internal System.Windows.Controls.TextBox txtOut;
|
39 |
+
|
40 |
+
private bool _contentLoaded;
|
41 |
+
|
42 |
+
/// <summary>
|
43 |
+
/// InitializeComponent
|
44 |
+
/// </summary>
|
45 |
+
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
46 |
+
public void InitializeComponent() {
|
47 |
+
if (_contentLoaded) {
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
_contentLoaded = true;
|
51 |
+
System.Windows.Application.LoadComponent(this, new System.Uri("/evercookie;component/MainPage.xaml", System.UriKind.Relative));
|
52 |
+
this.txtOut = ((System.Windows.Controls.TextBox)(this.FindName("txtOut")));
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
assets/evercookie_sl/evercookie/obj/Debug/XapCacheFile.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<xapCache source="C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\Bin\Debug\evercookie.xap" wasSigned="False" certificateThumbprint="" TimeStampUrl="" lastWriteTime="10/10/2010 1:17:46 PM">
|
2 |
+
<file source="C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\evercookie.dll" archivePath="evercookie.dll" lastWriteTime="10/10/2010 1:17:46 PM" />
|
3 |
+
<file source="C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\Bin\Debug\AppManifest.xaml" archivePath="AppManifest.xaml" lastWriteTime="10/10/2010 11:20:23 AM" />
|
4 |
+
</xapCache>
|
assets/evercookie_sl/evercookie/obj/Debug/evercookie.csproj.FileListAbsolute.txt
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\Bin\Debug\evercookie.dll
|
2 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\Bin\Debug\evercookie.pdb
|
3 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\Bin\Debug\AppManifest.xaml
|
4 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\Bin\Debug\evercookie.xap
|
5 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\Bin\Debug\evercookieTestPage.html
|
6 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\ResolveAssemblyReference.cache
|
7 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\App.g.i.cs
|
8 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\MainPage.g.i.cs
|
9 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\evercookie.g.resources
|
10 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\evercookie.dll
|
11 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\evercookie.pdb
|
12 |
+
C:\Users\Ethrel\Documents\Projects\Silverlight\evercookie\evercookie\obj\Debug\XapCacheFile.xml
|
assets/evercookie_sl/evercookie/obj/Debug/evercookie.dll
ADDED
Binary file (10.2 kB). View file
|
|
assets/evercookie_sl/evercookie/obj/Debug/evercookie.g.resources
ADDED
Binary file (1.3 kB). View file
|
|
assets/evercookie_sl/evercookie/obj/Debug/evercookie.pdb
ADDED
Binary file (26.1 kB). View file
|
|
css/master.css
ADDED
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body { margin-top: 0px;color: #000000; background: #A4FFEF; font-family: Arial, Helvetica, Verdana, Sans; font-size: 10pt}
|
2 |
+
h1 {font-size: 15pt; font-style: bold; color: #000066;}
|
3 |
+
h2 {font-size: 12pt; font-style: bold; color: #000066;}
|
4 |
+
h3 {font-size: 12pt; font-style: bold; color: #000066;}
|
5 |
+
h4 {font-size: 11pt; font-style: bold; color: #000066;}
|
6 |
+
h5 {font-size: 11pt; font-style: bold; color: #000000;}
|
7 |
+
A:link { text-decoration: underline; color: #0033CC }
|
8 |
+
A:visited { text-decoration: underline }
|
9 |
+
A:hover { color: #F00000; text-decoration: underline }
|
10 |
+
A:active { text-decoration: underline }
|
11 |
+
td { font-size: 12px }
|
12 |
+
.spacer { float:left; height:4px; }
|
13 |
+
div#pagebox1 {}
|
14 |
+
div#pagebox2 {
|
15 |
+
width: 728px;
|
16 |
+
text-align: left;
|
17 |
+
background-color: #ffffff;
|
18 |
+
border-bottom: 1px solid #264D73;
|
19 |
+
border-left: 1px solid #264D73;
|
20 |
+
border-right: 1px solid #264D73;
|
21 |
+
}
|
22 |
+
div#pagecontent {
|
23 |
+
padding: 0px 25px 40px 17px;
|
24 |
+
text-align: justify;
|
25 |
+
}
|
26 |
+
|
27 |
+
div#pagenav {
|
28 |
+
text-align: center;
|
29 |
+
background: #F3F3F3;
|
30 |
+
padding: 5px 5px 8px 5px;
|
31 |
+
margin: 10px 17px 2px 17px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.topnavtable {background: #336699;}
|
35 |
+
.topnav2 {background: #336699; font-family: Verdana, Helvetica, Arial, Sans; font-size: 12px; color:#F5F5F5; font-weight: bold; text-decoration: none; line-height: 2; padding: 0px 0px 0px 4px;}
|
36 |
+
a.headerlink {color: #F5F5F5; text-decoration: none;}
|
37 |
+
a.headerlink:hover {color: #33ff33; text-decoration: none;}
|
38 |
+
a.headerlink:visited {color: #F5F5F5; text-decoration: none;}
|
39 |
+
a.headerlink:visited:hover {color: #33ff33; text-decoration: none;}
|
40 |
+
a.homelink {
|
41 |
+
float: left;
|
42 |
+
width: 110px;
|
43 |
+
height: 14px;
|
44 |
+
font-family: Arial, Tahoma, Sans;
|
45 |
+
font-size: 11px;
|
46 |
+
font-weight: bold;
|
47 |
+
text-align: center;
|
48 |
+
text-decoration: none;
|
49 |
+
background-color: #cccccc;
|
50 |
+
color: #333333;
|
51 |
+
margin: 0px 0px 0px 0px;
|
52 |
+
padding: 3px 3px 2px 6px;
|
53 |
+
border-top-width: 1px;
|
54 |
+
border-right-width: 1px;
|
55 |
+
border-bottom-width: 1px;
|
56 |
+
border-left-width: 1px;
|
57 |
+
border-top-style: solid;
|
58 |
+
border-right-style: solid;
|
59 |
+
border-bottom-style: solid;
|
60 |
+
border-left-style: solid;
|
61 |
+
border-top-color: #cccccc;
|
62 |
+
border-right-color: #000000;
|
63 |
+
border-bottom-color: #000000;
|
64 |
+
border-left-color: #cccccc;
|
65 |
+
}
|
66 |
+
a.homelink:hover {
|
67 |
+
color: #333333;
|
68 |
+
background-color: #9CBDDE;
|
69 |
+
text-decoration: none;
|
70 |
+
}
|
71 |
+
a.homelink:visited {
|
72 |
+
color: #333333;
|
73 |
+
text-decoration: none;
|
74 |
+
}
|
75 |
+
|
76 |
+
a.topnav {
|
77 |
+
float: left;
|
78 |
+
width: 88px;
|
79 |
+
height: 12px;
|
80 |
+
font-family: Arial, Tahoma, Sans;
|
81 |
+
font-size: 12px;
|
82 |
+
font-weight: bold;
|
83 |
+
text-align: left;
|
84 |
+
text-decoration: none;
|
85 |
+
background-color: #6E9ECF;
|
86 |
+
color: #000000;
|
87 |
+
margin: 0px 0px 0px 0px;
|
88 |
+
padding: 2px 3px 4px 6px;
|
89 |
+
border-top: 1px solid #88B0D7;
|
90 |
+
border-bottom: 1px solid #264D73;
|
91 |
+
border-right: 1px solid #264D73;
|
92 |
+
}
|
93 |
+
a.topnav:visited {
|
94 |
+
color: #000000;
|
95 |
+
text-decoration: none;
|
96 |
+
}
|
97 |
+
a.topnav:hover {
|
98 |
+
color: #000000;
|
99 |
+
background-color: #9CBDDE;
|
100 |
+
text-decoration: none;
|
101 |
+
}
|
102 |
+
.par1 {text-align:justify;}
|
103 |
+
.code1 { background: #EFEFEF; padding: 0.6em; font-family: Verdana, Helvetica, Arial; font-size: 11px; color:#000000; font-weight: normal; text-decoration: none; line-height: 1.4 }
|
104 |
+
.codeinline {
|
105 |
+
display: inline;
|
106 |
+
background: #EFEFEF;
|
107 |
+
font-family: Verdana, Helvetica, Arial;
|
108 |
+
font-size: 11px;
|
109 |
+
color:#000000;
|
110 |
+
font-weight: normal;
|
111 |
+
text-decoration: none;
|
112 |
+
line-height: 2.6em;
|
113 |
+
padding: 0.5em;
|
114 |
+
}
|
115 |
+
.code2 { font-family: Verdana, Helvetica, Arial; font-size: 11px; color: #0000CC; font-weight: bold; text-decoration: none; line-height: 1.4 }
|
116 |
+
.code3 { font-family: Verdana, Helvetica, Arial; font-size: 11px; color: #000000; font-weight: bold; text-decoration: none; line-height: 1.4 }
|
117 |
+
.userinput { font-family: Verdana, Helvetica, Arial; font-size: 11px; color: #003761; font-weight: bold; text-decoration: none; line-height: 1.4 }
|
118 |
+
|
119 |
+
.bannertable {
|
120 |
+
font-size: 10px;
|
121 |
+
color: #000000;
|
122 |
+
background-color: #FFFFFF;
|
123 |
+
border-top-width: thin;
|
124 |
+
border-top-style: solid;
|
125 |
+
font-family: Verdana, Arial, Helvetica, sans-serif;
|
126 |
+
}
|
127 |
+
.heading1 { background: #E4EAEF; font-size: 13pt; font-family: Verdana, Arial, Helvetica, sans-serif; color:#003300; text-decoration: none; line-height: 1 }
|
128 |
+
a.heading1 { background: #E4EAEF; font-size: 13pt; font-family: Verdana, Arial, Helvetica, sans-serif; color:#003300; text-decoration: none; line-height: 1 }
|
129 |
+
a.heading1:visited { background: #E4EAEF; font-size: 13pt; font-family: Verdana, Arial, Helvetica, sans-serif; color:#003300; text-decoration: none; line-height: 1 }
|
130 |
+
a.heading1:hover { background: #E4EAEF; font-size: 13pt; font-family: Verdana, Arial, Helvetica, sans-serif; color:#003300; text-decoration: none; line-height: 1 }
|
131 |
+
.h2tutorial { font-size: 11pt; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color:#003300; text-decoration: none; line-height: 1 }
|
132 |
+
|
133 |
+
div#tutnav { background: #F3F3F3; padding: 6px; text-align: center; font-size: 10px; }
|
134 |
+
|
135 |
+
.level3 {
|
136 |
+
font-family:Arial, Tahoma;
|
137 |
+
width:125;
|
138 |
+
height:14;
|
139 |
+
background-color:#DCE2E9;
|
140 |
+
color:F8F8F8;
|
141 |
+
font-size:9;
|
142 |
+
text-transform: uppercase;
|
143 |
+
line-height:14px;
|
144 |
+
margin: 0px 0px 0px 0px;
|
145 |
+
padding: 1px 2px 1px 3px;
|
146 |
+
font-weight:bold;
|
147 |
+
text-align:left;
|
148 |
+
text-decoration:none;
|
149 |
+
border-top-width: 1;
|
150 |
+
border-right-width: 1;
|
151 |
+
border-bottom-width: 1;
|
152 |
+
border-left-width: 1;
|
153 |
+
border-top-style: solid;
|
154 |
+
border-right-style: solid;
|
155 |
+
border-bottom-style: solid;
|
156 |
+
border-left-style: solid;
|
157 |
+
border-top-color: #cccccc;
|
158 |
+
border-right-color: 999999;
|
159 |
+
border-bottom-color: 999999;
|
160 |
+
border-left-color: #cccccc;
|
161 |
+
}
|
162 |
+
a.level3:hover {
|
163 |
+
color:000000;
|
164 |
+
background-color:9EAFC7;
|
165 |
+
text-decoration:none;
|
166 |
+
}
|
167 |
+
.level3:link { color:003399; text-decoration: none; }
|
168 |
+
a.level3:active {
|
169 |
+
color:ffffff;
|
170 |
+
background-color:345C72;
|
171 |
+
text-decoration:none;
|
172 |
+
border-top-color: #000000;
|
173 |
+
border-right-color: cccccc;
|
174 |
+
border-bottom-color: cccccc;
|
175 |
+
border-left-color: #000000;
|
176 |
+
}
|
177 |
+
.level3:visited { color:5B1DA9; text-decoration: none; }
|
178 |
+
|
179 |
+
ul {
|
180 |
+
text-align: left;
|
181 |
+
}
|
182 |
+
|
183 |
+
div#footertext1 {background-color: #336699; text-align: center; color: #E6E6E6; font-size: 14px; padding: 5px,2px,2px,2px; margin: 0px,0px,0px,0px;}
|
184 |
+
div#footertext2 {background-color: #336699; text-align: center; color: #E6E6E6; font-size: 11px; padding: 2px 2px 5px 2px; margin: 0px 0px 0px 0px;}
|
185 |
+
a.footerlink {color: #E6E6E6; text-decoration: none;}
|
186 |
+
a.footerlink:hover {color: #33ff33; text-decoration: none;}
|
187 |
+
a.footerlink:visited {color: #E6E6E6; text-decoration: none;}
|
188 |
+
a.footerlink:visited:hover {color: #33ff33; text-decoration: none;}
|
189 |
+
|
190 |
+
div#adsense728 { background-color: #6699CC; padding: 0px,0px,0px,0px; }
|
191 |
+
|
192 |
+
.interlink {
|
193 |
+
font-size: 10px;
|
194 |
+
text-align: right;
|
195 |
+
float: right;
|
196 |
+
position: relative;
|
197 |
+
}
|
198 |
+
a.extlink { Title: "External Link"; }
|
199 |
+
a.extlink:hover { Title: "External Link"; }
|
200 |
+
a.extlink:visited:hover { Title: "External Link"; }
|
201 |
+
.extimg { margin: 0px 3px 0px 5px; }
|
202 |
+
|
203 |
+
.windowtop {
|
204 |
+
font-family: Arial, Helvetica, sans-serif;
|
205 |
+
font-size: 10px;
|
206 |
+
color: #FFFFFF;
|
207 |
+
text-decoration: none;
|
208 |
+
background-color: #336699;
|
209 |
+
margin: 5px 5px 0px 5px;
|
210 |
+
padding: 4px 12px 4px 15px;
|
211 |
+
width: 600px;
|
212 |
+
font-weight: bold;
|
213 |
+
border-top: 3px solid #999999;
|
214 |
+
border-right: 3px solid #999999;
|
215 |
+
border-bottom: none;
|
216 |
+
border-left: 3px solid #999999;
|
217 |
+
|
218 |
+
}
|
219 |
+
.prompt {
|
220 |
+
font-family: "Courier New", "Courier", "mono";
|
221 |
+
font-size: 14px;
|
222 |
+
color: #FFFFFF;
|
223 |
+
text-decoration: none;
|
224 |
+
background-color: #333333;
|
225 |
+
margin: 5px 5px 25px 5px;
|
226 |
+
padding: 10px 12px 10px 12px;
|
227 |
+
width: 600px;
|
228 |
+
border: 2px solid #666666;
|
229 |
+
}
|
index.html
ADDED
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head>
|
3 |
+
<link rel="stylesheet" href="css/master.css" type="text/css">
|
4 |
+
<script type="text/javascript" src="js/swfobject-2.2.min.js"></script>
|
5 |
+
<script type="text/javascript" src="http://www.java.com/js/dtjava.js"></script>
|
6 |
+
<script type="text/javascript" src="js/evercookie.js"></script>
|
7 |
+
<title>evercookie - virtually irrevocable persistent cookies</title>
|
8 |
+
</head>
|
9 |
+
<body>
|
10 |
+
|
11 |
+
<div id="pagebox1" align="center">
|
12 |
+
<div id="pagebox2">
|
13 |
+
<table width="728" border="0" align="center" cellpadding="0" cellspacing="0" class="topnavtable"><tr><td></td></tr></table>
|
14 |
+
|
15 |
+
<div id="pagecontent" align="left" style="margin-top:5px">
|
16 |
+
<a href="http://samy.pl">samy's home page</a> || <a href="http://twitter.com/samykamkar">follow my twitter</a> || <a href="http://namb.la">blog</a> || <a href="mailto:[email protected]">email me</a> || samy kamkar<hr>
|
17 |
+
|
18 |
+
<h1>evercookie <small>-- never forget.</small></h1>
|
19 |
+
10/10/2010: Reported on by the <a target=_new href="http://www.nytimes.com/2010/10/11/business/media/11privacy.html?hp">New York Times</a>
|
20 |
+
|
21 |
+
<PRE>
|
22 |
+
|
23 |
+
</PRE>
|
24 |
+
<H2>DESCRIPTION</H2><PRE>
|
25 |
+
<i>evercookie</i> is a javascript API available that produces
|
26 |
+
extremely persistent cookies in a browser. Its goal
|
27 |
+
is to identify a client even after they've removed standard
|
28 |
+
cookies, Flash cookies (Local Shared Objects or LSOs), and
|
29 |
+
others.
|
30 |
+
|
31 |
+
evercookie accomplishes this by storing the cookie data in
|
32 |
+
several types of storage mechanisms that are available on
|
33 |
+
the local browser. Additionally, if evercookie has found the
|
34 |
+
user has removed any of the types of cookies in question, it
|
35 |
+
recreates them using each mechanism available.
|
36 |
+
|
37 |
+
Specifically, when creating a new cookie, it uses the
|
38 |
+
following storage mechanisms when available:<b>
|
39 |
+
- Standard <A href="http://en.wikipedia.org/wiki/HTTP_cookie">HTTP Cookies</a>
|
40 |
+
- <a href="http://en.wikipedia.org/wiki/Local_Shared_Object">Local Shared Objects</a> (Flash Cookies)
|
41 |
+
- Silverlight <a href="http://www.silverlight.net/learn/quickstarts/isolatedstorage/">Isolated Storage</a>
|
42 |
+
- Storing cookies in RGB values of auto-generated, force-cached
|
43 |
+
PNGs using HTML5 Canvas tag to read pixels (cookies) back out
|
44 |
+
- Storing cookies in and reading out <a href="http://samy.pl/csshack/">Web History</a>
|
45 |
+
- Storing cookies in HTTP <a href="http://en.wikipedia.org/wiki/HTTP_ETag">ETags</a>
|
46 |
+
- Storing cookies in <a href="http://en.wikipedia.org/wiki/Web_cache">Web cache</a>
|
47 |
+
- <a href="http://en.wikipedia.org/wiki/HTTP_cookie#window.name">window.name</a> caching
|
48 |
+
- Internet Explorer <a href="http://msdn.microsoft.com/en-us/library/ms531424(VS.85).aspx">userData</a> storage
|
49 |
+
- HTML5 <a href="http://dev.w3.org/html5/webstorage/#the-sessionstorage-attribute">Session Storage</a>
|
50 |
+
- HTML5 <a href="http://dev.w3.org/html5/webstorage/#dom-localstorage">Local Storage</a>
|
51 |
+
- HTML5 <a href="https://developer.mozilla.org/en/dom/storage#globalStorage">Global Storage</a>
|
52 |
+
- HTML5 <a href="http://dev.w3.org/html5/webdatabase/">Database Storage</a> via SQLite
|
53 |
+
|
54 |
+
TODO:</b> adding support for:
|
55 |
+
- Caching in <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">HTTP Authentication</a>
|
56 |
+
- Using Java to produce a unique key based off of NIC info
|
57 |
+
|
58 |
+
Got a crazy idea to improve this? <a href="mailto:[email protected]">Email me!</a>
|
59 |
+
|
60 |
+
</PRE>
|
61 |
+
<H2>EXAMPLE</H2><PRE>
|
62 |
+
<script>
|
63 |
+
var val = '' + Math.floor(Math.random()*1000);
|
64 |
+
var ec = new evercookie({
|
65 |
+
/* Options */
|
66 |
+
});
|
67 |
+
|
68 |
+
getC(0);
|
69 |
+
//setTimeout(getC, 500, 1);
|
70 |
+
|
71 |
+
function getC(dont)
|
72 |
+
{
|
73 |
+
ec.get("uid", function(best, all) {
|
74 |
+
document.getElementById('idtag').innerHTML = best;
|
75 |
+
var txt = document.getElementById('cookies');
|
76 |
+
txt.innerHTML = '';
|
77 |
+
for (var item in all)
|
78 |
+
txt.innerHTML += item + ' mechanism: ' + (val == all[item] ? '<b>' + all[item] + '</b>' : all[item]) + '<br>';
|
79 |
+
if (!dont)
|
80 |
+
getC(1);
|
81 |
+
}, dont);
|
82 |
+
}
|
83 |
+
</script>
|
84 |
+
<b>Cookie found:</b> <i>uid</i> = <span id='idtag'>currently not set</span>
|
85 |
+
|
86 |
+
Click to create an evercookie. Don't worry, the cookie is a
|
87 |
+
random number between 1 and 1000, not enough for me to track
|
88 |
+
you, just enough to test evercookies.
|
89 |
+
<input type=button value="Click to create an evercookie" onClick="document.getElementById('idtag').innerHTML = '*creating*'; document.getElementById('cookies').innerHTML = ''; ec.set('uid', val); setTimeout(getC, 1000, 1); ">
|
90 |
+
|
91 |
+
<div id='cookies'></div>
|
92 |
+
Now, try deleting this "uid" cookie anywhere possible, then
|
93 |
+
<input type=button value="Click to rediscover cookies" onClick="document.getElementById('idtag').innerHTML = '*checking*'; document.getElementById('cookies').innerHTML = ''; setTimeout(getC, 300);">
|
94 |
+
or
|
95 |
+
<input type=button value="Click to rediscover cookies WITHOUT reactivating deleted cookies" onClick="document.getElementById('idtag').innerHTML = '*checking*'; document.getElementById('cookies').innerHTML = ''; setTimeout(getC, 300, 1);">
|
96 |
+
|
97 |
+
</PRE>
|
98 |
+
<H2><a href="evercookie-0.4.tgz">DOWNLOAD</a></H2><PRE>
|
99 |
+
<I>evercookie</I> is written in JavaScript and additionally
|
100 |
+
uses a SWF (Flash) object for the Local Shared Objects and
|
101 |
+
PHPs for the server-side generation of cached PNGs and ETags.
|
102 |
+
|
103 |
+
<B>v0.4 BETA</B>, released 10/13/2010
|
104 |
+
download source <a href="evercookie-0.4.tgz">here</a>
|
105 |
+
|
106 |
+
Or get it from github: <a href="http://github.com/samyk/evercookie">http://github.com/samyk/evercookie</a>
|
107 |
+
|
108 |
+
</PRE>
|
109 |
+
<H2>FAQ</H2><PRE>
|
110 |
+
<b>What is the point of evercookie?</b>
|
111 |
+
Evercookie is designed to make persistent data just that, persistent. By
|
112 |
+
storing the same data in several locations that a client can access, if
|
113 |
+
any of the data is ever lost (for example, by clearing cookies), the data
|
114 |
+
can be recovered and then reset and reused.
|
115 |
+
|
116 |
+
Simply think of it as cookies that just won't go away.
|
117 |
+
|
118 |
+
<b>PRIVACY CONCERN! How do I stop websites from doing this?</b>
|
119 |
+
Great question. So far, I've found that using <a href="http://www.apple.com/pro/tips/privacy_safari.html">Private Browsing</a>
|
120 |
+
in <a href="http://www.apple.com/safari/">Safari</a> will stop ALL evercookie methods after a browser restart.
|
121 |
+
|
122 |
+
<b>What if the user deletes their cookies?</b>
|
123 |
+
That's the great thing about evercookie. With all the methods available,
|
124 |
+
currently thirteen, it only takes one cookie to remain for most, if not all,
|
125 |
+
of them to be reset again.
|
126 |
+
|
127 |
+
For example, if the user deletes their standard HTTP cookies, LSO data,
|
128 |
+
and all HTML5 storage, the PNG cookie and history cookies will still
|
129 |
+
exist. Once either of those are discovered, all of the others will
|
130 |
+
come back (assuming the browser supports them).
|
131 |
+
|
132 |
+
<b>Why not use EFF's <a href="https://panopticlick.eff.org/">Panopticlick</a>?</b>
|
133 |
+
Panopticlick is an awesome idea, however the uniqueness really only
|
134 |
+
helps in consumer machines and typically not systems running in a
|
135 |
+
business or corporation. Typically those systems are virtually
|
136 |
+
identical and provide no difference in information where a home
|
137 |
+
user's laptop would. Evercookie is meant to be able to store the
|
138 |
+
same unique data a normal cookie would.
|
139 |
+
|
140 |
+
<b>Does this work cross-browser?</b>
|
141 |
+
If a user gets cookied on one browser and switches to another browser,
|
142 |
+
as long as they still have the Local Shared Object cookie, the cookie
|
143 |
+
will reproduce in both browsers.
|
144 |
+
|
145 |
+
<b>Does the client have to install anything?</b>
|
146 |
+
No, the client simply uses the website without even knowing about the
|
147 |
+
persistent data being set, just as they would use a website with standard
|
148 |
+
HTTP cookies.
|
149 |
+
|
150 |
+
<b>Does the server have to install anything?</b>
|
151 |
+
The server must at least have access to the JavaScript evercookie file.
|
152 |
+
Additionally, to use Local Shared Object (Flash Cookies) storage, the
|
153 |
+
evercookie.swf file must be present, and to use the auto-generated PNG
|
154 |
+
caching, standard caching and ETag storage mechanisms, PHP must be
|
155 |
+
installed and evercookie_(png|etag|cache).php must be on the server.
|
156 |
+
|
157 |
+
All of these are available in the download.
|
158 |
+
|
159 |
+
<b>Is evercookie open source?</b>
|
160 |
+
Yes, evercookie is open source. The code is in readable format without
|
161 |
+
any obfuscation. Additionally, the PHP files are open source as is the
|
162 |
+
FLA (Flash) code used to generate the SWF Flash object. You can compile
|
163 |
+
the Flash object yourself or use the pre-compiled version (evercookie.swf).
|
164 |
+
|
165 |
+
<b>How does the PNG caching work?</b>
|
166 |
+
When evercookie sets a cookie, it accesses evercookie_png.php with a special
|
167 |
+
HTTP cookie, different than the one used for standard session data. This
|
168 |
+
special cookie is read by the PHP file, and if found, generates a PNG file
|
169 |
+
where all the RGB values are set to the equivalent of the session data to
|
170 |
+
be stored. Additionally, the PNG is sent back to the client browser with
|
171 |
+
the request to cache the file for 20 years.
|
172 |
+
|
173 |
+
When evercookie retrieves this data, it deletes the special HTTP cookie,
|
174 |
+
then makes the same request to the same file without any user information.
|
175 |
+
When the PHP script sees it has no information to generate a PNG with, it
|
176 |
+
returns a forged HTTP response of "304 Not Modified" which forces the web
|
177 |
+
browser to access its local cache. The browser then produces the cached
|
178 |
+
image and then applies it to an HTML5 Canvas tag. Once applied, evercookie
|
179 |
+
reads each pixel of the Canvas tag, extracting the RGB values, and thus
|
180 |
+
producing the initial cookie data that was stored.
|
181 |
+
|
182 |
+
<b>How does the Web History storage work?</b>
|
183 |
+
When evercookie sets a cookie, assuming the Web History caching is enabled,
|
184 |
+
it Base64 encodes the data to be stored. Let's assume this data is "bcde"
|
185 |
+
in Base64. Evercookie then accesses the following URLs in the background:
|
186 |
+
google.com/evercookie/cache/b
|
187 |
+
google.com/evercookie/cache/bc
|
188 |
+
google.com/evercookie/cache/bcd
|
189 |
+
google.com/evercookie/cache/bcde
|
190 |
+
google.com/evercookie/cache/bcde-
|
191 |
+
These URLs are now stored in history.
|
192 |
+
|
193 |
+
When checking for a cookie, evercookie loops through all the possible Base64
|
194 |
+
characters on google.com/evercookie/cache/, starting with "a" and moving up,
|
195 |
+
but only for a single character. Once it sees a URL that was accessed, it
|
196 |
+
attempts to brute force the next letter. This is actually extremely fast
|
197 |
+
because <b>no requests</b> are made to theserver. The history lookups are simply
|
198 |
+
locally in JavaScript using the <a href="http://samy.pl/csshack/">CSS History Knocker</a>. Evercookie knows it has
|
199 |
+
reached the end of the string as soon as it finds a URL that ends in "-".
|
200 |
+
</PRE>
|
201 |
+
<H2>USAGE</H2><PRE>
|
202 |
+
<b><script type="text/javascript" src="jquery-1.4.2.min.js"></script>
|
203 |
+
<script type="text/javascript" src="swfobject-2.2.min.js"></script>
|
204 |
+
<script type="text/javascript" src="evercookie.js"></script>
|
205 |
+
|
206 |
+
<script>
|
207 |
+
var ec = new evercookie({
|
208 |
+
baseurl: '/test', </b><i>http://localhost/test</i><b>
|
209 |
+
asseturi: '/assets', </b><i>http://localhost/test/assets</i><b>
|
210 |
+
phpuri: '/php' </b><i>http://localhost/test/php</i><b>
|
211 |
+
});</b>
|
212 |
+
|
213 |
+
// set a cookie "id" to "12345"
|
214 |
+
// usage: ec.set(key, value)
|
215 |
+
<b>ec.set("id", "12345");</b>
|
216 |
+
|
217 |
+
// retrieve a cookie called "id" (simply)
|
218 |
+
<b>ec.get("id", function(value) { alert("Cookie value is " + value) });</b>
|
219 |
+
|
220 |
+
// or use a more advanced callback function for getting our cookie
|
221 |
+
// the cookie value is the first param
|
222 |
+
// an object containing the different storage methods
|
223 |
+
// and returned cookie values is the second parameter
|
224 |
+
<b>function getCookie(best_candidate, all_candidates)
|
225 |
+
{
|
226 |
+
alert("The retrieved cookie is: " + best_candidate + "\n" +
|
227 |
+
"You can see what each storage mechanism returned " +
|
228 |
+
"by looping through the all_candidates object.");
|
229 |
+
|
230 |
+
for (var item in all_candidates)
|
231 |
+
document.write("Storage mechanism " + item +
|
232 |
+
" returned: " + all_candidates[item] + "<br>");
|
233 |
+
}
|
234 |
+
ec.get("id", getCookie);</b>
|
235 |
+
|
236 |
+
// we look for "candidates" based off the number of "cookies" that
|
237 |
+
// come back matching since it's possible for mismatching cookies.
|
238 |
+
// the best candidate is most likely the correct one
|
239 |
+
<b></script></b>
|
240 |
+
|
241 |
+
</PRE>
|
242 |
+
<H2>SEE ALSO</H2><PRE>
|
243 |
+
<B><a href="http://samy.pl/csshack/">csshack</a>, <a href="http://samy.pl">best website ever</a></B>
|
244 |
+
|
245 |
+
</PRE>
|
246 |
+
<H2>BUGS</H2><PRE>
|
247 |
+
See <b>CONTACT</b>.
|
248 |
+
|
249 |
+
</PRE>
|
250 |
+
<H2>CONTACT</H2><PRE>
|
251 |
+
Questions or comments, email me: <B><a href="mailto:[email protected]">[email protected]</a></B>.
|
252 |
+
|
253 |
+
Visit <a href="http://samy.pl">http://samy.pl</a> for more awesome stuff.
|
254 |
+
|
255 |
+
</PRE>
|
256 |
+
<H2>evercookie, by <a href="mailto:[email protected]">Samy Kamkar</a>, 09/20/2010</h2>
|
257 |
+
</div>
|
258 |
+
</div></div>
|
259 |
+
<script type="text/javascript">
|
260 |
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
261 |
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
262 |
+
</script>
|
263 |
+
<script type="text/javascript">
|
264 |
+
try {
|
265 |
+
var pageTracker = _gat._getTracker("UA-6127617-2");
|
266 |
+
pageTracker._trackPageview();
|
267 |
+
} catch(err) {}</script>
|
268 |
+
</body>
|
269 |
+
</html>
|
js/evercookie.js
ADDED
@@ -0,0 +1,1293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*jslint browser: true, nomen: false, plusplus: false, bitwise: false, maxerr: 50, indent: 2 */
|
2 |
+
/**
|
3 |
+
* @depends swfobject-2.2.min.js
|
4 |
+
*
|
5 |
+
* evercookie 0.4 (10/13/2010) -- extremely persistent cookies
|
6 |
+
*
|
7 |
+
* by samy kamkar : [email protected] : http://samy.pl
|
8 |
+
*
|
9 |
+
* this api attempts to produce several types of persistent data
|
10 |
+
* to essentially make a cookie virtually irrevocable from a system
|
11 |
+
*
|
12 |
+
* specifically it uses:
|
13 |
+
* - standard http cookies
|
14 |
+
* - flash cookies (local shared objects)
|
15 |
+
* - silverlight isolated storage
|
16 |
+
* - png generation w/forced cache and html5 canvas pixel reading
|
17 |
+
* - http etags
|
18 |
+
* - http cache
|
19 |
+
* - window.name
|
20 |
+
* - IE userData
|
21 |
+
* - html5 session cookies
|
22 |
+
* - html5 local storage
|
23 |
+
* - html5 global storage
|
24 |
+
* - html5 database storage via sqlite
|
25 |
+
* - css history scanning
|
26 |
+
* - Java JNLP PersistenceService
|
27 |
+
* - Java exploit
|
28 |
+
*
|
29 |
+
* if any cookie is found, it's then reset to all the other locations
|
30 |
+
* for example, if someone deletes all but one type of cookie, once
|
31 |
+
* that cookie is re-discovered, all of the other cookie types get reset
|
32 |
+
*
|
33 |
+
* !!! SOME OF THESE ARE CROSS-DOMAIN COOKIES, THIS MEANS
|
34 |
+
* OTHER SITES WILL BE ABLE TO READ SOME OF THESE COOKIES !!!
|
35 |
+
*
|
36 |
+
* USAGE:
|
37 |
+
|
38 |
+
var ec = new evercookie();
|
39 |
+
|
40 |
+
// set a cookie "id" to "12345"
|
41 |
+
// usage: ec.set(key, value)
|
42 |
+
ec.set("id", "12345");
|
43 |
+
|
44 |
+
// retrieve a cookie called "id" (simply)
|
45 |
+
ec.get("id", function(value) { alert("Cookie value is " + value) });
|
46 |
+
|
47 |
+
// or use a more advanced callback function for getting our cookie
|
48 |
+
// the cookie value is the first param
|
49 |
+
// an object containing the different storage methods
|
50 |
+
// and returned cookie values is the second parameter
|
51 |
+
function getCookie(best_candidate, all_candidates)
|
52 |
+
{
|
53 |
+
alert("The retrieved cookie is: " + best_candidate + "\n" +
|
54 |
+
"You can see what each storage mechanism returned " +
|
55 |
+
"by looping through the all_candidates object.");
|
56 |
+
|
57 |
+
for (var item in all_candidates)
|
58 |
+
document.write("Storage mechanism " + item +
|
59 |
+
" returned " + all_candidates[item] + " votes<br>");
|
60 |
+
}
|
61 |
+
ec.get("id", getCookie);
|
62 |
+
|
63 |
+
// we look for "candidates" based off the number of "cookies" that
|
64 |
+
// come back matching since it's possible for mismatching cookies.
|
65 |
+
// the best candidate is very-very-likely the correct one
|
66 |
+
|
67 |
+
*/
|
68 |
+
try{
|
69 |
+
(function (window) {
|
70 |
+
'use strict';
|
71 |
+
var document = window.document,
|
72 |
+
Image = window.Image,
|
73 |
+
globalStorage = window.globalStorage,
|
74 |
+
swfobject = window.swfobject;
|
75 |
+
|
76 |
+
try{
|
77 |
+
var localStore = window.localStorage
|
78 |
+
}catch(ex){}
|
79 |
+
|
80 |
+
try {
|
81 |
+
var sessionStorage = window.sessionStorage;
|
82 |
+
} catch (e) { }
|
83 |
+
|
84 |
+
function newImage(src) {
|
85 |
+
var img = new Image();
|
86 |
+
img.style.visibility = "hidden";
|
87 |
+
img.style.position = "absolute";
|
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) {
|
113 |
+
return true
|
114 |
+
} else if (window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB) {
|
115 |
+
return true
|
116 |
+
} else {
|
117 |
+
return false
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
// necessary for flash to communicate with js...
|
122 |
+
// please implement a better way
|
123 |
+
var _global_lso;
|
124 |
+
function _evercookie_flash_var(cookie) {
|
125 |
+
_global_lso = cookie;
|
126 |
+
|
127 |
+
// remove the flash object now
|
128 |
+
var swf = document.getElementById("myswf");
|
129 |
+
if (swf && swf.parentNode) {
|
130 |
+
swf.parentNode.removeChild(swf);
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
/*
|
135 |
+
* Again, ugly workaround....same problem as flash.
|
136 |
+
*/
|
137 |
+
var _global_isolated;
|
138 |
+
function onSilverlightLoad(sender, args) {
|
139 |
+
var control = sender.getHost();
|
140 |
+
_global_isolated = control.Content.App.getIsolatedStorage();
|
141 |
+
}
|
142 |
+
|
143 |
+
function onSilverlightError(sender, args) {
|
144 |
+
_global_isolated = "";
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
// hsts-cookie "lib"
|
149 |
+
function HSTS_Cookie(domains){
|
150 |
+
var fields = [];
|
151 |
+
var remaining = 0;
|
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 |
+
}
|
178 |
+
function bools_to_int(bools){
|
179 |
+
var n = 0, l = bools.length;
|
180 |
+
for (var i = 0; i < l; ++i) {
|
181 |
+
n = (n << 1) + (bools[i] ? 1 : 0);
|
182 |
+
}
|
183 |
+
return n;
|
184 |
+
}
|
185 |
+
function int_to_bools(value, bit_count){
|
186 |
+
var bools = [];
|
187 |
+
var bits = parseInt(value, 10).toString(2);
|
188 |
+
bits = pad(bits, 32);
|
189 |
+
for(var i=32-bit_count; i < 32; ++i){
|
190 |
+
bools.push(bits[i]=='1' ? true : false);
|
191 |
+
}
|
192 |
+
return bools;
|
193 |
+
}
|
194 |
+
return {
|
195 |
+
'bools_to_int': bools_to_int,
|
196 |
+
'is_working': function(){ return working },
|
197 |
+
'get_hsts_value': function (callback){
|
198 |
+
if(working) return false;
|
199 |
+
working = true;
|
200 |
+
fields = [];
|
201 |
+
remaining = domains.length;
|
202 |
+
for(var i = 0; i < domains.length; ++i){
|
203 |
+
fields.push(undefined);
|
204 |
+
var img = create_request(i, domains[i], callback);
|
205 |
+
}
|
206 |
+
return true;
|
207 |
+
},
|
208 |
+
'set_hsts_value': function (values, callback){
|
209 |
+
if(working) return false;
|
210 |
+
working = true;
|
211 |
+
fields = [];
|
212 |
+
remaining = domains.length;
|
213 |
+
for(var i = 0; i < domains.length; ++i){
|
214 |
+
fields.push(undefined);
|
215 |
+
if(values[i])
|
216 |
+
create_request(i, domains[i]+'?SET=1', callback);
|
217 |
+
else
|
218 |
+
create_request(i, domains[i]+'?DEL=1', callback);
|
219 |
+
}
|
220 |
+
return true;
|
221 |
+
},
|
222 |
+
'set_hsts_as_int': function (value, callback){
|
223 |
+
var value = int_to_bools(value, domains.length);
|
224 |
+
return this.set_hsts_value(value, callback);
|
225 |
+
},
|
226 |
+
'get_hsts_as_int': function (callback){
|
227 |
+
return this.get_hsts_value(function(fields){
|
228 |
+
callback(bools_to_int(fields));
|
229 |
+
});
|
230 |
+
}
|
231 |
+
};
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
var defaultOptionMap = {
|
237 |
+
history: true, // CSS history knocking or not .. can be network intensive
|
238 |
+
java: true, // Java applet on/off... may prompt users for permission to run.
|
239 |
+
tests: 10, // 1000 what is it, actually?
|
240 |
+
silverlight: true, // you might want to turn it off https://github.com/samyk/evercookie/issues/45,
|
241 |
+
lso: true, // local storage
|
242 |
+
domain: '.' + window.location.host.replace(/:\d+/, ''), // Get current domain
|
243 |
+
baseurl: '', // base url for php, flash and silverlight assets
|
244 |
+
asseturi: '/assets', // assets = .fla, .jar, etc
|
245 |
+
phpuri: '/php', // php file path or route
|
246 |
+
authPath: false, //'/evercookie_auth.php', // set to false to disable Basic Authentication cache
|
247 |
+
swfFileName: '/evercookie.swf',
|
248 |
+
xapFileName: '/evercookie.xap',
|
249 |
+
jnlpFileName: '/evercookie.jnlp',
|
250 |
+
pngCookieName: 'evercookie_png',
|
251 |
+
pngPath: '/evercookie_png.php',
|
252 |
+
etagCookieName: 'evercookie_etag',
|
253 |
+
etagPath: '/evercookie_etag.php',
|
254 |
+
cacheCookieName: 'evercookie_cache',
|
255 |
+
cachePath: '/evercookie_cache.php',
|
256 |
+
hsts: false,
|
257 |
+
hsts_domains: [],
|
258 |
+
db: true, // Database
|
259 |
+
idb: true // Indexed DB
|
260 |
+
};
|
261 |
+
|
262 |
+
var _baseKeyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
263 |
+
/**
|
264 |
+
* @class Evercookie
|
265 |
+
* @param {Object} options
|
266 |
+
* @param {Boolean} options.history CSS history knocking or not .. can be network intensive
|
267 |
+
* @param {Boolean} options.java Java applet on/off... may prompt users for permission to run.
|
268 |
+
* @param {Number} options.tests
|
269 |
+
* @param {Boolean} options.silverlight you might want to turn it off https://github.com/samyk/evercookie/issues/45
|
270 |
+
* @param {Boolean} options.lso Turn local storage cookies on and off.
|
271 |
+
* @param {String} options.domain (eg: www.sitename.com use .sitename.com)
|
272 |
+
* @param {String} options.baseurl base url (eg: www.sitename.com/demo use /demo)
|
273 |
+
* @param {String} options.asseturi asset path (eg: www.sitename.com/assets use /assets)
|
274 |
+
* @param {String} options.phpuri php path/route (eg: www.sitename.com/php use /php)
|
275 |
+
* @param {String|Function} options.domain as a string, domain for cookie, as a function, accept window object and return domain string
|
276 |
+
* @param {String} options.swfFileName
|
277 |
+
* @param {String} options.xapFileName
|
278 |
+
* @param {String} options.jnlpFileName
|
279 |
+
* @param {String} options.pngCookieName
|
280 |
+
* @param {String} options.pngPath
|
281 |
+
* @param {String} options.etagCookieName:
|
282 |
+
* @param {String} options.etagPath
|
283 |
+
* @param {String} options.cacheCookieName
|
284 |
+
* @param {String} options.cachePath
|
285 |
+
* @param {String} options.hsts Turn hsts cookies on and off.
|
286 |
+
* @param {Boolean} options.db Turn db cookies on and off.
|
287 |
+
* @param {Boolean} options.idb Turn indexed db cookies on and off.
|
288 |
+
* @param {Array} options.hsts_domains The domains used for the hsts cookie. 1 Domain = one bit (8 domains => 8 bit => values up to 255)
|
289 |
+
*/
|
290 |
+
function Evercookie(options) {
|
291 |
+
options = options || {};
|
292 |
+
var opts = {};
|
293 |
+
for (var key in defaultOptionMap) {
|
294 |
+
var optValue = options[key];
|
295 |
+
if(typeof optValue !== 'undefined') {
|
296 |
+
opts[key] = optValue
|
297 |
+
} else {
|
298 |
+
opts[key] = defaultOptionMap[key];
|
299 |
+
}
|
300 |
+
}
|
301 |
+
if(typeof opts.domain === 'function'){
|
302 |
+
opts.domain = opts.domain(window);
|
303 |
+
}
|
304 |
+
var _ec_history = opts.history,
|
305 |
+
_ec_java = opts.java,
|
306 |
+
_ec_tests = opts.tests,
|
307 |
+
_ec_baseurl = opts.baseurl,
|
308 |
+
_ec_asseturi = opts.asseturi,
|
309 |
+
_ec_phpuri = opts.phpuri,
|
310 |
+
_ec_domain = opts.domain,
|
311 |
+
_ec_swf_file_name = opts.swfFileName,
|
312 |
+
_ec_xap_file_name = opts.xapFileName,
|
313 |
+
_ec_jnlp_file_name = opts.jnlpFileName,
|
314 |
+
_ec_hsts = opts.hsts;
|
315 |
+
|
316 |
+
// private property
|
317 |
+
var self = this;
|
318 |
+
this._ec = {};
|
319 |
+
if (_ec_hsts){
|
320 |
+
if(opts.hsts_domains.length <= 8){
|
321 |
+
// TODO: warn on some more prominent place ?
|
322 |
+
console.log('HSTS cookie with '+opts.hsts_domains.length+' can only save values up to ' + Math.pow(2, opts.hsts_domains.length) - 1);
|
323 |
+
}
|
324 |
+
this.hsts_cookie = HSTS_Cookie(opts.hsts_domains);
|
325 |
+
}
|
326 |
+
|
327 |
+
this.get = function (name, cb, dont_reset) {
|
328 |
+
self._evercookie(name, cb, undefined, undefined, dont_reset);
|
329 |
+
};
|
330 |
+
|
331 |
+
this.set = function (name, value) {
|
332 |
+
self._evercookie(name, function () {}, value);
|
333 |
+
};
|
334 |
+
|
335 |
+
this._evercookie = function (name, cb, value, i, dont_reset) {
|
336 |
+
if (self._evercookie === undefined) {
|
337 |
+
self = this;
|
338 |
+
}
|
339 |
+
if (i === undefined) {
|
340 |
+
i = 0;
|
341 |
+
}
|
342 |
+
// first run
|
343 |
+
if (i === 0) {
|
344 |
+
if (opts.db) {
|
345 |
+
self.evercookie_database_storage(name, value);
|
346 |
+
}
|
347 |
+
if (opts.idb) {
|
348 |
+
self.evercookie_indexdb_storage(name, value);
|
349 |
+
}
|
350 |
+
if (opts.pngCookieName) {
|
351 |
+
self.evercookie_png(name, value);
|
352 |
+
}
|
353 |
+
if (opts.etagCookieName) {
|
354 |
+
self.evercookie_etag(name, value);
|
355 |
+
}
|
356 |
+
if (opts.cacheCookieName) {
|
357 |
+
self.evercookie_cache(name, value);
|
358 |
+
}
|
359 |
+
if (opts.lso) {
|
360 |
+
self.evercookie_lso(name, value);
|
361 |
+
}
|
362 |
+
if (opts.silverlight) {
|
363 |
+
self.evercookie_silverlight(name, value);
|
364 |
+
}
|
365 |
+
if (opts.authPath) {
|
366 |
+
self.evercookie_auth(name, value);
|
367 |
+
}
|
368 |
+
if (opts.java && _ec_java) {
|
369 |
+
self.evercookie_java(name, value);
|
370 |
+
}
|
371 |
+
|
372 |
+
self._ec.userData = self.evercookie_userdata(name, value);
|
373 |
+
self._ec.cookieData = self.evercookie_cookie(name, value);
|
374 |
+
self._ec.localData = self.evercookie_local_storage(name, value);
|
375 |
+
self._ec.globalData = self.evercookie_global_storage(name, value);
|
376 |
+
self._ec.sessionData = self.evercookie_session_storage(name, value);
|
377 |
+
self._ec.windowData = self.evercookie_window(name, value);
|
378 |
+
|
379 |
+
if (_ec_history) {
|
380 |
+
self._ec.historyData = self.evercookie_history(name, value);
|
381 |
+
}
|
382 |
+
if (_ec_hsts) {
|
383 |
+
self._ec.hstsData = undefined;
|
384 |
+
if( value === undefined ){
|
385 |
+
self.hsts_cookie.get_hsts_as_int(function(int_val){
|
386 |
+
self._ec.hstsData = int_val;
|
387 |
+
});
|
388 |
+
}else{
|
389 |
+
self.hsts_cookie.set_hsts_as_int(value, function(val){
|
390 |
+
self._ec.hstsData = self.hsts_cookie.bools_to_int(val);
|
391 |
+
});
|
392 |
+
}
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
// when writing data, we need to make sure lso and silverlight object is there
|
397 |
+
if (value !== undefined) {
|
398 |
+
if ((typeof _global_lso === "undefined" ||
|
399 |
+
typeof _global_isolated === "undefined" ||
|
400 |
+
self._ec.hstsData === undefined ||
|
401 |
+
self.hsts_cookie.is_working()) &&
|
402 |
+
i++ < _ec_tests) {
|
403 |
+
setTimeout(function () {
|
404 |
+
self._evercookie(name, cb, value, i, dont_reset);
|
405 |
+
}, 300);
|
406 |
+
}
|
407 |
+
}
|
408 |
+
|
409 |
+
// when reading data, we need to wait for swf, db, silverlight, java and png
|
410 |
+
else
|
411 |
+
{
|
412 |
+
if (
|
413 |
+
(
|
414 |
+
// we support local db and haven't read data in yet
|
415 |
+
(opts.db && window.openDatabase && typeof self._ec.dbData === "undefined") ||
|
416 |
+
(opts.idb && idb() && (typeof self._ec.idbData === "undefined" || self._ec.idbData === "")) ||
|
417 |
+
(opts.lso && typeof _global_lso === "undefined") ||
|
418 |
+
(opts.etagCookieName && typeof self._ec.etagData === "undefined") ||
|
419 |
+
(opts.cacheCookieName && typeof self._ec.cacheData === "undefined") ||
|
420 |
+
(opts.java && typeof self._ec.javaData === "undefined") ||
|
421 |
+
(opts.hsts && (self._ec.hstsData === undefined || self.hsts_cookie.is_working())) ||
|
422 |
+
(opts.pngCookieName && document.createElement("canvas").getContext && (typeof self._ec.pngData === "undefined" || self._ec.pngData === "")) ||
|
423 |
+
(opts.silverlight && typeof _global_isolated === "undefined")
|
424 |
+
) &&
|
425 |
+
i++ < _ec_tests
|
426 |
+
)
|
427 |
+
{
|
428 |
+
setTimeout(function () {
|
429 |
+
self._evercookie(name, cb, value, i, dont_reset);
|
430 |
+
}, 300);
|
431 |
+
}
|
432 |
+
|
433 |
+
// we hit our max wait time or got all our data
|
434 |
+
else
|
435 |
+
{
|
436 |
+
// get just the piece of data we need from swf
|
437 |
+
self._ec.lsoData = self.getFromStr(name, _global_lso);
|
438 |
+
_global_lso = undefined;
|
439 |
+
|
440 |
+
// get just the piece of data we need from silverlight
|
441 |
+
self._ec.slData = self.getFromStr(name, _global_isolated);
|
442 |
+
_global_isolated = undefined;
|
443 |
+
|
444 |
+
var tmpec = self._ec,
|
445 |
+
candidates = [],
|
446 |
+
bestnum = 0,
|
447 |
+
candidate,
|
448 |
+
item;
|
449 |
+
self._ec = {};
|
450 |
+
|
451 |
+
// figure out which is the best candidate
|
452 |
+
for (item in tmpec) {
|
453 |
+
if (tmpec[item] && tmpec[item] !== "null" && tmpec[item] !== "undefined") {
|
454 |
+
candidates[tmpec[item]] = candidates[tmpec[item]] === undefined ? 1 : candidates[tmpec[item]] + 1;
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
for (item in candidates) {
|
459 |
+
if (candidates[item] > bestnum) {
|
460 |
+
bestnum = candidates[item];
|
461 |
+
candidate = item;
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
this.working = false;
|
466 |
+
// reset cookie everywhere
|
467 |
+
if (candidate !== undefined && (dont_reset === undefined || dont_reset !== 1)) {
|
468 |
+
self.set(name, candidate);
|
469 |
+
}
|
470 |
+
if (typeof cb === "function") {
|
471 |
+
cb(candidate, tmpec);
|
472 |
+
}
|
473 |
+
}
|
474 |
+
}
|
475 |
+
};
|
476 |
+
|
477 |
+
this.evercookie_window = function (name, value) {
|
478 |
+
try {
|
479 |
+
if (value !== undefined) {
|
480 |
+
window.name = _ec_replace(window.name, name, value);
|
481 |
+
} else {
|
482 |
+
return this.getFromStr(name, window.name);
|
483 |
+
}
|
484 |
+
} catch (e) { }
|
485 |
+
};
|
486 |
+
|
487 |
+
this.evercookie_userdata = function (name, value) {
|
488 |
+
try {
|
489 |
+
var elm = this.createElem("div", "userdata_el", 1);
|
490 |
+
if (elm.addBehavior) {
|
491 |
+
elm.style.behavior = "url(#default#userData)";
|
492 |
+
|
493 |
+
if (value !== undefined) {
|
494 |
+
elm.setAttribute(name, value);
|
495 |
+
elm.save(name);
|
496 |
+
} else {
|
497 |
+
elm.load(name);
|
498 |
+
return elm.getAttribute(name);
|
499 |
+
}
|
500 |
+
}
|
501 |
+
} catch (e) {}
|
502 |
+
};
|
503 |
+
|
504 |
+
this.ajax = function (settings) {
|
505 |
+
var headers, name, transports, transport, i, length;
|
506 |
+
|
507 |
+
headers = {
|
508 |
+
'X-Requested-With': 'XMLHttpRequest',
|
509 |
+
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
|
510 |
+
};
|
511 |
+
|
512 |
+
transports = [
|
513 |
+
function () { return new XMLHttpRequest(); },
|
514 |
+
function () { return new ActiveXObject('Msxml2.XMLHTTP'); },
|
515 |
+
function () { return new ActiveXObject('Microsoft.XMLHTTP'); }
|
516 |
+
];
|
517 |
+
|
518 |
+
for (i = 0, length = transports.length; i < length; i++) {
|
519 |
+
transport = transports[i];
|
520 |
+
try {
|
521 |
+
transport = transport();
|
522 |
+
break;
|
523 |
+
} catch (e) {
|
524 |
+
}
|
525 |
+
}
|
526 |
+
|
527 |
+
transport.onreadystatechange = function () {
|
528 |
+
if (transport.readyState !== 4) {
|
529 |
+
return;
|
530 |
+
}
|
531 |
+
settings.success(transport.responseText);
|
532 |
+
};
|
533 |
+
transport.open('get', settings.url, true);
|
534 |
+
for (name in headers) {
|
535 |
+
transport.setRequestHeader(name, headers[name]);
|
536 |
+
}
|
537 |
+
transport.send();
|
538 |
+
};
|
539 |
+
|
540 |
+
this.evercookie_cache = function (name, value) {
|
541 |
+
if (value !== undefined) {
|
542 |
+
// make sure we have evercookie session defined first
|
543 |
+
document.cookie = opts.cacheCookieName + "=" + value + "; path=/; domain=" + _ec_domain;
|
544 |
+
// {{ajax request to opts.cachePath}} handles caching
|
545 |
+
self.ajax({
|
546 |
+
url: _ec_baseurl + _ec_phpuri + opts.cachePath + "?name=" + name + "&cookie=" + opts.cacheCookieName,
|
547 |
+
success: function (data) {}
|
548 |
+
});
|
549 |
+
} else {
|
550 |
+
// interestingly enough, we want to erase our evercookie
|
551 |
+
// http cookie so the php will force a cached response
|
552 |
+
var origvalue = this.getFromStr(opts.cacheCookieName, document.cookie);
|
553 |
+
self._ec.cacheData = undefined;
|
554 |
+
document.cookie = opts.cacheCookieName + "=; expires=Mon, 20 Sep 2010 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
555 |
+
|
556 |
+
self.ajax({
|
557 |
+
url: _ec_baseurl + _ec_phpuri + opts.cachePath + "?name=" + name + "&cookie=" + opts.cacheCookieName,
|
558 |
+
success: function (data) {
|
559 |
+
// put our cookie back
|
560 |
+
document.cookie = opts.cacheCookieName + "=" + origvalue + "; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
561 |
+
|
562 |
+
self._ec.cacheData = data;
|
563 |
+
}
|
564 |
+
});
|
565 |
+
}
|
566 |
+
};
|
567 |
+
this.evercookie_auth = function (name, value) {
|
568 |
+
if (value !== undefined) {
|
569 |
+
// {{opts.authPath}} handles Basic Access Authentication
|
570 |
+
newImage('//' + value + '@' + location.host + _ec_baseurl + _ec_phpuri + opts.authPath + "?name=" + name);
|
571 |
+
}
|
572 |
+
else {
|
573 |
+
self.ajax({
|
574 |
+
url: _ec_baseurl + _ec_phpuri + opts.authPath + "?name=" + name,
|
575 |
+
success: function (data) {
|
576 |
+
self._ec.authData = data;
|
577 |
+
}
|
578 |
+
});
|
579 |
+
}
|
580 |
+
};
|
581 |
+
|
582 |
+
this.evercookie_etag = function (name, value) {
|
583 |
+
if (value !== undefined) {
|
584 |
+
// make sure we have evercookie session defined first
|
585 |
+
document.cookie = opts.etagCookieName + "=" + value + "; path=/; domain=" + _ec_domain;
|
586 |
+
// {{ajax request to opts.etagPath}} handles etagging
|
587 |
+
self.ajax({
|
588 |
+
url: _ec_baseurl + _ec_phpuri + opts.etagPath + "?name=" + name + "&cookie=" + opts.etagCookieName,
|
589 |
+
success: function (data) {}
|
590 |
+
});
|
591 |
+
} else {
|
592 |
+
// interestingly enough, we want to erase our evercookie
|
593 |
+
// http cookie so the php will force a cached response
|
594 |
+
var origvalue = this.getFromStr(opts.etagCookieName, document.cookie);
|
595 |
+
self._ec.etagData = undefined;
|
596 |
+
document.cookie = opts.etagCookieName + "=; expires=Mon, 20 Sep 2010 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
597 |
+
|
598 |
+
self.ajax({
|
599 |
+
url: _ec_baseurl + _ec_phpuri + opts.etagPath + "?name=" + name + "&cookie=" + opts.etagCookieName,
|
600 |
+
success: function (data) {
|
601 |
+
// put our cookie back
|
602 |
+
document.cookie = opts.etagCookieName + "=" + origvalue + "; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
603 |
+
|
604 |
+
self._ec.etagData = data;
|
605 |
+
}
|
606 |
+
});
|
607 |
+
}
|
608 |
+
};
|
609 |
+
|
610 |
+
this.evercookie_java = function (name, value) {
|
611 |
+
var div = document.getElementById("ecAppletContainer");
|
612 |
+
|
613 |
+
// Exit if dtjava.js was not included in the page header.
|
614 |
+
if (typeof dtjava === "undefined") {
|
615 |
+
return;
|
616 |
+
}
|
617 |
+
|
618 |
+
// Create the container div if none exists.
|
619 |
+
if (div===null || div === undefined || !div.length) {
|
620 |
+
div = document.createElement("div");
|
621 |
+
div.setAttribute("id", "ecAppletContainer");
|
622 |
+
div.style.position = "absolute";
|
623 |
+
div.style.top = "-3000px";
|
624 |
+
div.style.left = "-3000px";
|
625 |
+
div.style.width = "1px";
|
626 |
+
div.style.height = "1px";
|
627 |
+
document.body.appendChild(div);
|
628 |
+
}
|
629 |
+
|
630 |
+
// If the Java applet is not yet defined, embed it.
|
631 |
+
if (typeof ecApplet === "undefined") {
|
632 |
+
dtjava.embed({
|
633 |
+
id: "ecApplet",
|
634 |
+
url: _ec_baseurl + _ec_asseturi + _ec_jnlp_file_name,
|
635 |
+
width: "1px",
|
636 |
+
height: "1px",
|
637 |
+
placeholder: "ecAppletContainer"
|
638 |
+
}, {},{ onJavascriptReady: doSetOrGet });
|
639 |
+
// When the applet is loaded we will continue in doSetOrGet()
|
640 |
+
}
|
641 |
+
else {
|
642 |
+
// applet already running... call doGetOrSet() directly.
|
643 |
+
doSetOrGet("ecApplet");
|
644 |
+
}
|
645 |
+
|
646 |
+
function doSetOrGet(appletId) {
|
647 |
+
var applet = document.getElementById(appletId);
|
648 |
+
if (value !== undefined) {
|
649 |
+
applet.set(name,value);
|
650 |
+
}
|
651 |
+
else {
|
652 |
+
self._ec.javaData = applet.get(name);
|
653 |
+
}
|
654 |
+
}
|
655 |
+
|
656 |
+
// The result of a get() is now in self._ec._javaData
|
657 |
+
};
|
658 |
+
|
659 |
+
this.evercookie_lso = function (name, value) {
|
660 |
+
var div = document.getElementById("swfcontainer"),
|
661 |
+
flashvars = {},
|
662 |
+
params = {},
|
663 |
+
attributes = {};
|
664 |
+
if (div===null || div === undefined || !div.length) {
|
665 |
+
div = document.createElement("div");
|
666 |
+
div.setAttribute("id", "swfcontainer");
|
667 |
+
document.body.appendChild(div);
|
668 |
+
}
|
669 |
+
|
670 |
+
if (value !== undefined) {
|
671 |
+
flashvars.everdata = name + "=" + value;
|
672 |
+
}
|
673 |
+
params.swliveconnect = "true";
|
674 |
+
attributes.id = "myswf";
|
675 |
+
attributes.name = "myswf";
|
676 |
+
swfobject.embedSWF(_ec_baseurl + _ec_asseturi + _ec_swf_file_name, "swfcontainer", "1", "1", "9.0.0", false, flashvars, params, attributes);
|
677 |
+
};
|
678 |
+
|
679 |
+
this.evercookie_png = function (name, value) {
|
680 |
+
var canvas = document.createElement("canvas"),
|
681 |
+
img, ctx, origvalue;
|
682 |
+
canvas.style.visibility = "hidden";
|
683 |
+
canvas.style.position = "absolute";
|
684 |
+
canvas.width = 200;
|
685 |
+
canvas.height = 1;
|
686 |
+
if (canvas && canvas.getContext) {
|
687 |
+
// {{opts.pngPath}} handles the hard part of generating the image
|
688 |
+
// based off of the http cookie and returning it cached
|
689 |
+
img = new Image();
|
690 |
+
img.style.visibility = "hidden";
|
691 |
+
img.style.position = "absolute";
|
692 |
+
if (value !== undefined) {
|
693 |
+
// make sure we have evercookie session defined first
|
694 |
+
document.cookie = opts.pngCookieName + "=" + value + "; path=/; domain=" + _ec_domain;
|
695 |
+
} else {
|
696 |
+
self._ec.pngData = undefined;
|
697 |
+
ctx = canvas.getContext("2d");
|
698 |
+
|
699 |
+
// interestingly enough, we want to erase our evercookie
|
700 |
+
// http cookie so the php will force a cached response
|
701 |
+
origvalue = this.getFromStr(opts.pngCookieName, document.cookie);
|
702 |
+
document.cookie = opts.pngCookieName + "=; expires=Mon, 20 Sep 2010 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
703 |
+
|
704 |
+
img.onload = function () {
|
705 |
+
// put our cookie back
|
706 |
+
document.cookie = opts.pngCookieName + "=" + origvalue + "; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
707 |
+
|
708 |
+
self._ec.pngData = "";
|
709 |
+
ctx.drawImage(img, 0, 0);
|
710 |
+
|
711 |
+
// get CanvasPixelArray from given coordinates and dimensions
|
712 |
+
var imgd = ctx.getImageData(0, 0, 200, 1),
|
713 |
+
pix = imgd.data, i, n;
|
714 |
+
|
715 |
+
// loop over each pixel to get the "RGB" values (ignore alpha)
|
716 |
+
for (i = 0, n = pix.length; i < n; i += 4) {
|
717 |
+
if (pix[i] === 0) {
|
718 |
+
break;
|
719 |
+
}
|
720 |
+
self._ec.pngData += String.fromCharCode(pix[i]);
|
721 |
+
if (pix[i + 1] === 0) {
|
722 |
+
break;
|
723 |
+
}
|
724 |
+
self._ec.pngData += String.fromCharCode(pix[i + 1]);
|
725 |
+
if (pix[i + 2] === 0) {
|
726 |
+
break;
|
727 |
+
}
|
728 |
+
self._ec.pngData += String.fromCharCode(pix[i + 2]);
|
729 |
+
}
|
730 |
+
};
|
731 |
+
}
|
732 |
+
img.src = _ec_baseurl + _ec_phpuri + opts.pngPath + "?name=" + name + "&cookie=" + opts.pngCookieName;
|
733 |
+
img.crossOrigin = 'Anonymous';
|
734 |
+
}
|
735 |
+
};
|
736 |
+
|
737 |
+
this.evercookie_local_storage = function (name, value) {
|
738 |
+
try {
|
739 |
+
if (localStore) {
|
740 |
+
if (value !== undefined) {
|
741 |
+
localStore.setItem(name, value);
|
742 |
+
} else {
|
743 |
+
return localStore.getItem(name);
|
744 |
+
}
|
745 |
+
}
|
746 |
+
} catch (e) { }
|
747 |
+
};
|
748 |
+
|
749 |
+
this.evercookie_database_storage = function (name, value) {
|
750 |
+
try {
|
751 |
+
if (window.openDatabase) {
|
752 |
+
var database = window.openDatabase("sqlite_evercookie", "", "evercookie", 1024 * 1024);
|
753 |
+
|
754 |
+
if (value !== undefined) {
|
755 |
+
database.transaction(function (tx) {
|
756 |
+
tx.executeSql("CREATE TABLE IF NOT EXISTS cache(" +
|
757 |
+
"id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " +
|
758 |
+
"name TEXT NOT NULL, " +
|
759 |
+
"value TEXT NOT NULL, " +
|
760 |
+
"UNIQUE (name)" +
|
761 |
+
")", [], function (tx, rs) {}, function (tx, err) {});
|
762 |
+
tx.executeSql("INSERT OR REPLACE INTO cache(name, value) " +
|
763 |
+
"VALUES(?, ?)",
|
764 |
+
[name, value], function (tx, rs) {}, function (tx, err) {});
|
765 |
+
});
|
766 |
+
} else {
|
767 |
+
database.transaction(function (tx) {
|
768 |
+
tx.executeSql("SELECT value FROM cache WHERE name=?", [name],
|
769 |
+
function (tx, result1) {
|
770 |
+
if (result1.rows.length >= 1) {
|
771 |
+
self._ec.dbData = result1.rows.item(0).value;
|
772 |
+
} else {
|
773 |
+
self._ec.dbData = "";
|
774 |
+
}
|
775 |
+
}, function (tx, err) {});
|
776 |
+
});
|
777 |
+
}
|
778 |
+
}
|
779 |
+
} catch (e) { }
|
780 |
+
};
|
781 |
+
|
782 |
+
this.evercookie_indexdb_storage = function(name, value) {
|
783 |
+
try {
|
784 |
+
if (!('indexedDB' in window)) {
|
785 |
+
|
786 |
+
indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
|
787 |
+
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction;
|
788 |
+
IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;
|
789 |
+
}
|
790 |
+
|
791 |
+
if (indexedDB) {
|
792 |
+
var ver = 1;
|
793 |
+
//FF incognito mode restricts indexedb access
|
794 |
+
var request = indexedDB.open("idb_evercookie", ver);
|
795 |
+
|
796 |
+
|
797 |
+
request.onerror = function(e) { ;
|
798 |
+
}
|
799 |
+
|
800 |
+
request.onupgradeneeded = function(event) {
|
801 |
+
var db = event.target.result;
|
802 |
+
|
803 |
+
var store = db.createObjectStore("evercookie", {
|
804 |
+
keyPath: "name",
|
805 |
+
unique: false
|
806 |
+
})
|
807 |
+
|
808 |
+
}
|
809 |
+
|
810 |
+
if (value !== undefined) {
|
811 |
+
|
812 |
+
|
813 |
+
request.onsuccess = function(event) {
|
814 |
+
var idb = event.target.result;
|
815 |
+
if (idb.objectStoreNames.contains("evercookie")) {
|
816 |
+
var tx = idb.transaction(["evercookie"], "readwrite");
|
817 |
+
var objst = tx.objectStore("evercookie");
|
818 |
+
var qr = objst.put({
|
819 |
+
"name": name,
|
820 |
+
"value": value
|
821 |
+
})
|
822 |
+
} idb.close();
|
823 |
+
}
|
824 |
+
|
825 |
+
} else {
|
826 |
+
|
827 |
+
request.onsuccess = function(event) {
|
828 |
+
|
829 |
+
var idb = event.target.result;
|
830 |
+
|
831 |
+
if (!idb.objectStoreNames.contains("evercookie")) {
|
832 |
+
|
833 |
+
self._ec.idbData = undefined;
|
834 |
+
} else {
|
835 |
+
var tx = idb.transaction(["evercookie"]);
|
836 |
+
var objst = tx.objectStore("evercookie");
|
837 |
+
var qr = objst.get(name);
|
838 |
+
|
839 |
+
qr.onsuccess = function(event) {
|
840 |
+
if (qr.result === undefined) {
|
841 |
+
self._ec.idbData = undefined
|
842 |
+
} else {
|
843 |
+
self._ec.idbData = qr.result.value;
|
844 |
+
}
|
845 |
+
}
|
846 |
+
}
|
847 |
+
idb.close();
|
848 |
+
}
|
849 |
+
}
|
850 |
+
}
|
851 |
+
} catch (e) {}
|
852 |
+
};
|
853 |
+
|
854 |
+
this.evercookie_session_storage = function (name, value) {
|
855 |
+
try {
|
856 |
+
if (sessionStorage) {
|
857 |
+
if (value !== undefined) {
|
858 |
+
sessionStorage.setItem(name, value);
|
859 |
+
} else {
|
860 |
+
return sessionStorage.getItem(name);
|
861 |
+
}
|
862 |
+
}
|
863 |
+
} catch (e) { }
|
864 |
+
};
|
865 |
+
|
866 |
+
this.evercookie_global_storage = function (name, value) {
|
867 |
+
if (globalStorage) {
|
868 |
+
var host = this.getHost();
|
869 |
+
try {
|
870 |
+
if (value !== undefined) {
|
871 |
+
globalStorage[host][name] = value;
|
872 |
+
} else {
|
873 |
+
return globalStorage[host][name];
|
874 |
+
}
|
875 |
+
} catch (e) { }
|
876 |
+
}
|
877 |
+
};
|
878 |
+
|
879 |
+
this.evercookie_silverlight = function (name, value) {
|
880 |
+
/*
|
881 |
+
* Create silverlight embed
|
882 |
+
*
|
883 |
+
* Ok. so, I tried doing this the proper dom way, but IE chokes on appending anything in object tags (including params), so this
|
884 |
+
* is the best method I found. Someone really needs to find a less hack-ish way. I hate the look of this shit.
|
885 |
+
*/
|
886 |
+
var source = _ec_baseurl + _ec_asseturi + _ec_xap_file_name,
|
887 |
+
minver = "4.0.50401.0",
|
888 |
+
initParam = "",
|
889 |
+
html;
|
890 |
+
if (value !== undefined) {
|
891 |
+
initParam = '<param name="initParams" value="' + name + '=' + value + '" />';
|
892 |
+
}
|
893 |
+
|
894 |
+
html =
|
895 |
+
'<object style="position:absolute;left:-500px;top:-500px" data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="mysilverlight" width="0" height="0">' +
|
896 |
+
initParam +
|
897 |
+
'<param name="source" value="' + source + '"/>' +
|
898 |
+
'<param name="onLoad" value="onSilverlightLoad"/>' +
|
899 |
+
'<param name="onError" value="onSilverlightError"/>' +
|
900 |
+
'<param name="background" value="Transparent"/>' +
|
901 |
+
'<param name="windowless" value="true"/>' +
|
902 |
+
'<param name="minRuntimeVersion" value="' + minver + '"/>' +
|
903 |
+
'<param name="autoUpgrade" value="false"/>' +
|
904 |
+
'<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=' + minver + '" style="display:none">' +
|
905 |
+
'Get Microsoft Silverlight' +
|
906 |
+
'</a>' +
|
907 |
+
'</object>';
|
908 |
+
try{
|
909 |
+
if (typeof jQuery === 'undefined') {
|
910 |
+
document.body.appendChild(html);
|
911 |
+
} else {
|
912 |
+
$('body').append(html);
|
913 |
+
}
|
914 |
+
}catch(ex){
|
915 |
+
|
916 |
+
}
|
917 |
+
};
|
918 |
+
|
919 |
+
// public method for encoding
|
920 |
+
this.encode = function (input) {
|
921 |
+
var output = "",
|
922 |
+
chr1, chr2, chr3, enc1, enc2, enc3, enc4,
|
923 |
+
i = 0;
|
924 |
+
|
925 |
+
input = this._utf8_encode(input);
|
926 |
+
|
927 |
+
while (i < input.length) {
|
928 |
+
|
929 |
+
chr1 = input.charCodeAt(i++);
|
930 |
+
chr2 = input.charCodeAt(i++);
|
931 |
+
chr3 = input.charCodeAt(i++);
|
932 |
+
|
933 |
+
enc1 = chr1 >> 2;
|
934 |
+
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
935 |
+
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
936 |
+
enc4 = chr3 & 63;
|
937 |
+
|
938 |
+
if (isNaN(chr2)) {
|
939 |
+
enc3 = enc4 = 64;
|
940 |
+
} else if (isNaN(chr3)) {
|
941 |
+
enc4 = 64;
|
942 |
+
}
|
943 |
+
|
944 |
+
output = output +
|
945 |
+
_baseKeyStr.charAt(enc1) + _baseKeyStr.charAt(enc2) +
|
946 |
+
_baseKeyStr.charAt(enc3) + _baseKeyStr.charAt(enc4);
|
947 |
+
|
948 |
+
}
|
949 |
+
|
950 |
+
return output;
|
951 |
+
};
|
952 |
+
|
953 |
+
// public method for decoding
|
954 |
+
this.decode = function (input) {
|
955 |
+
var output = "",
|
956 |
+
chr1, chr2, chr3,
|
957 |
+
enc1, enc2, enc3, enc4,
|
958 |
+
i = 0;
|
959 |
+
|
960 |
+
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
961 |
+
|
962 |
+
while (i < input.length) {
|
963 |
+
enc1 = _baseKeyStr.indexOf(input.charAt(i++));
|
964 |
+
enc2 = _baseKeyStr.indexOf(input.charAt(i++));
|
965 |
+
enc3 = _baseKeyStr.indexOf(input.charAt(i++));
|
966 |
+
enc4 = _baseKeyStr.indexOf(input.charAt(i++));
|
967 |
+
|
968 |
+
chr1 = (enc1 << 2) | (enc2 >> 4);
|
969 |
+
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
970 |
+
chr3 = ((enc3 & 3) << 6) | enc4;
|
971 |
+
|
972 |
+
output = output + String.fromCharCode(chr1);
|
973 |
+
|
974 |
+
if (enc3 !== 64) {
|
975 |
+
output = output + String.fromCharCode(chr2);
|
976 |
+
}
|
977 |
+
if (enc4 !== 64) {
|
978 |
+
output = output + String.fromCharCode(chr3);
|
979 |
+
}
|
980 |
+
}
|
981 |
+
output = this._utf8_decode(output);
|
982 |
+
return output;
|
983 |
+
};
|
984 |
+
|
985 |
+
// private method for UTF-8 encoding
|
986 |
+
this._utf8_encode = function (str) {
|
987 |
+
str = str.replace(/\r\n/g, "\n");
|
988 |
+
var utftext = "", i = 0, n = str.length, c;
|
989 |
+
for (; i < n; i++) {
|
990 |
+
c = str.charCodeAt(i);
|
991 |
+
if (c < 128) {
|
992 |
+
utftext += String.fromCharCode(c);
|
993 |
+
} else if ((c > 127) && (c < 2048)) {
|
994 |
+
utftext += String.fromCharCode((c >> 6) | 192);
|
995 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
996 |
+
} else {
|
997 |
+
utftext += String.fromCharCode((c >> 12) | 224);
|
998 |
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
999 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
1000 |
+
}
|
1001 |
+
}
|
1002 |
+
return utftext;
|
1003 |
+
};
|
1004 |
+
|
1005 |
+
// private method for UTF-8 decoding
|
1006 |
+
this._utf8_decode = function (utftext) {
|
1007 |
+
var str = "",
|
1008 |
+
i = 0, n = utftext.length,
|
1009 |
+
c = 0, c1 = 0, c2 = 0, c3 = 0;
|
1010 |
+
while (i < n) {
|
1011 |
+
c = utftext.charCodeAt(i);
|
1012 |
+
if (c < 128) {
|
1013 |
+
str += String.fromCharCode(c);
|
1014 |
+
i += 1;
|
1015 |
+
} else if ((c > 191) && (c < 224)) {
|
1016 |
+
c2 = utftext.charCodeAt(i + 1);
|
1017 |
+
str += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
1018 |
+
i += 2;
|
1019 |
+
} else {
|
1020 |
+
c2 = utftext.charCodeAt(i + 1);
|
1021 |
+
c3 = utftext.charCodeAt(i + 2);
|
1022 |
+
str += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
1023 |
+
i += 3;
|
1024 |
+
}
|
1025 |
+
}
|
1026 |
+
return str;
|
1027 |
+
};
|
1028 |
+
|
1029 |
+
// this is crazy but it's 4am in dublin and i thought this would be hilarious
|
1030 |
+
// blame the guinness
|
1031 |
+
this.evercookie_history = function (name, value) {
|
1032 |
+
// - is special
|
1033 |
+
var baseElems = (_baseKeyStr + "-").split(""),
|
1034 |
+
// sorry google.
|
1035 |
+
url = "https://www.google.com/evercookie/cache/" + this.getHost() + "/" + name,
|
1036 |
+
i, base,
|
1037 |
+
letter = "",
|
1038 |
+
val = "",
|
1039 |
+
found = 1;
|
1040 |
+
|
1041 |
+
if (value !== undefined) {
|
1042 |
+
// don't reset this if we already have it set once
|
1043 |
+
// too much data and you can't clear previous values
|
1044 |
+
if (this.hasVisited(url)) {
|
1045 |
+
return;
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
this.createIframe(url, "if");
|
1049 |
+
url = url + "/";
|
1050 |
+
|
1051 |
+
base = this.encode(value).split("");
|
1052 |
+
for (i = 0; i < base.length; i++) {
|
1053 |
+
url = url + base[i];
|
1054 |
+
this.createIframe(url, "if" + i);
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
// - signifies the end of our data
|
1058 |
+
url = url + "-";
|
1059 |
+
this.createIframe(url, "if_");
|
1060 |
+
} else {
|
1061 |
+
// omg you got csspwn3d
|
1062 |
+
if (this.hasVisited(url)) {
|
1063 |
+
url = url + "/";
|
1064 |
+
|
1065 |
+
while (letter !== "-" && found === 1) {
|
1066 |
+
found = 0;
|
1067 |
+
for (i = 0; i < baseElems.length; i++) {
|
1068 |
+
if (this.hasVisited(url + baseElems[i])) {
|
1069 |
+
letter = baseElems[i];
|
1070 |
+
if (letter !== "-") {
|
1071 |
+
val = val + letter;
|
1072 |
+
}
|
1073 |
+
url = url + letter;
|
1074 |
+
found = 1;
|
1075 |
+
break;
|
1076 |
+
}
|
1077 |
+
}
|
1078 |
+
}
|
1079 |
+
|
1080 |
+
// lolz
|
1081 |
+
return this.decode(val);
|
1082 |
+
}
|
1083 |
+
}
|
1084 |
+
};
|
1085 |
+
|
1086 |
+
this.createElem = function (type, name, append) {
|
1087 |
+
var el;
|
1088 |
+
if (name !== undefined && document.getElementById(name)) {
|
1089 |
+
el = document.getElementById(name);
|
1090 |
+
} else {
|
1091 |
+
el = document.createElement(type);
|
1092 |
+
}
|
1093 |
+
el.style.visibility = "hidden";
|
1094 |
+
el.style.position = "absolute";
|
1095 |
+
|
1096 |
+
if (name) {
|
1097 |
+
el.setAttribute("id", name);
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
if (append) {
|
1101 |
+
document.body.appendChild(el);
|
1102 |
+
}
|
1103 |
+
return el;
|
1104 |
+
};
|
1105 |
+
|
1106 |
+
this.createIframe = function (url, name) {
|
1107 |
+
var el = this.createElem("iframe", name, 1);
|
1108 |
+
el.setAttribute("src", url);
|
1109 |
+
return el;
|
1110 |
+
};
|
1111 |
+
|
1112 |
+
// wait for our swfobject to appear (swfobject.js to load)
|
1113 |
+
var waitForSwf = this.waitForSwf = function (i) {
|
1114 |
+
if (i === undefined) {
|
1115 |
+
i = 0;
|
1116 |
+
} else {
|
1117 |
+
i++;
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
// wait for ~2 seconds for swfobject to appear
|
1121 |
+
if (i < _ec_tests && typeof swfobject === "undefined") {
|
1122 |
+
setTimeout(function () {
|
1123 |
+
waitForSwf(i);
|
1124 |
+
}, 300);
|
1125 |
+
}
|
1126 |
+
};
|
1127 |
+
|
1128 |
+
this.evercookie_cookie = function (name, value) {
|
1129 |
+
if (value !== undefined) {
|
1130 |
+
// expire the cookie first
|
1131 |
+
document.cookie = name + "=; expires=Mon, 20 Sep 2010 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
1132 |
+
document.cookie = name + "=" + value + "; expires=Tue, 31 Dec 2030 00:00:00 UTC; path=/; domain=" + _ec_domain;
|
1133 |
+
} else {
|
1134 |
+
return this.getFromStr(name, document.cookie);
|
1135 |
+
}
|
1136 |
+
};
|
1137 |
+
|
1138 |
+
// get value from param-like string (eg, "x=y&name=VALUE")
|
1139 |
+
this.getFromStr = function (name, text) {
|
1140 |
+
if (typeof text !== "string") {
|
1141 |
+
return;
|
1142 |
+
}
|
1143 |
+
var nameEQ = name + "=",
|
1144 |
+
ca = text.split(/[;&]/),
|
1145 |
+
i, c;
|
1146 |
+
for (i = 0; i < ca.length; i++) {
|
1147 |
+
c = ca[i];
|
1148 |
+
while (c.charAt(0) === " ") {
|
1149 |
+
c = c.substring(1, c.length);
|
1150 |
+
}
|
1151 |
+
if (c.indexOf(nameEQ) === 0) {
|
1152 |
+
return c.substring(nameEQ.length, c.length);
|
1153 |
+
}
|
1154 |
+
}
|
1155 |
+
};
|
1156 |
+
|
1157 |
+
this.getHost = function () {
|
1158 |
+
return window.location.host.replace(/:\d+/, '');
|
1159 |
+
};
|
1160 |
+
|
1161 |
+
this.toHex = function (str) {
|
1162 |
+
var r = "",
|
1163 |
+
e = str.length,
|
1164 |
+
c = 0,
|
1165 |
+
h;
|
1166 |
+
while (c < e) {
|
1167 |
+
h = str.charCodeAt(c++).toString(16);
|
1168 |
+
while (h.length < 2) {
|
1169 |
+
h = "0" + h;
|
1170 |
+
}
|
1171 |
+
r += h;
|
1172 |
+
}
|
1173 |
+
return r;
|
1174 |
+
};
|
1175 |
+
|
1176 |
+
this.fromHex = function (str) {
|
1177 |
+
var r = "",
|
1178 |
+
e = str.length,
|
1179 |
+
s;
|
1180 |
+
while (e >= 0) {
|
1181 |
+
s = e - 2;
|
1182 |
+
r = String.fromCharCode("0x" + str.substring(s, e)) + r;
|
1183 |
+
e = s;
|
1184 |
+
}
|
1185 |
+
return r;
|
1186 |
+
};
|
1187 |
+
|
1188 |
+
/**
|
1189 |
+
* css history knocker (determine what sites your visitors have been to)
|
1190 |
+
*
|
1191 |
+
* originally by Jeremiah Grossman
|
1192 |
+
* http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.html
|
1193 |
+
*
|
1194 |
+
* ported to additional browsers by Samy Kamkar
|
1195 |
+
*
|
1196 |
+
* compatible with ie6, ie7, ie8, ff1.5, ff2, ff3, opera, safari, chrome, flock
|
1197 |
+
*
|
1198 |
+
* - [email protected]
|
1199 |
+
*/
|
1200 |
+
this.hasVisited = function (url) {
|
1201 |
+
if (this.no_color === -1) {
|
1202 |
+
var no_style = this._getRGB("http://samy-was-here-this-should-never-be-visited.com", -1);
|
1203 |
+
if (no_style === -1) {
|
1204 |
+
this.no_color = this._getRGB("http://samy-was-here-" + Math.floor(Math.random() * 9999999) + "rand.com");
|
1205 |
+
}
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
// did we give full url?
|
1209 |
+
if (url.indexOf("https:") === 0 || url.indexOf("http:") === 0) {
|
1210 |
+
return this._testURL(url, this.no_color);
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
// if not, just test a few diff types if (exact)
|
1214 |
+
return this._testURL("http://" + url, this.no_color) ||
|
1215 |
+
this._testURL("https://" + url, this.no_color) ||
|
1216 |
+
this._testURL("http://www." + url, this.no_color) ||
|
1217 |
+
this._testURL("https://www." + url, this.no_color);
|
1218 |
+
};
|
1219 |
+
|
1220 |
+
/* create our anchor tag */
|
1221 |
+
var _link = this.createElem("a", "_ec_rgb_link"),
|
1222 |
+
/* for monitoring */
|
1223 |
+
created_style,
|
1224 |
+
/* create a custom style tag for the specific link. Set the CSS visited selector to a known value */
|
1225 |
+
_cssText = "#_ec_rgb_link:visited{display:none;color:#FF0000}",
|
1226 |
+
style;
|
1227 |
+
|
1228 |
+
/* Methods for IE6, IE7, FF, Opera, and Safari */
|
1229 |
+
try {
|
1230 |
+
created_style = 1;
|
1231 |
+
style = document.createElement("style");
|
1232 |
+
if (style.styleSheet) {
|
1233 |
+
style.styleSheet.innerHTML = _cssText;
|
1234 |
+
} else if (style.innerHTML) {
|
1235 |
+
style.innerHTML = _cssText;
|
1236 |
+
} else {
|
1237 |
+
style.appendChild(document.createTextNode(_cssText));
|
1238 |
+
}
|
1239 |
+
} catch (e) {
|
1240 |
+
created_style = 0;
|
1241 |
+
}
|
1242 |
+
|
1243 |
+
/* if test_color, return -1 if we can't set a style */
|
1244 |
+
this._getRGB = function (u, test_color) {
|
1245 |
+
if (test_color && created_style === 0) {
|
1246 |
+
return -1;
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
/* create the new anchor tag with the appropriate URL information */
|
1250 |
+
_link.href = u;
|
1251 |
+
_link.innerHTML = u;
|
1252 |
+
// not sure why, but the next two appendChilds always have to happen vs just once
|
1253 |
+
document.body.appendChild(style);
|
1254 |
+
document.body.appendChild(_link);
|
1255 |
+
|
1256 |
+
/* add the link to the DOM and save the visible computed color */
|
1257 |
+
var color;
|
1258 |
+
if (document.defaultView) {
|
1259 |
+
if (document.defaultView.getComputedStyle(_link, null) == null) {
|
1260 |
+
return -1; // getComputedStyle is unavailable in FF when running in IFRAME
|
1261 |
+
}
|
1262 |
+
color = document.defaultView.getComputedStyle(_link, null).getPropertyValue("color");
|
1263 |
+
} else {
|
1264 |
+
color = _link.currentStyle.color;
|
1265 |
+
}
|
1266 |
+
return color;
|
1267 |
+
};
|
1268 |
+
|
1269 |
+
this._testURL = function (url, no_color) {
|
1270 |
+
var color = this._getRGB(url);
|
1271 |
+
|
1272 |
+
/* check to see if the link has been visited if the computed color is red */
|
1273 |
+
if (color === "rgb(255, 0, 0)" || color === "#ff0000") {
|
1274 |
+
return 1;
|
1275 |
+
} else if (no_color && color !== no_color) {
|
1276 |
+
/* if our style trick didn't work, just compare default style colors */
|
1277 |
+
return 1;
|
1278 |
+
}
|
1279 |
+
/* not found */
|
1280 |
+
return 0;
|
1281 |
+
};
|
1282 |
+
|
1283 |
+
};
|
1284 |
+
|
1285 |
+
window._evercookie_flash_var = _evercookie_flash_var;
|
1286 |
+
/**
|
1287 |
+
* Because Evercookie is a class, it should has first letter in capital
|
1288 |
+
* Keep first letter in small for legacy purpose
|
1289 |
+
* @expose Evercookie
|
1290 |
+
*/
|
1291 |
+
window.evercookie = window.Evercookie = Evercookie;
|
1292 |
+
}(window));
|
1293 |
+
}catch(ex){}
|
js/swfobject-2.2.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
2 |
+
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
3 |
+
*/
|
4 |
+
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
|
php/_cookie_name.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Gets evercookie's cookie name for PHP's scripts to get value froms
|
5 |
+
*
|
6 |
+
* @param string $file_name Usually it's a file name like 'evercookie_blabla.php'
|
7 |
+
* @return string evercookie_blabla
|
8 |
+
*/
|
9 |
+
function evercookie_get_cookie_name($file_name) {
|
10 |
+
if (!empty($_GET['cookie'])) {
|
11 |
+
return $_GET['cookie'];
|
12 |
+
}
|
13 |
+
return basename($file_name, '.php');
|
14 |
+
}
|
php/evercookie_cache.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* evercookie, by samy kamkar, 09/20/2010
|
3 |
+
* http://samy.pl : [email protected]
|
4 |
+
*
|
5 |
+
* This is the server-side simple caching mechanism.
|
6 |
+
*
|
7 |
+
* -samy kamkar
|
8 |
+
*/
|
9 |
+
|
10 |
+
// we get cookie name from current file name so remember about it when rename of this file will be required
|
11 |
+
include dirname(__FILE__) . DIRECTORY_SEPARATOR . '_cookie_name.php';
|
12 |
+
$cookie_name = evercookie_get_cookie_name(__FILE__);
|
13 |
+
|
14 |
+
// we don't have a cookie, user probably deleted it, force cache
|
15 |
+
if (empty($_COOKIE[$cookie_name])) {
|
16 |
+
header('HTTP/1.1 304 Not Modified');
|
17 |
+
exit;
|
18 |
+
}
|
19 |
+
|
20 |
+
header('Content-Type: text/html');
|
21 |
+
header('Last-Modified: Wed, 30 Jun 2010 21:36:48 GMT');
|
22 |
+
header('Expires: Tue, 31 Dec 2030 23:30:45 GMT');
|
23 |
+
header('Cache-Control: private, max-age=630720000');
|
24 |
+
|
25 |
+
echo $_COOKIE[$cookie_name];
|
php/evercookie_etag.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* evercookie, by samy kamkar, 09/20/2010
|
3 |
+
* http://samy.pl : [email protected]
|
4 |
+
*
|
5 |
+
* This is the server-side ETag software which tags a user by
|
6 |
+
* using the Etag HTTP header, as well as If-None-Match to check
|
7 |
+
* if the user has been tagged before.
|
8 |
+
*
|
9 |
+
* -samy kamkar
|
10 |
+
*/
|
11 |
+
|
12 |
+
// we get cookie name from current file name so remember about it when rename of this file will be required
|
13 |
+
include dirname(__FILE__) . DIRECTORY_SEPARATOR . '_cookie_name.php';
|
14 |
+
$cookie_name = evercookie_get_cookie_name(__FILE__);
|
15 |
+
|
16 |
+
// we don't have a cookie, so we're not setting it
|
17 |
+
if (empty($_COOKIE[$cookie_name])) {
|
18 |
+
// read our etag and pass back
|
19 |
+
if (!function_exists('apache_request_headers')) {
|
20 |
+
function apache_request_headers() {
|
21 |
+
// Source: http://www.php.net/manual/en/function.apache-request-headers.php#70810
|
22 |
+
$arh = array();
|
23 |
+
$rx_http = '/\AHTTP_/';
|
24 |
+
foreach ($_SERVER as $key => $val) {
|
25 |
+
if (preg_match($rx_http, $key)) {
|
26 |
+
$arh_key = preg_replace($rx_http, '', $key);
|
27 |
+
$rx_matches = array();
|
28 |
+
// do some nasty string manipulations to restore the original letter case
|
29 |
+
// this should work in most cases
|
30 |
+
$rx_matches = explode('_', $arh_key);
|
31 |
+
if (count($rx_matches) > 0 and strlen($arh_key) > 2) {
|
32 |
+
foreach ($rx_matches as $ak_key => $ak_val) {
|
33 |
+
$rx_matches[$ak_key] = ucfirst(strtolower($ak_val));
|
34 |
+
}
|
35 |
+
$arh_key = implode('-', $rx_matches);
|
36 |
+
}
|
37 |
+
$arh[$arh_key] = $val;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
return ($arh);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
// Headers might have different letter case depending on the web server.
|
45 |
+
// So, change all headers to uppercase and compare it.
|
46 |
+
$headers = array_change_key_case(apache_request_headers(), CASE_UPPER);
|
47 |
+
if(isset($headers['IF-NONE-MATCH'])) {
|
48 |
+
// extracting value from ETag presented format (which may be prepended by Weak validator modifier)
|
49 |
+
$etag_value = preg_replace('|^(W/)?"(.+)"$|', '$2', $headers['IF-NONE-MATCH']);
|
50 |
+
header('HTTP/1.1 304 Not Modified');
|
51 |
+
header('ETag: "' . $etag_value . '"');
|
52 |
+
echo $etag_value;
|
53 |
+
}
|
54 |
+
exit;
|
55 |
+
}
|
56 |
+
|
57 |
+
// set our etag
|
58 |
+
header('ETag: "' . $_COOKIE[$cookie_name] . '"');
|
59 |
+
echo $_COOKIE[$cookie_name];
|
php/evercookie_png.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* evercookie, by samy kamkar, 09/20/2010
|
3 |
+
* http://samy.pl : [email protected]
|
4 |
+
*
|
5 |
+
* This is the server-side variable PNG generator for evercookie.
|
6 |
+
* If an HTTP cookie is passed, the cookie data gets converted into
|
7 |
+
* RGB-values in a PNG image. The PNG image is printed out with a
|
8 |
+
* 20-year cache expiration date.
|
9 |
+
*
|
10 |
+
* If for any reason this file is accessed again WITHOUT the cookie,
|
11 |
+
* as in the user deleted their cookie, the code returns back with
|
12 |
+
* a forced 'Not Modified' meaning the browser should look at its
|
13 |
+
* cache for the image.
|
14 |
+
*
|
15 |
+
* The client-side code then places the cached image in a canvas and
|
16 |
+
* reads it in pixel by pixel, converting the PNG back into a cookie.
|
17 |
+
*
|
18 |
+
* -samy kamkar
|
19 |
+
*/
|
20 |
+
|
21 |
+
// we get cookie name from current file name so remember about it when rename of this file will be required
|
22 |
+
include dirname(__FILE__) . DIRECTORY_SEPARATOR . '_cookie_name.php';
|
23 |
+
$cookie_name = evercookie_get_cookie_name(__FILE__);
|
24 |
+
|
25 |
+
// we don't have a cookie, user probably deleted it, force cache
|
26 |
+
if (empty($_COOKIE[$cookie_name])) {
|
27 |
+
if(!headers_sent()) {
|
28 |
+
header('HTTP/1.1 304 Not Modified');
|
29 |
+
}
|
30 |
+
exit;
|
31 |
+
}
|
32 |
+
|
33 |
+
// width of 200 means 600 bytes (3 RGB bytes per pixel)
|
34 |
+
$x = 200;
|
35 |
+
$y = 1;
|
36 |
+
|
37 |
+
$gd = imagecreatetruecolor($x, $y);
|
38 |
+
|
39 |
+
$data_arr = str_split($_COOKIE[$cookie_name]);
|
40 |
+
|
41 |
+
$x = 0;
|
42 |
+
$y = 0;
|
43 |
+
for ($i = 0, $i_count = count($data_arr); $i < $i_count; $i += 3) {
|
44 |
+
$red = isset($data_arr[$i]) ? ord($data_arr[$i]) : 0;
|
45 |
+
$green = isset($data_arr[$i+1]) ? ord($data_arr[$i+1]) : 0;
|
46 |
+
$blue = isset($data_arr[$i+2]) ? ord($data_arr[$i+2]) : 0;
|
47 |
+
$color = imagecolorallocate($gd, $red, $green, $blue);
|
48 |
+
imagesetpixel($gd, $x++, $y, $color);
|
49 |
+
}
|
50 |
+
|
51 |
+
if(!headers_sent()) {
|
52 |
+
header('Content-Type: image/png');
|
53 |
+
header('Last-Modified: Wed, 30 Jun 2010 21:36:48 GMT');
|
54 |
+
header('Expires: Tue, 31 Dec 2030 23:30:45 GMT');
|
55 |
+
header('Cache-Control: private, max-age=630720000');
|
56 |
+
}
|
57 |
+
|
58 |
+
// boom. headshot.
|
59 |
+
imagepng($gd);
|
php/hsts_cookie.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//header('Access-Control-Allow-Origin: *');
|
3 |
+
$is_ssl = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443;
|
4 |
+
|
5 |
+
if(isset($_GET['SET'])){
|
6 |
+
if($is_ssl){
|
7 |
+
header('Strict-Transport-Security: max-age=31536000');
|
8 |
+
header('Content-type: image/png');
|
9 |
+
echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAgAAAAJCAIAAACAMfp5AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYSURBVBhXY/z//z8DNsAEpTHAkJJgYAAAo0sDD8axyJQAAAAASUVORK5CYII=');
|
10 |
+
}else{
|
11 |
+
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
12 |
+
header("Location: $redirect");
|
13 |
+
}
|
14 |
+
die();
|
15 |
+
}
|
16 |
+
|
17 |
+
if(isset($_GET['DEL'])){
|
18 |
+
if($is_ssl){
|
19 |
+
header('Strict-Transport-Security: max-age=0');
|
20 |
+
}else{
|
21 |
+
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
22 |
+
header("Location: $redirect");
|
23 |
+
}
|
24 |
+
die();
|
25 |
+
}
|
26 |
+
|
27 |
+
if($is_ssl){
|
28 |
+
header('Content-type: image/png');
|
29 |
+
// some white pixel
|
30 |
+
echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAgAAAAJCAIAAACAMfp5AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYSURBVBhXY/z//z8DNsAEpTHAkJJgYAAAo0sDD8axyJQAAAAASUVORK5CYII=');
|
31 |
+
die();
|
32 |
+
}else{
|
33 |
+
header('X-PHP-Response-Code: 404', true, 404);
|
34 |
+
}
|
35 |
+
?>
|