Skip to content

Commit

Permalink
Change to use features of ES6
Browse files Browse the repository at this point in the history
* Change to use "let" and "const"
* Fix indent level
  • Loading branch information
sorairolake committed Jul 25, 2019
1 parent b9c0aa8 commit 8f67191
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
"use strict";

var requestFilter = {
urls: ["https://*.twitter.com/*"]
},
const requestFilter = {
urls: ["https://*.twitter.com/*"]
};

extraInfoSpec = ['requestHeaders', 'blocking'],
// Chrome will call your listener function in response to every
// HTTP request
handler = function (details) {
const extraInfoSpec = ['requestHeaders', 'blocking'];
// Chrome will call your listener function in response to every
// HTTP request
const handler = function (details) {

var headers = details.requestHeaders,
blockingResponse = {};
let headers = details.requestHeaders;
let blockingResponse = {};

for (var i = 0, l = headers.length; i < l; ++i) {
if (headers[i].name == 'User-Agent') {
headers[i].value = 'Mozilla/5.0 (Windows NT 9.0; WOW64; Trident/7.0; rv:11.0) like Gecko';
break;
}
for (let i = 0, const l = headers.length; i < l; ++i) {
if (headers[i].name == 'User-Agent') {
headers[i].value = 'Mozilla/5.0 (Windows NT 9.0; WOW64; Trident/7.0; rv:11.0) like Gecko';
break;
}
}

blockingResponse.requestHeaders = headers;
return blockingResponse;
};
blockingResponse.requestHeaders = headers;
return blockingResponse;
};

function removeCookie() {
chrome.browsingData.remove({"origins": ["https://twitter.com"]}, {"cacheStorage": true, "cache": true});
Expand Down

0 comments on commit 8f67191

Please sign in to comment.