this "fixes" #281

This commit is contained in:
gorhill 2014-10-08 14:42:09 -04:00
parent a622786c77
commit be3f0cac07

View file

@ -235,15 +235,20 @@ var cr410382Workaround = function(details) {
return; return;
} }
// https://github.com/gorhill/uBlock/issues/281
// Looks like Chrome 38 (but not 39) doesn't provide the expected request
// header `X-Requested-With`. Sigh.
var requestType = 'object';
// Lookup "X-Requested-With" header: this will tell us whether the request // Lookup "X-Requested-With" header: this will tell us whether the request
// is of type "object". // is of type "object".
// Reference: https://code.google.com/p/chromium/issues/detail?id=145090 // Reference: https://code.google.com/p/chromium/issues/detail?id=145090
var requestedWith = headerValue(details.requestHeaders, 'x-requested-with'); //var requestedWith = headerValue(details.requestHeaders, 'x-requested-with');
// Reference: https://codereview.chromium.org/451923002/patch/120001/130008 // Reference: https://codereview.chromium.org/451923002/patch/120001/130008
var requestType = requestedWith.indexOf('ShockwaveFlash') !== -1 ? //var requestType = requestedWith.indexOf('ShockwaveFlash') !== -1 ?
'object' : // 'object' :
'other'; // 'other';
// Lookup the page store associated with this tab id. // Lookup the page store associated with this tab id.
var pageStore = µb.pageStoreFromTabId(details.tabId); var pageStore = µb.pageStoreFromTabId(details.tabId);