diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 5c2163522..000000000 --- a/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": ["@babel/preset-react"], - "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-object-rest-spread" - ], - "env": { - "test": { - "plugins": ["@babel/plugin-transform-modules-commonjs"] - } - } -} diff --git a/.eslintignore b/.eslintignore index 0e8770f5e..8967ab03f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -12,3 +12,10 @@ app/content-scripts/vendor/ ## Precompiled app/templates/ +build/ +cliqz/ +dist/ +docs/ + +## Node Modules +node_modules/ diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..d1649903b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,89 @@ +/** + * ESLint Config + * + * Ghostery Browser Extension + * https://www.ghostery.com/ + * + * Copyright 2019 Ghostery, Inc. All rights reserved. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +module.exports = { + env: { + browser: true, + es6: true, + commonjs: true, + jest: true + }, + extends: 'airbnb', + globals: { + chrome: true, + t: true, + Atomics: 'readonly', + SharedArrayBuffer: 'readonly', + }, + parser: 'babel-eslint', + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 2018, + sourceType: 'module', + }, + plugins: [ + 'react', + ], + // 0 = off, 1 = warn, 2 = error + rules: { + 'camelcase': [0], + 'class-methods-use-this': [0], + 'comma-dangle': [2, { + 'arrays': 'only-multiline', + 'objects': 'only-multiline', + 'functions': 'ignore' + }], + 'func-names': [0], + 'indent': [1, 'tab', { + 'SwitchCase': 1 + }], + 'lines-between-class-members': [1], + 'max-len': [0], + 'newline-per-chained-call': [0, { 'ignoreChainWithDepth': 2 }], + 'no-mixed-operators': [0], + 'no-nested-ternary': [0], + 'no-param-reassign': [0], // TODO: enable this check + 'no-plusplus': [0], + 'no-prototype-builtins': [0], // TODO: enable this check + 'no-restricted-syntax': [0], // TODO: enable this check + 'no-tabs': [0], + 'no-underscore-dangle': [0], + 'no-unused-vars': [1], + 'no-useless-escape': [1], + 'operator-linebreak': [0], + 'space-before-function-paren': [2, 'never'], + + // Plugin: Import + 'import/no-cycle': [0], + 'import/prefer-default-export': [0], + + // Plugin: React + 'react/destructuring-assignment': [0], + 'react/jsx-indent': [1, 'tab'], + 'react/jsx-indent-props': [1, 'tab'], + 'react/no-access-state-in-setstate': [0], // TODO: enable this check + 'react/no-danger': [0], + 'react/prop-types': [0], + + // Plugin: JSX-A11y + 'jsx-a11y/alt-text': [0], + 'jsx-a11y/anchor-is-valid': [0], + 'jsx-a11y/click-events-have-key-events': [0], + 'jsx-a11y/label-has-for': [0], + 'jsx-a11y/mouse-events-have-key-events': [0], + 'jsx-a11y/no-noninteractive-element-interactions': [0], + 'jsx-a11y/no-static-element-interactions': [0], + }, +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 242d0681d..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "extends": "airbnb", - "env": { - "browser": true, - "es6": true, - "amd": true, - "jest": true - }, - "parser": "babel-eslint", - "parserOptions": { - "ecmaFeatures": { - "experimentalObjectRestSpread": true, - "jsx": true - }, - "sourceType": "module" - }, - "globals": { - "chrome": true, - "t": true - }, - "rules": { - "linebreak-style": [0], - "no-tabs": [0], - "indent": ["warn", "tab", { - "SwitchCase": 1 - }], - "react/jsx-indent": ["warn", "tab", { - "SwitchCase": 1 - }], - "react/jsx-indent-props": [1, "tab"], - "function-paren-newline": [0], - "func-names": [0], - "no-unused-vars": [1], - "no-plusplus": [0], - "no-control-regex": [0], - "no-useless-escape": [0], - "import/prefer-default-export": [0], - "class-methods-use-this": [0], - "no-restricted-syntax": [0], - "no-mixed-operators": [0], - "camelcase":[0], - "no-param-reassign": [2, { "props": false }], - "react/prop-types": [0], - "max-len": [0], - "no-nested-ternary": [0], - "no-underscore-dangle": [0], - "no-prototype-builtins": [0], - "react/no-danger": [0], - "jsx-a11y/alt-text": [0], - "jsx-a11y/no-static-element-interactions": [0], - "jsx-a11y/no-noninteractive-element-interactions": [0], - "jsx-a11y/click-events-have-key-events": [0], - "jsx-a11y/anchor-is-valid": [0], - "jsx-a11y/label-has-for": [0], - "jsx-a11y/mouse-events-have-key-events": [0], - "comma-dangle": ["error", { - "arrays": "only-multiline", - "objects": "only-multiline", - "functions": "ignore" - }] - } -} diff --git a/.gitignore b/.gitignore index f2bc03361..2a9bbcb68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ ## Build Files dist/ build/ -web-ext-artifacts/ -*precompiled/ licenses.json ## Node diff --git a/.travis.yml b/.travis.yml index 21d47318b..4873c486c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ install: script: - node ./tools/licenses/fetchLicenses.js - - yarn run lint - - yarn run test.unit + - yarn lint + - yarn test.unit diff --git a/CODEOWNERS b/CODEOWNERS index d1957ec9f..fb3fb8d25 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,6 +1,6 @@ # Ghostery CODEOWNERS # Each line is a file pattern followed by one or more owners, -# the last matching pattern has the most precendence. +# the last matching pattern has the most precedence. # Core Ghostery team * @ghostery/ghostery @@ -24,14 +24,10 @@ # Shared Components /app/shared-components @IAmThePan -# Rewards -/app/content-scripts/rewards/ @trickpattyFH20 -/app/panel/components/Rewards.jsx @trickpattyFH20 -/src/classes/Rewards.js @trickpattyFH20 - # Build Tools -webpack.config.js @trickpattyFH20 -.eslintrc.json @trickpattyFH20 +.eslintrc.js @christophertino +babel.config.js @christophertino +webpack.config.js @christophertino # Unit Tests /test/ @IAmThePan diff --git a/README.md b/README.md index 7f156fb9e..3f5ab934f 100644 --- a/README.md +++ b/README.md @@ -36,17 +36,17 @@ $ yarn upgrade ## Building ```sh # Build all sources -$ yarn run build.dev +$ yarn build.dev ``` ```sh # Build for production -$ yarn run build.prod +$ yarn build.prod ``` ```sh # Build and watch for changes -$ yarn run build.watch +$ yarn build.watch ``` ## Enable Debugging / Logging @@ -57,33 +57,40 @@ $ yarn run build.watch ``` ## Testing and Linting +```sh +# Update Jest snapshot artifacts +$ yarn test.snapshot +``` + ```sh # Run unit tests -$ yarn run test.unit +$ yarn test.unit ``` ```sh # Run linter over the ./app and ./src folders -$ yarn run lint +$ yarn lint ``` ```sh # Lint a specific file -$ yarn run lint.raw -- src/utils/matcher.js +$ yarn lint.raw src/utils/matcher.js ``` ```sh -# Disable lint -$ NO_LINT=true yarn run build.dev +# Test i18n string lengths for panel UI +$ yarn leet +# Reset back to original en language file +$ yarn leet.reset ``` ## Build Docs ```sh # Build JSDoc files to ./docs -$ yarn run docs +$ yarn docs ``` -## Translating Files +## Internationalization We use Transifex and their CLI to manage our translation files. Follow [these instructions](https://docs.transifex.com/client/installing-the-client) to get started. @@ -162,15 +169,7 @@ See [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE-OF-CONDUCT.md) + [Ghostery Lite for Safari](https://github.com/ghostery/GhosterySafari) ## Ghostery Team -Ghostery relies on [contributions](https://github.com/ghostery/ghostery-extension/graphs/contributors) from lots of talented people. Our core development team looks like this: - - |  |  |  |  -:---:|:---:|:---:|:---:|:---: -[Christopher Tino](http://github.com/christophertino) | [José María Signanini](https://github.com/jsignanini) | [Serge Zarembsky](https://github.com/zarembsky) | [Patrick Lawler](https://github.com/trickpattyFH20) | [Caleb Richelson](https://github.com/IAmThePan) - |  |  |  |  -Aziz Aithsaine | [Ethan Gooding](https://github.com/Eden12345) | [Frank Chiarulli](https://github.com/fcjr) | [Ilya Zarembsky](https://github.com/wlycdgr) | [Valmik Patel](https://github.com/valmikkpatel) - -See the full montage of uncommonly attractive Ghosterians/Cliqzers [here](https://www.cliqz.com/about/team). +Ghostery relies on [contributions](https://github.com/ghostery/ghostery-extension/graphs/contributors) from lots of talented people. See the full montage of uncommonly attractive Ghosterians/Cliqzers [here](https://www.cliqz.com/about/team). ## License [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/) Copyright 2019 Ghostery, Inc. All rights reserved. diff --git a/app/Account/__tests__/AccountActions.js b/app/Account/__tests__/AccountActions.js index a722d1655..b2507b57c 100644 --- a/app/Account/__tests__/AccountActions.js +++ b/app/Account/__tests__/AccountActions.js @@ -21,7 +21,7 @@ import { } from '../AccountConstants'; // Fake the translation function to only return the translation key -global.t = function (str) { +global.t = function(str) { return str; }; diff --git a/app/content-scripts/account_pages.js b/app/content-scripts/account_pages.js index f9dd35d4a..32a0a0465 100644 --- a/app/content-scripts/account_pages.js +++ b/app/content-scripts/account_pages.js @@ -24,7 +24,7 @@ const { sendMessage } = msg; * Use to call init to initialize functionality * @var {Object} initialized to an object with init method as its property */ -const AccountPagesContentScript = (function (window) { +const AccountPagesContentScript = (function(window) { /** * Initialize functionality of this script. * @memberOf AccountPagesContentScript @@ -37,7 +37,7 @@ const AccountPagesContentScript = (function (window) { 'accountPage.getUserSubscriptionData', 'accountPage.logout', ]; - const _initialize = function () { + const _initialize = function() { _listeners.forEach(name => window.addEventListener(name, () => sendMessage(name))); }; diff --git a/app/content-scripts/click_to_play.js b/app/content-scripts/click_to_play.js index 7a216cf30..3164fc14b 100644 --- a/app/content-scripts/click_to_play.js +++ b/app/content-scripts/click_to_play.js @@ -25,7 +25,7 @@ const { onMessage } = chrome.runtime; * Use to call init function and initialize Click2PlayContentScript functionality. * @var {Object} initialized with an object with exported init as its property */ -const Click2PlayContentScript = (function (win, doc) { +const Click2PlayContentScript = (function(win, doc) { const C2P_DATA = {}; /** * Create element for the specified html tag @@ -35,7 +35,7 @@ const Click2PlayContentScript = (function (win, doc) { * @param {string} type html tag * @return {Object} DOM element */ - const createEl = function (type) { + const createEl = function(type) { return doc.createElement(type); }; /** @@ -46,7 +46,7 @@ const Click2PlayContentScript = (function (win, doc) { * @param {Object} parent parent DOM element * @param {...Object} args children DOM element(s) */ - const appendChild = function (parent, ...args) { + const appendChild = function(parent, ...args) { for (let i = 0; i < args.length; i++) { parent.appendChild(args[i]); } @@ -63,7 +63,7 @@ const Click2PlayContentScript = (function (win, doc) { * @param {Object} c2pAppDef replacement data * @param {string} html a fragment of html to be used in replacement. */ - const buildC2P = function (c2pFrame, c2pAppDef, html) { + const buildC2P = function(c2pFrame, c2pAppDef, html) { c2pFrame.addEventListener('load', () => { const idoc = c2pFrame.contentDocument; @@ -122,7 +122,7 @@ const Click2PlayContentScript = (function (win, doc) { * @param {Object} c2p_app an array with replacement data * @param {string} html a fragment of html to be used in replacement. */ - const applyC2P = function (app_id, c2p_app, html) { + const applyC2P = function(app_id, c2p_app, html) { c2p_app.forEach((c2pAppDef, idx) => { const els = doc.querySelectorAll(c2pAppDef.ele); for (let i = 0, num_els = els.length; i < num_els; i++) { @@ -155,7 +155,7 @@ const Click2PlayContentScript = (function (win, doc) { * @memberof Click2PlayContentScript * @package */ - const _initialize = function () { + const _initialize = function() { onMessage.addListener((request, sender, sendResponse) => { if (request.source === 'cliqz-content-script') { return false; diff --git a/app/content-scripts/content_script_bundle.js b/app/content-scripts/content_script_bundle.js new file mode 100644 index 000000000..229c21245 --- /dev/null +++ b/app/content-scripts/content_script_bundle.js @@ -0,0 +1,20 @@ +/** + * Cliqz Content Scripts + * + * This file compiles content scripts for Cliqz modules + * (Ad-Blocker, HPN, Human Web) + * + * Ghostery Browser Extension + * https://www.ghostery.com/ + * + * Copyright 2019 Ghostery, Inc. All rights reserved. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0 + */ +/** + * @namespace CliqzContentScript + */ + +import 'browser-core/build/core/content'; diff --git a/app/content-scripts/ghostery_dot_com.js b/app/content-scripts/ghostery_dot_com.js index f4602626c..95f61e1bd 100644 --- a/app/content-scripts/ghostery_dot_com.js +++ b/app/content-scripts/ghostery_dot_com.js @@ -37,14 +37,14 @@ const { onMessage } = chrome.runtime; * Use this variable to call init and initialize functionality of this script. * @var {Object} initialized with an object with init as its property */ -const GhosteryDotComContentScript = (function (window) { +const GhosteryDotComContentScript = (function(window) { /** * Update https://www.ghostery.com/Products page to signify * that Ghostery extension is installed. * @memberOf GhosteryDotComContentScript * @package */ - const productsPage = function () { + const productsPage = function() { const $installButton = $('#ghostery-extension-versions .install-button').not('.disabled'); $installButton.addClass('success').text('Installed ✓'); $installButton.removeAttr('onclick'); @@ -59,7 +59,7 @@ const GhosteryDotComContentScript = (function (window) { * @memberOf GhosteryDotComContentScript * @package */ - const toggleBlocking = function (blocked, duration) { + const toggleBlocking = function(blocked, duration) { if (!blocked) { $('#app-global-blocking').animate({ 'background-position-x': '-17px' }, { duration, @@ -83,7 +83,7 @@ const GhosteryDotComContentScript = (function (window) { * @memberOf GhosteryDotComContentScript * @package */ - const appsPages = function () { + const appsPages = function() { const $appGlobalBlocking = $('#app-global-blocking'); const $blockingBox = $('#blockingbox'); const app_id = $blockingBox.data('id'); @@ -145,7 +145,7 @@ const GhosteryDotComContentScript = (function (window) { * @memberOf GhosteryDotComContentScript * @package */ - const _initialize = function () { + const _initialize = function() { // initialize products page if ($('section.products-template').length) { productsPage(); diff --git a/app/content-scripts/notifications.js b/app/content-scripts/notifications.js index a9cf217fb..4f5254bc9 100644 --- a/app/content-scripts/notifications.js +++ b/app/content-scripts/notifications.js @@ -32,13 +32,13 @@ const IS_EDGE = (globals.BROWSER_INFO.name === 'edge'); * Use to call init to initialize functionality * @var {Object} initialized to an object with init method as its property */ -const NotificationsContentScript = (function (win, doc) { +const NotificationsContentScript = (function(win, doc) { const ALERT_ID = 'ALERT_ID_6AEC0607-8CC8-4904-BDEB-00F947E5E3C2'; let NOTIFICATION_TRANSLATIONS = {}; let CMP_DATA = {}; let CSS_INJECTED = false; let ALERT_SHOWN = false; - const createEl = function (type) { + const createEl = function(type) { return doc.createElement(type); }; /** @@ -49,7 +49,7 @@ const NotificationsContentScript = (function (win, doc) { * @param {Object} parent parent DOM element * @param {...Object} args children DOM element(s) */ - const appendChild = function (parent, ...args) { + const appendChild = function(parent, ...args) { for (let i = 0; i < args.length; i++) { parent.appendChild(args[i]); } @@ -59,7 +59,7 @@ const NotificationsContentScript = (function (win, doc) { * @memberOf NotificationsContentScript * @package */ - const injectCSS = function () { + const injectCSS = function() { const style = createEl('style'); const imp = ' !important;'; const reset = 'padding:0;margin:0;font:13px Arial,Helvetica;text-transform:none;font-size: 100%;vertical-align:baseline;line-height:normal;color:#fff;position:static;'; @@ -130,7 +130,7 @@ const NotificationsContentScript = (function (win, doc) { * @memberOf NotificationsContentScript * @package */ - const removeAlert = function () { + const removeAlert = function() { const el = doc.getElementById(ALERT_ID); if (el) { el.parentNode.removeChild(el); @@ -145,7 +145,7 @@ const NotificationsContentScript = (function (win, doc) { * * @return {Object} styled div DOM element */ - const createCloseButton = function () { + const createCloseButton = function() { const closeButton = createEl('div'); // .button class @@ -197,7 +197,7 @@ const NotificationsContentScript = (function (win, doc) { * * @return {Object} styled div DOM element */ - const createNotificationHeader = function () { + const createNotificationHeader = function() { const header = createEl('div'); header.style.backgroundColor = '#00aef0'; header.style.borderTopLeftRadius = '6px'; @@ -241,7 +241,7 @@ const NotificationsContentScript = (function (win, doc) { * * @return {Object} styled div DOM element */ - const createNotificationContent = function (message, linkUrl, linkText, linkClickFunc) { + const createNotificationContent = function(message, linkUrl, linkText, linkClickFunc) { const content = createEl('div'); content.style.borderRadius = '6px'; content.style.setProperty( @@ -306,7 +306,7 @@ const NotificationsContentScript = (function (win, doc) { * * @return {Object} styled div DOM element */ - const createUpgradeNotificationContent = function ( + const createUpgradeNotificationContent = function( imageData, title, message, linkUrl, linkText ) { const content = createEl('div'); @@ -400,7 +400,7 @@ const NotificationsContentScript = (function (win, doc) { `; buttonSpan.addEventListener('click', () => { - const callback = function () { + const callback = function() { removeAlert(); }; chrome.runtime.sendMessage({ @@ -423,7 +423,7 @@ const NotificationsContentScript = (function (win, doc) { * * @return {Object} styled div DOM element */ - const createAlert = function () { + const createAlert = function() { let alert_div = doc.getElementById(ALERT_ID); if (alert_div) { alert_div.parentNode.removeChild(alert_div); @@ -458,7 +458,7 @@ const NotificationsContentScript = (function (win, doc) { * @memberOf NotificationsContentScript * @package */ - const showBrowseWindow = function (translations) { + const showBrowseWindow = function(translations) { if (ALERT_SHOWN) { return; } @@ -587,7 +587,7 @@ const NotificationsContentScript = (function (win, doc) { * @memberOf NotificationsContentScript * @package */ - const updateBrowseWindow = function (result = {}) { + const updateBrowseWindow = function(result = {}) { const s = doc.getElementById('ghostery-browse-window-span'); while (s.firstChild) { s.removeChild(s.firstChild); @@ -610,7 +610,7 @@ const NotificationsContentScript = (function (win, doc) { * @memberOf NotificationsContentScript * @package */ - const exportFile = function (content) { + const exportFile = function(content) { const textFileAsBlob = new Blob([content], { type: 'text/plain' }); const d = new Date(); const fileNameToSaveAs = `Ghostery-Backup-${d.getMonth() + 1}-${d.getDate()}-${d.getFullYear()}.ghost`; @@ -639,7 +639,7 @@ const NotificationsContentScript = (function (win, doc) { * * @return {boolean} */ - const _isElementInViewport = function (el) { + const _isElementInViewport = function(el) { const rect = el.getBoundingClientRect(); return ( @@ -660,7 +660,7 @@ const NotificationsContentScript = (function (win, doc) { * @param {string} type the type of notification to show * @param {object} options message data to pass to the notification */ - const showAlert = function (type, options) { + const showAlert = function(type, options) { if (ALERT_SHOWN) { return; } @@ -727,7 +727,7 @@ const NotificationsContentScript = (function (win, doc) { * * @return {boolean} */ - const _initialize = function () { + const _initialize = function() { onMessage.addListener((request, sender, sendResponse) => { if (request.source === 'cliqz-content-script') { return false; diff --git a/app/content-scripts/page_performance.js b/app/content-scripts/page_performance.js index 679dc2cbf..2360367dc 100644 --- a/app/content-scripts/page_performance.js +++ b/app/content-scripts/page_performance.js @@ -27,14 +27,14 @@ const { sendMessage } = msg; * Use to call init to initialize functionality * @var {Object} initialized to an object with init method as its property */ -const PageInfo = (function (window, document) { +const PageInfo = (function(window, document) { let state = document.readyState; /** * Calculate page domain and latency. Send pageInfo to background.js. * @memberOf PagePerformanceContentScript * @package */ - const analyzePageInfo = function () { + const analyzePageInfo = function() { const { host, pathname, protocol } = document.location; const pTime = (performance.timing.domContentLoadedEventStart - performance.timing.requestStart); const pageLatency = pTime || 0; @@ -57,11 +57,11 @@ const PageInfo = (function (window, document) { * @memberOf PagePerformanceContentScript * @package */ - const _initialize = function () { + const _initialize = function() { // manually check to see if the onLoad event has fired, since this script runs at document_idle // and does not guarantee that onLoad has triggered if (state !== 'complete') { - document.onreadystatechange = function () { + document.onreadystatechange = function() { state = document.readyState; if (state === 'complete') { analyzePageInfo(); diff --git a/app/content-scripts/purplebox.js b/app/content-scripts/purplebox.js index 3f3afec52..01f9d2743 100644 --- a/app/content-scripts/purplebox.js +++ b/app/content-scripts/purplebox.js @@ -34,7 +34,7 @@ const { onMessage } = chrome.runtime; * Use to call init to initialize purplebox functionality * @var {Object} initialized to an object with init method as its property */ -const Ghostery = (function (win, doc) { +const Ghostery = (function(win, doc) { const TIMEOUTS = { box_position_timeout: 0, box_destroy_timeout: 9999, @@ -69,7 +69,7 @@ const Ghostery = (function (win, doc) { * @param {string} type html tag * @return {Object} DOM element */ - const createEl = function (type) { + const createEl = function(type) { return doc.createElement(type); }; /** @@ -80,7 +80,7 @@ const Ghostery = (function (win, doc) { * @param {Object} parent parent DOM element * @param {...Object} args children DOM element(s) */ - const appendChild = function (parent, ...args) { + const appendChild = function(parent, ...args) { for (let i = 0; i < args.length; i++) { parent.appendChild(args[i]); } @@ -94,7 +94,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const destroyPurpleBox = function () { + const destroyPurpleBox = function() { if (ghostery && ghostery.parentNode) { ghostery.parentNode.removeChild(ghostery); } @@ -112,7 +112,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const resetDestroyTimer = function () { + const resetDestroyTimer = function() { clearTimeout(TIMEOUTS.box_destroy_timeout); if (BOX_CONF.alert_bubble_timeout > 0) { TIMEOUTS.box_destroy_timeout = setTimeout(() => { @@ -125,7 +125,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const handleSizeChangeClick = function () { + const handleSizeChangeClick = function() { if (ghostery) { BOX_CONF.alert_expanded = !BOX_CONF.alert_expanded; doSizeChange(); @@ -136,7 +136,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const removeListeners = function () { + const removeListeners = function() { close.removeEventListener('click', destroyPurpleBox); box.removeEventListener('click', handleSizeChangeClick); background.removeEventListener('click', handleSizeChangeClick); @@ -147,7 +147,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const addListeners = function () { + const addListeners = function() { close.addEventListener('click', destroyPurpleBox); box.addEventListener('click', handleSizeChangeClick); background.addEventListener('click', handleSizeChangeClick); @@ -158,7 +158,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const doSizeChange = function () { + const doSizeChange = function() { const windowHeight = Math.max(win.innerHeight - 105, 55); resetDestroyTimer(); @@ -211,7 +211,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const setBoxHeights = function () { + const setBoxHeights = function() { let digits; const listHeight = (list.children.length * 18) + 20; // 20px for top/bottom padding @@ -303,7 +303,7 @@ const Ghostery = (function (win, doc) { * * @return {Object} tracker div and hasIcon as its properties */ - const createTrackerDiv = function (app) { + const createTrackerDiv = function(app) { let icon; let hasIcon = false; @@ -355,7 +355,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const handleNewTrackers = function (apps) { + const handleNewTrackers = function(apps) { const trackersText = title; const trackers = list.childNodes; for (let n = 0; n < apps.length; n++) { @@ -420,7 +420,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const clearTrackersNone = function () { + const clearTrackersNone = function() { count.style.background = 'none'; count.style.color = '#ffffff'; }; @@ -430,7 +430,7 @@ const Ghostery = (function (win, doc) { * @memberOf PurpleBoxContentScript * @package */ - const createPurpleBox = function () { + const createPurpleBox = function() { ghostery = createEl('div'); box = createEl('div'); count = createEl('div'); @@ -547,7 +547,7 @@ const Ghostery = (function (win, doc) { * * @return {boolean} */ - const handleMessages = function (request, sender, sendResponse) { + const handleMessages = function(request, sender, sendResponse) { // Filter out messages coming from Cliqz context script bundle if (request.source === 'cliqz-content-script') { return false; @@ -594,7 +594,7 @@ const Ghostery = (function (win, doc) { * @package * @todo check if channels are supported across the board. Then we can remove fallback code */ - const _initialize = function () { + const _initialize = function() { if (channelsSupported) { port = chrome.runtime.connect({ name: 'purpleBoxPort' }); if (port) { diff --git a/app/content-scripts/rewards/HotDog.jsx b/app/content-scripts/rewards/HotDog.jsx index 876f517d5..b7f8981ad 100644 --- a/app/content-scripts/rewards/HotDog.jsx +++ b/app/content-scripts/rewards/HotDog.jsx @@ -66,16 +66,16 @@ class HotDog extends Component { render() { return (
@@ -150,7 +151,8 @@ class CreateAccount extends React.Component {
{ t('invalid_email_confirmation') }
@@ -181,7 +183,8 @@ class CreateAccount extends React.Component {
diff --git a/app/panel/components/Header.jsx b/app/panel/components/Header.jsx
index 61dc8aba8..8768b72c2 100644
--- a/app/panel/components/Header.jsx
+++ b/app/panel/components/Header.jsx
@@ -209,17 +209,17 @@ class Header extends React.Component {
const backArrowAndGhostieLogo = (
-
{ t('invalid_email_login') }
{ t('password_field_label_required') }
diff --git a/app/panel/components/Panel.jsx b/app/panel/components/Panel.jsx index a0be47a27..684d21b4d 100644 --- a/app/panel/components/Panel.jsx +++ b/app/panel/components/Panel.jsx @@ -89,6 +89,7 @@ class Panel extends React.Component { sendMessage('reloadTab', { tab_id: +this.props.tab_id }); window.close(); } + /** * Filter trackers when clicking on compatibility/slow * tracker notifications and trigger appropriate action. @@ -163,21 +164,24 @@ class Panel extends React.Component { )} ); - } else if (needsReload) { + } + if (needsReload) { return ( {t('panel_needs_reload')} { t('alert_reload') } ); - } else if (this.props.notificationFilter === 'slow') { + } + if (this.props.notificationFilter === 'slow') { return ( { t('panel_tracker_slow_non_secure_end') } ); - } else if (this.props.notificationFilter === 'compatibility') { + } + if (this.props.notificationFilter === 'compatibility') { return ( @@ -210,7 +214,7 @@ class Panel extends React.Component {{ t('settings_signin_create_header') }
+{ t('settings_signin_create_header') }
{ t('settings_sign_create_text') }
{ t('settings_edit_account') }
+{ t('settings_edit_account') }
{ t('settings_export_header') }
-{ t('settings_export_text') }
-{ settingsData.exportResultText }
+{ t('settings_export_header') }
+{ t('settings_export_text') }
+{ settingsData.exportResultText }
{ t('settings_import_header') }
-{ t('settings_import_text') }
-{ t('settings_import_warning') }
-{ settingsData.importResultText }
+{ t('settings_import_text') }
+{ t('settings_import_warning') }
+{ settingsData.importResultText }
{ this.selectedFile = input; }} type="file" id="select-file" name="select-file" onChange={this.validateImportFile} />{t('panel_stats_trackers_seen')}
{subscriber ? trackersSeen : ''}
@@ -151,7 +151,7 @@ const StatsView = (props) => {{t('panel_stats_trackers_blocked')}
{subscriber ? trackersBlocked : ''}
@@ -159,7 +159,7 @@ const StatsView = (props) => {{t('panel_stats_trackers_anonymized')}
{subscriber ? trackersAnonymized : ''}
@@ -167,7 +167,7 @@ const StatsView = (props) => {{t('panel_stats_ads_blocked')}
{subscriber ? adsBlocked : ''}
@@ -175,38 +175,39 @@ const StatsView = (props) => {{t('panel_stats_reset_modal_yes')}
{t('panel_stats_reset_modal_no')}
{t('panel_stats_reset_modal_yes')}
{t('panel_stats_reset_modal_no')}