Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Fix Bug 1471389 - Add the remainder of CFR recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarracini committed Aug 24, 2018
1 parent 1407877 commit 969a2be
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 2 deletions.
Binary file added data/content/assets/cfr_amazon_assistant.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/content/assets/cfr_enhancer_youtube.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/content/assets/cfr_fb_container.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/content/assets/cfr_google_translate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/content/assets/cfr_reddit_enhancement.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/content/assets/cfr_wiki_search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
177 changes: 175 additions & 2 deletions lib/CFRMessageProvider.jsm
Expand Up @@ -13,6 +13,31 @@ const FACEBOOK_CONTAINER_PARAMS = {
open_urls: ["www.facebook.com"],
sumo_path: "extensionrecommendations"
};
const GOOGLE_TRANSLATE_PARAMS = {
existing_addons: ["jid1-93WyvpgvxzGATw@jetpack", "{087ef4e1-4286-4be6-9aa3-8d6c420ee1db}", "{4170faaa-ee87-4a0e-b57a-1aec49282887}", "jid1-TMndP6cdKgxLcQ@jetpack",
"s3google@translator", "{9c63d15c-b4d9-43bd-b223-37f0a1f22e2a}", "translator@zoli.bod", "{8cda9ce6-7893-4f47-ac70-a65215cec288}", "simple-translate@sienori", "@translatenow",
"{a79fafce-8da6-4685-923f-7ba1015b8748})", "{8a802b5a-eeab-11e2-a41d-b0096288709b}", "jid0-fbHwsGfb6kJyq2hj65KnbGte3yT@jetpack", "storetranslate.plugin@gmail.com",
"jid1-r2tWDbSkq8AZK1@jetpack", "{b384b75c-c978-4c4d-b3cf-62a82d8f8f12}", "jid1-f7dnBeTj8ElpWQ@jetpack", "{dac8a935-4775-4918-9205-5c0600087dc4}", "gtranslation2@slam.com",
"{e20e0de5-1667-4df4-bd69-705720e37391}", "{09e26ae9-e9c1-477c-80a6-99934212f2fe}", "mgxtranslator@magemagix.com", "gtranslatewins@mozilla.org"],
open_urls: ["translate.google.com"],
sumo_path: "extensionrecommendations"
};
const YOUTUBE_ENHANCE_PARAMS = {
existing_addons: ["enhancerforyoutube@maximerf.addons.mozilla.org", "{dc8f61ab-5e98-4027-98ef-bb2ff6060d71}", "{7b1bf0b6-a1b9-42b0-b75d-252036438bdc}", "jid0-UVAeBCfd34Kk5usS8A1CBiobvM8@jetpack",
"iridium@particlecore.github.io", "jid1-ss6kLNCbNz6u0g@jetpack", "{1cf918d2-f4ea-4b4f-b34e-455283fef19f}"],
open_urls: ["www.youtube.com"],
sumo_path: "extensionrecommendations"
};
const WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS = {
existing_addons: ["@wikipediacontextmenusearch", "{ebf47fc8-01d8-4dba-aa04-2118402f4b20}", "{5737a280-b359-4e26-95b0-adec5915a854}", "olivier.debroqueville@gmail.com", "{3923146e-98cb-472b-9c13-f6849d34d6b8}"],
open_urls: ["www.wikipedia.org"],
sumo_path: "extensionrecommendations"
};
const REDDIT_ENHANCEMENT_PARAMS = {
existing_addons: ["jid1-xUfzOsOFlzSOXg@jetpack"],
open_urls: ["www.reddit.com"],
sumo_path: "extensionrecommendations"
};

