-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issues with tracking images not being caught on reply/fwd's. Hand…
…le tracking images with height/width of 0 (mailtrack.io). use latest version of jquery and gmail.js.
- Loading branch information
Omar Qureshi
committed
Apr 18, 2015
1 parent
e928e2e
commit 6329ceb
Showing
5 changed files
with
67 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
chrome.webRequest.onBeforeSendHeaders.addListener(function(req){ | ||
var blockingResponse = {}; | ||
// Determine whether to block this image req | ||
var safe = req.url.indexOf('safe-img-pbz') > 0? true:false; | ||
console.log('safe? ' + safe); | ||
var blocking_response = {}; | ||
// Determine whether to block this image request | ||
var safe = req.url.indexOf('safe-img-pbza') > 0? true:false; | ||
|
||
|
||
//Check if this request came from gmail | ||
var fromGmail = false, headers = req.requestHeaders; | ||
var from_gmail = false, headers = req.requestHeaders; | ||
for(var i = 0; i < headers.length; i++) { | ||
if(headers[i].name.toLowerCase() == 'referer'){ | ||
if(headers[i].value.indexOf('//mail.google.com/mail') > 0){ | ||
fromGmail = true; | ||
if(headers[i].value.indexOf('//mail.google.com/') > 0){ | ||
from_gmail = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
if(req.type == 'image' && !safe && fromGmail){ | ||
console.log(JSON.stringify(req)); | ||
blockingResponse.cancel = true; | ||
if(req.type == 'image' && !safe && from_gmail){ | ||
blocking_response.cancel = true; | ||
} | ||
return blockingResponse; | ||
return blocking_response; | ||
}, | ||
{urls: [ "*://*.googleusercontent.com/proxy/*" ]},['requestHeaders','blocking']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters