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

GIS-866: Search Communication #647

Merged
merged 17 commits into from Jan 7, 2021

only init on gb

  • Loading branch information
fcjr committed Dec 22, 2020
commit 0985b0fac4c9d701861d2e66cc9aa316febd5c5b
@@ -67,6 +67,7 @@ const {
CDN_BASE_URL, BROWSER_INFO, IS_CLIQZ
} = globals;
const IS_EDGE = (BROWSER_INFO.name === 'edge');
const IS_GHOSTERY_BROWSER = (BROWSER_INFO.name === 'ghostery_desktop');
This conversation was marked as resolved by christophertino

This comment has been minimized.

@christophertino

christophertino Dec 24, 2020
Member

This is asynchronous. Check out globals.BROWSER_INFO_READY instead.

This comment has been minimized.

@fcjr

fcjr Dec 24, 2020
Author Member

Ah thanks, updated to await BROWSER_INFO_READY, however I see the browser info is being used before verifying that it is populated in a few other places which we should address in another PR -- we should also probably have BROWSER_INFO_READY short circuit if once a successful call to buildBrowserInfo is completed as currently every time we await globals.BROWSER_INFO_READY we are unnecessarily recalculating these values.

This comment has been minimized.

@christophertino

christophertino Jan 4, 2021
Member

Let's remove this line completely since it's evaluated at runtime and unreliable. The other browser_info checks should be working as is. The async check only applies to the desktop browser and Android browser to allow us to differentiate from stock FF.

const IS_FIREFOX = (BROWSER_INFO.name === 'firefox');
const IS_ANDROID = (BROWSER_INFO.os === 'android');
const VERSION_CHECK_URL = `${CDN_BASE_URL}/update/version`;
@@ -1650,10 +1651,10 @@ function initializeGhosteryModules() {
}

/**
* Initialize Search Messaging.
* Initialize Search Message Handler.
* @memberOf Background
*/
function initializeSearchMessaging() {
function initializeSearchMessageHandler() {
const sm = new searchMessager();
sm.init()
}
@@ -1669,7 +1670,9 @@ function init() {
initializePopup();
initializeEventListeners();
initializeVersioning();
initializeSearchMessaging();
if (IS_GHOSTERY_BROWSER) {
initializeSearchMessageHandler();
}
return metrics.init(globals.JUST_INSTALLED).then(() => initializeGhosteryModules().then(() => {
account.migrate()
.then(() => {
ProTip! Use n and p to navigate between commits in a pull request.