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

Cross platform extension #569

Merged
merged 5 commits into from Jun 19, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

Use -lite modules when running on Android.

  • Loading branch information
sammacbeth committed Jun 16, 2020
commit 989ac4252beb2fb3be7b5ecac1c3340acfd907a4
@@ -16,7 +16,7 @@
*/
import { debounce, every, size } from 'underscore';
import moment from 'moment/min/moment-with-locales.min';
import cliqz from './classes/Cliqz';
import cliqz, { HUMANWEB_MODULE, HPN_MODULE } from './classes/Cliqz';
// object class
import Events from './classes/EventHandlers';
import Policy from './classes/Policy';
@@ -75,8 +75,9 @@ const moduleMock = {
isEnabled: false,
on: () => {},
};
const humanweb = cliqz.modules['human-web'];
const { adblocker, antitracking, hpnv2 } = cliqz.modules;
const humanweb = cliqz.modules[HUMANWEB_MODULE];
const hpnv2 = cliqz.modules[HPN_MODULE];
const { adblocker, antitracking } = cliqz.modules;
const offers = cliqz.modules['offers-v2'] || moduleMock;
const insights = cliqz.modules.insights || moduleMock;
// add ghostery module to expose ghostery state to cliqz
@@ -15,4 +15,20 @@
import CLIQZ from 'browser-core';
import globals from './Globals';

const IS_ANDROID = globals.BROWSER_INFO.os === 'android';
export const HUMANWEB_MODULE = IS_ANDROID ? 'human-web-lite' : 'human-web';
export const HPN_MODULE = IS_ANDROID ? 'hpn-lite' : 'hpnv2';
// override the default prefs based on the platform
CLIQZ.config.default_prefs = {

This comment has been minimized.

@chrmod

chrmod Jun 17, 2020
Member

config.settings.HW_CHANNEL should be set to android for human-web-lite.

...CLIQZ.config.default_prefs,
// the following are enabled by default on non-android platforms
'modules.human-web.enabled': !IS_ANDROID,
'modules.hpnv2.enabled': !IS_ANDROID,
'modules.offers-v2.enabled': !IS_ANDROID,
'modules.offers-banner.enabled': !IS_ANDROID,
// the following are enabled for android only
'modules.human-web-lite.enabled': IS_ANDROID,
'modules.hpn-lite.enabled': IS_ANDROID,
};

export default new (CLIQZ.App)({ debug: globals.DEBUG });
ProTip! Use n and p to navigate between commits in a pull request.