const CFR_MESSAGES = [
{
Expand All @@ -27,7 +52,7 @@ const CFR_MESSAGES = [
},
addon: {
title: "Amazon Assistant",
icon: "",
icon: "resource://activity-stream/data/content/assets/cfr_amazon_assistant.png",
author: "Amazon",
amo_url: "https://addons.mozilla.org/en-US/firefox/addon/amazon-browser-bar/"
},
Expand Down Expand Up @@ -64,7 +89,7 @@ const CFR_MESSAGES = [
},
addon: {
title: "Facebook Container",
icon: "",
icon: "resource://activity-stream/data/content/assets/cfr_fb_container.png",
author: "Mozilla",
amo_url: "https://addons.mozilla.org/en-US/firefox/addon/facebook-container/"
},
Expand All @@ -88,6 +113,154 @@ const CFR_MESSAGES = [
(${JSON.stringify(FACEBOOK_CONTAINER_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
(${JSON.stringify(FACEBOOK_CONTAINER_PARAMS.open_urls)} intersect topFrecentSites|mapToProperty('host'))|length > 0`,
trigger: {id: "openURL", params: FACEBOOK_CONTAINER_PARAMS.open_urls}
},
{
id: "GOOGLE_TRANSLATE_1",
template: "cfr_doorhanger",
content: {
notification_text: "Recommendation",
heading_text: "Recommended Extension",
info_icon: {
label: "why_seeing_this",
sumo_path: GOOGLE_TRANSLATE_PARAMS.sumo_path
},
addon: {
title: "To Google Translate",
icon: "resource://activity-stream/data/content/assets/cfr_google_translate.png",
author: "Juan Escobar",
amo_url: "https://addons.mozilla.org/en-US/firefox/addon/to-google-translate/"
},
text: "Instantly translate any webpage text. Simply highlight the text, right-click to open the context menu, and choose a text or aural translation.",
buttons: {
primary: {
label: "Add to Firefox",
action: {
type: "INSTALL_ADDON_FROM_URL",
data: {url: `${BASE_ADDONS_DOWNLOAD_URL}/1008798/al_traductor_de_google-3.3-an+fx.xpi`}
}
},
secondary: {
label: "No Thanks",
action: {type: "CANCEL"}
}
}
},
frequency: {lifetime: 1},
targeting: `
(${JSON.stringify(GOOGLE_TRANSLATE_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
(${JSON.stringify(GOOGLE_TRANSLATE_PARAMS.open_urls)} intersect topFrecentSites|mapToProperty('host'))|length > 0`,
trigger: {id: "openURL", params: GOOGLE_TRANSLATE_PARAMS.open_urls}
},
{
id: "YOUTUBE_ENHANCE_1",
template: "cfr_doorhanger",
content: {
notification_text: "Recommendation",
heading_text: "Recommended Extension",
info_icon: {
label: "why_seeing_this",
sumo_path: YOUTUBE_ENHANCE_PARAMS.sumo_path
},
addon: {
title: "Enhancer for YouTube™",
icon: "resource://activity-stream/data/content/assets/cfr_enhancer_youtube.png",
author: "Maxime RF",
amo_url: "https://addons.mozilla.org/en-US/firefox/addon/enhancer-for-youtube/"
},
text: "Take control of your YouTube experience. Automatically block annoying ads, set playback speed and volume, remove annotations, and more.",
buttons: {
primary: {
label: "Add to Firefox",
action: {
type: "INSTALL_ADDON_FROM_URL",
data: {url: `${BASE_ADDONS_DOWNLOAD_URL}/1028400/enhancer_for_youtubetm-2.0.73-an+fx-linux.xpi`}
}
},
secondary: {
label: "No Thanks",
action: {type: "CANCEL"}
}
}
},
frequency: {lifetime: 1},
targeting: `
(${JSON.stringify(YOUTUBE_ENHANCE_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
(${JSON.stringify(YOUTUBE_ENHANCE_PARAMS.open_urls)} intersect topFrecentSites|mapToProperty('host'))|length > 0`,
trigger: {id: "openURL", params: YOUTUBE_ENHANCE_PARAMS.open_urls}
},
{
id: "WIKIPEDIA_CONTEXT_MENU_SEARCH_1",
template: "cfr_doorhanger",
content: {
notification_text: "Recommendation",
heading_text: "Recommended Extension",
info_icon: {
label: "why_seeing_this",
sumo_path: WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.sumo_path
},
addon: {
title: "Wikipedia Context Menu Search",
icon: "resource://activity-stream/data/content/assets/cfr_wiki_search.png",
author: "Nick Diedrich",
amo_url: "https://addons.mozilla.org/en-US/firefox/addon/wikipedia-context-menu-search/"
},
text: "Get to a Wikipedia page fast, from anywhere on the web. Just highlight any webpage text and right-click to open the context menu to start a Wikipedia search.",
buttons: {
primary: {
label: "Add to Firefox",
action: {
type: "INSTALL_ADDON_FROM_URL",
data: {url: `${BASE_ADDONS_DOWNLOAD_URL}/890224/wikipedia_context_menu_search-1.8-an+fx.xpi`}
}
},
secondary: {
label: "No Thanks",
action: {type: "CANCEL"}
}
}
},
frequency: {lifetime: 1},
targeting: `
(${JSON.stringify(WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
(${JSON.stringify(WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.open_urls)} intersect topFrecentSites|mapToProperty('host'))|length > 0`,
trigger: {id: "openURL", params: WIKIPEDIA_CONTEXT_MENU_SEARCH_PARAMS.open_urls}
},
{
id: "REDDIT_ENHANCEMENT_1",
template: "cfr_doorhanger",
content: {
notification_text: "Recommendation",
heading_text: "Recommended Extension",
info_icon: {
label: "why_seeing_this",
sumo_path: REDDIT_ENHANCEMENT_PARAMS.sumo_path
},
addon: {
title: "Reddit Enhancement Suite",
icon: "resource://activity-stream/data/content/assets/cfr_reddit_enhancement.png",
author: "honestbleeps",
amo_url: "https://addons.mozilla.org/en-US/firefox/addon/reddit-enhancement-suite/"
},
text: "New features include Inline Image Viewer, Never Ending Reddit (never click 'next page' again), Keyboard Navigation, Account Switcher, and User Tagger.",
buttons: {
primary: {
label: "Add to Firefox",
action: {
type: "INSTALL_ADDON_FROM_URL",
data: {url: `${BASE_ADDONS_DOWNLOAD_URL}/991623/reddit_enhancement_suite-5.12.5-an+fx.xpi`}
}
},
secondary: {
label: "No Thanks",
action: {type: "CANCEL"}
}
}
},
frequency: {lifetime: 1},
targeting: `
(${JSON.stringify(REDDIT_ENHANCEMENT_PARAMS.existing_addons)} intersect addonsInfo.addons|keys)|length == 0 &&
(${JSON.stringify(REDDIT_ENHANCEMENT_PARAMS.open_urls)} intersect topFrecentSites|mapToProperty('host'))|length > 0`,
trigger: {id: "openURL", params: REDDIT_ENHANCEMENT_PARAMS.open_urls}
}
];

Expand Down

0 comments on commit 969a2be

Please sign in to comment.