Skip to content

Instantly share code, notes, and snippets.

@rhelmer
rhelmer / about:pioneer injection API
Created September 2, 2020 16:10
pioneer_injection.diff
diff --git a/experiment-apis/pioneer.js b/experiment-apis/pioneer.js
new file mode 100644
index 0000000..fe7cb0e
--- /dev/null
+++ b/experiment-apis/pioneer.js
@@ -0,0 +1,96 @@
+/* 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/. */
+
{
"type": "object",
"properties": {
"addon_id": {
"type": "string"
},
"icons": {
"type": "object",
"properties": {
"32": {
[
{
addon_id: "pioneer-v2-example@mozilla.org",
icons: {
"32":
"https://localhost/user-media/addon_icons/2644/2644632-32.png?modified=4a64e2bc",
"64":
"https://localhost/user-media/addon_icons/2644/2644632-64.png?modified=4a64e2bc",
"128":
"https://localhost/user-media/addon_icons/2644/2644632-128.png?modified=4a64e2bc",
{
"messages": [
{
"content": {
"text": "Donate your data to science with <link0>Firefox Pioneer</link0>",
"icon": "https://snippets.cdn.mozilla.net/media/icons/1a8bb10e-8166-4e14-9e41-c1f85a41bcd2.png",
"button_label": "Button Label",
"section_title_icon": "https://snippets.cdn.mozilla.net/media/icons/5878847e-a1fb-4204-aad9-09f6cf7f99ee.png",
"section_title_text": "Messages from Firefox",
"section_title_url": "https://support.mozilla.org/kb/snippets-firefox-faq?utm_source=desktop-snippet&utm_medium=snippet&utm_campaign=&utm_term=&utm_content=",
{
"messages": [
{
"content": {
"scene1_button_label": "Se connecter à Sync",
"scene1_button_color": "#f05",
"scene2_dismiss_button_text": "Supprimer",
"scene2_button_label": "Continuer",
"scene2_email_placeholder_text": "Votre adresse électronique",
"form_action": "https://basket.mozilla.org/subscribe.json",
const privateKey = {
crv: "P-256",
d: "rcs093UlGDG6piwHenmSDoAxbzMIXT43JkQbkt3xEmI",
ext: true,
key_ops: ["deriveKey"],
kty: "EC",
x: "h12feyTYBZ__wO_AnM1a5-KTDlko3-YyQ_en19jyrs0",
y: "6GSfzo14ehDyH5E-xCOedJDAYlN0AGPMCtIgFbheLko",
};
@rhelmer
rhelmer / devbrowser.diff
Last active November 21, 2019 16:51
devbrowser
diff --git a/browser/moz.build b/browser/moz.build
index 76c61a7ef443..8c903a811bb1 100644
--- a/browser/moz.build
+++ b/browser/moz.build
@@ -36,6 +36,7 @@ if CONFIG['MAKENSISU']:
TEST_DIRS += [
'tools/mozscreenshots',
+ 'tools/devbrowser',
]
diff --git a/browser/components/BrowserContentHandler.jsm b/browser/components/BrowserContentHandler.jsm
--- a/browser/components/BrowserContentHandler.jsm
+++ b/browser/components/BrowserContentHandler.jsm
@@ -19,6 +19,7 @@ XPCOMUtils.defineLazyModuleGetters(this,
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
HeadlessShell: "resource:///modules/HeadlessShell.jsm",
HomePage: "resource:///modules/HomePage.jsm",
+ FirstStartup: "resource://gre/modules/FirstStartup.jsm",
LaterRun: "resource:///modules/LaterRun.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
# HG changeset patch
# User Robert Helmer <rhelmer@mozilla.com>
# Date 1566713264 25200
# Sat Aug 24 23:07:44 2019 -0700
# Node ID fff97a76d75a6d0cd71e6c3dc30fe9d02bf0010c
# Parent 5c329d928cb98e1d7e5973490a2e1592500f0ce5
Bug WIP - add new FirstStartup service and --first-startup post-install flag.
FirstStartup provides an optional mechanism to run synchronous services
before the UI appears. This is intended to be called as a post-install
import requests
import click
import os
import hashlib
@click.command()
@click.argument("url")
def main(url=None):
data = requests.get(url).json()