Repository navigation
Expand file tree
/
Copy pathopenid.js
More file actions
47 lines (40 loc) · 1.63 KB
/
Copy pathopenid.js
File metadata and controls
47 lines (40 loc) · 1.63 KB
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
38
39
40
41
42
43
44
45
46
47
// This code detects attempts to login using OpenID/oAuth
var my_openid_requests = [];
function openid_before_request_cb(details) {
console.log("Here here: BEFORE REQUEST: " + JSON.stringify(details));
print_url_params(details.url);
if (details.requestBody != undefined) {
console.log("Here here: REQUEST BODY: " + JSON.stringify(details.requestBody));
}
// if (JSON.stringify(details).toLowerCase().indexOf("openid") != -1 ||
// my_openid_requests.indexOf(details.requestId) != -1) {
// my_openid_requests.push(details.requestId);
// console.log("Here here: BEFORE REQUEST: " + JSON.stringify(details));
// print_url_params(details.url);
// if (details.requestBody != undefined) {
// if (details.requestBody.raw != undefined) {
// for (var i = 0; i < details.requestBody.raw.length; i++) {
// var bdy = download_ab2str(details.requestBody.raw[i].bytes);
// console.log("Here here: REQUEST BODY("+i+"): " + bdy);
// }
// }
// }
// }
}
function openid_before_send_headers_cb(details) {
if (my_openid_requests.indexOf(details.requestId) != -1 ||
my_openid_requests.indexOf(details.requestId) != -1) {
console.log("Here here: BEFORE SEND HEADERS: " + JSON.stringify(details));
print_url_params(details.url);
}
}
// chrome.webRequest.onBeforeRequest.addListener(openid_before_request_cb,
// {
// "urls": ["<all_urls>"],
// },
// ["blocking", "requestBody"]);
// chrome.webRequest.onBeforeSendHeaders.addListener(openid_before_send_headers_cb,
// {
// "urls": ["<all_urls>"],
// },
// ["blocking", "requestHeaders"]);