Skip to content

Instantly share code, notes, and snippets.

@piatra
piatra / Dockerfile
Created July 17, 2018 15:45
docker recipe for firefox artifact build
FROM ubuntu:16.04
# Basic boostrap
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
git \
python \
build-essential \
wget \
curl \
@piatra
piatra / .gitconfig
Last active May 13, 2019 08:45
DOT files
[cinnabar]
helper = /Users/andreioprea/Work/git-cinnabar/git-cinnabar-helper
[user]
name = Andrei Oprea
email = [email protected]
[alias]
co = checkout
ci = commit
st = status
br = branch
{
"messages": [
{
"id": "1",
"template": "eoy_snippet",
"template_version": "1.0.0",
"campaign": "foobar",
"content": {
"background_color": "yellow",
"test": "bold",
@piatra
piatra / bookmark_endpoint.json
Last active July 26, 2019 13:10
newsletter snippet
{
"messages": [
{
"weight": 100,
"content": {
"cta": {
"string_id": "cfr-doorhanger-bookmark-fxa-link-text"
},
"text": {
{"spocs":{"url":"https:\/\/getpocket.cdn.mozilla.net\/v3\/firefox\/global-recs?version=3&consumer_key=40249-e88c401e1b1f2242d9e441c4&locale_lang=en-US&feed_variant=default_spocs_on"},"layout":[{"width":12,"components":[{"type":"TopSites","header":{"title":"Top Sites"},"properties":{}},{"type":"SectionTitle","header":{"title":"Best of the Web"},"properties":{}},{"type":"HorizontalRule","properties":{}},{"type":"SectionTitle","header":{"title":"Best of the Web","subtitle":"Brought to you by the Pocket Editorial Team"},"properties":{}},{"type":"Navigation","properties":{"alignment":"centered","links":[{"name":"Must Reads","url":"https:\/\/getpocket.com\/explore\/must-reads?src=fx_new_tab"},{"name":"Productivity","url":"https:\/\/getpocket.com\/explore\/productivity?src=fx_new_tab"},{"name":"Health","url":"https:\/\/getpocket.com\/explore\/health?src=fx_new_tab"},{"name":"Finance","url":"https:\/\/getpocket.com\/explore\/finance?src=fx_new_tab"},{"name":"Technology","url":"https:\/\/getpocket.com\/explore\/techno
{
"messages": [
{
"weight": 50,
"id": "1053xx3",
"template": "simple_snippet",
"template_version": "1.0.0",
"content": {
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAEJ5JREFUeAG9W3uMXFUZP+c+ZvY1u9sH2Cotr4AGalAgGCp0d3HboSAL0i4NIsFHAhr4Q4kSH9Fu/0ODxCgqGGIwREK6Bbotj25X6G4fKqEl0YSnWBBEkq7Sx+xr7uv4+507Z3pnd3a7MzvD2ezce88993t/3/nOd8+VokZta+9Wu1f0CtkvQwNyT+ceJ1xiX+AIeaGU8mIh5QolxHlCibNw3RKpMPT9/HgkoimprP9Jqd4XUhzGmDdx/ncl1GvZp7JHDDxcy+HOYbtzuDOUQmLYwptc
@piatra
piatra / steps.js
Last active February 12, 2019 16:31
caching_qa_test_steps
XPCOMUtils.defineLazyGetter(this, "gTextDecoder", () => new TextDecoder());
const filepath = OS.Path.join(OS.Constants.Path.localProfileDir, "activity-stream.discovery_stream.json");
OS.File.read(filepath).then(binaryData => {
const json = gTextDecoder.decode(binaryData);
data = JSON.parse(json);
for (let i in data) {
if (i === "feeds") {
for (j in data[i]) { console.log(i, data[i][j].lastUpdated); }
} else {
@piatra
piatra / response.json
Created February 25, 2019 08:40
snippets payload
This file has been truncated, but you can view the full file.
{"messages": [{"id": "10795", "template": "simple_snippet", "template_version": "1.0.0", "weight": 100, "content": {"icon": "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTc2IDE1NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtOTYgMTczYTg4IDg4IDAgMCAxIC04OC04OHYtNDRhMjIgMjIgMCAwIDEgMjItMjJoMTMyYTIyIDIyIDAgMCAxIDIyIDIydjQ0YTg4IDg4IDAgMCAxIC04OCA4OHptNDMuODMtMTEwLjM1YTEwLjg3IDEwLjg3IDAgMCAwIC04IDMuNTFsLTM2LjEgMzYuMTEtMzUuNDItMzUuNTdhMTAuODIgMTAuODIgMCAwIDAgLTguMzEtNC4wNSAxMSAxMSAwIDAgMCAtNy44NSAxOC43bC0uMTguMTIgMzYuMjIgMzYuMzcgNy44MSA3Ljc3YTExIDExIDAgMCAwIDE1LjU1IDBsNy43OC03Ljc3IDM2LjQtMzYuMzdhMTEgMTEgMCAwIDAgLTcuODctMTguODJ6IiBmaWxsPSIjZWY0MTU2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtOCAtMTkpIi8+PC9zdmc+", "button_label": "Launch in Firefox", "button_url": "https://getpocket.com/firefox_learnmore/?utm_source=desktop-snippet&utm_medium=snippet&utm_campaign=pocket2019&utm_term=10795&utm_content=evergreen\n", "text": "Brain Food delivered fresh! Pocket makes it easy to find and focus on content that fu
@piatra
piatra / customElement.js
Created February 19, 2020 14:34
Use a DOMLocalization instance separate from document.l10n
/* 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/. */
"use strict";
// This is loaded into all XUL windows. Wrap in a block to prevent
// leaking to window scope.
{
const { RemoteL10n } = ChromeUtils.import(
diff --git a/browser/components/newtab/AboutNewTabService.jsm b/browser/components/newtab/AboutNewTabService.jsm
index 69390dfbc8a2..30796b29f398 100644
--- a/browser/components/newtab/AboutNewTabService.jsm
+++ b/browser/components/newtab/AboutNewTabService.jsm
@@ -23,6 +23,13 @@ ChromeUtils.defineModuleGetter(
"AboutNewTab",
"resource:///modules/AboutNewTab.jsm"
);
+const PREF_SEPARATE_ABOUT_WELCOME = "browser.aboutwelcome.enabled";
+XPCOMUtils.defineLazyPreferenceGetter(