Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1429 Add WebSockets and bump mininum version numbers #234

Merged
merged 10 commits into from Nov 6, 2018
@@ -140,8 +140,8 @@ $ ./fern.js pack configs/ghostery.js

+ Firefox: 52+
+ Firefox Android: 55+
+ Chrome: 49+
+ Opera: 36+
+ Chrome: 58+
+ Opera: 45+
+ Edge: 34.14291+

## Contribute
@@ -9,8 +9,8 @@
"author": "Ghostery",
"name": "__MSG_name__",
"short_name": "Ghostery",
"version": "8.2.4",
"version_name": "8.2.4",
"version": "8.3.0",
"version_name": "8.3.0",
"default_locale": "en",
"description": "__MSG_short_description__",
"debug": true,
@@ -79,6 +79,8 @@
"tabs",
"http://*/*",
"https://*/*",
"ws://*/*",
"wss://*/*",
"storage"
],
"background": {
@@ -88,8 +90,8 @@
"persistent": true
},
"minimum_edge_version": "33.14281.1000.0",
"minimum_chrome_version": "49",
"minimum_opera_version": "36",
"minimum_chrome_version": "58",
"minimum_opera_version": "45",
"web_accessible_resources": [
"app/images/*",
"dist/css/rewards_styles.css"
@@ -1419,12 +1419,18 @@ function initializePopup() {
* @memberOf Background
*/
function addCommonGhosteryAndAntitrackingListeners() {
chrome.webRequest.onBeforeRequest.addListener(onBeforeRequest, {
urls: ['http://*/*', 'https://*/*']
}, ['blocking']);
chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {
urls: ['http://*/*', 'https://*/*']
}, ['responseHeaders']);
let urlFilters = ['http://*/*', 'https://*/*', 'ws://*/*', 'wss://*/*'];
if (IS_EDGE) {
// Edge doesn't support WebSockets
urlFilters = urlFilters.reduce((accumulator, currentValue) => {
if (!currentValue.match(/^wss?:\/\//)) {
accumulator.push(currentValue);
}
return accumulator;
}, []);
}
chrome.webRequest.onBeforeRequest.addListener(onBeforeRequest, { urls: urlFilters }, ['blocking']);
chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, { urls: urlFilters }, ['responseHeaders']);
}

/**
ProTip! Use n and p to navigate between commits in a pull request.