dropbox.html
685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
	<head>
		<title></title>
	</head>
	<body>
		<script>
			if (window.opener != null && window.opener.onDropboxCallback != null)
			{
				try
				{
 					var hash = window.location.hash;
 					var i1 = hash.indexOf('access_token=');
 					var token = null;
 					
 					if (i1 >= 0)
 					{
 						var i2 = hash.indexOf('&', i1 + 13);
 						
 						if (i2 > i1)
 						{
 							token = hash.substring(i1 + 13, i2);
 						}
 					}
					// Continues execution of main program flow
					window.opener.onDropboxCallback(token, window);
				}
				catch (e)
				{
					alert('Dropbox: ' + e.toString());
					window.close();
				}
			}
		</script>
	</body>
</html>