Skip to content

Instantly share code, notes, and snippets.

diff --git a/config/external/moz.build b/config/external/moz.build
--- a/config/external/moz.build
+++ b/config/external/moz.build
@@ -8,12 +8,16 @@ external_dirs = []
DIRS += [
'lgpllibs',
- 'prio',
'sqlite',
]

feature flag notes

  • UI

    • about:flags (or maybe about:features?)
    • similar to chrome://flags in Chromium
    • allow enabling/disabling/changing settings
      • also specifies if Mozilla has remotely changed flag and allows opting out
  • Library / SDK

#!/usr/bin/env python
#
# Simple script to generate a CURVE25519 keypair.
# brew install libsodium && pip install pysodium
import pysodium
keypair = pysodium.crypto_box_keypair()
toHex = lambda x: "".join("{:02X}".format(ord(c)) for c in x)

Hey,

For anyone who missed it, we had a meeting in Austin about how to move away from old-style bootstrapped add-ons. Specifically we're talking about things like bootstrap.js (which loads chrome-privileged JS code into the main process) and install.rdf (this is one of the things keeping us from dropping RDF support).

Keeping this support alive is also a burden in terms of code complexity and tests, mostly in the add-ons manager code.

We've successfully made this transition for third-party add-ons (AMO and Firefox both require WebExtensions), but we still have some Mozilla-published add-ons:

  • Test Pilot
  • System Add-ons[1]
diff --git a/browser/extensions/moz.build b/browser/extensions/moz.build
--- a/browser/extensions/moz.build
+++ b/browser/extensions/moz.build
@@ -15,6 +15,7 @@ DIRS += [
'pocket',
'screenshots',
'shield-recipe-client',
+ 'tracking-protection-study',
'webcompat',
]
@rhelmer
rhelmer / study.js
Last active September 26, 2017 20:50
study.js
this.Study = {
onPageLoad: evt => {
console.log("caught pageload event", evt);
console.log("stuff is:", stuff);
},
init() {
this.stuff = "things";
this.win = Services.wm.getMostRecentWindow("navigator:browser");
this.win.gBrowser.addEventListener("DOMContentLoaded", this.onPageLoad);
@rhelmer
rhelmer / 1.diff
Last active September 20, 2017 21:46
diff --git a/toolkit/mozapps/extensions/AddonManagerStartup.cpp b/toolkit/mozapps/extensions/AddonManagerStartup.cpp
--- a/toolkit/mozapps/extensions/AddonManagerStartup.cpp
+++ b/toolkit/mozapps/extensions/AddonManagerStartup.cpp
@@ -745,6 +745,16 @@ AddonManagerStartup::Reset()
return NS_OK;
}
+nsresult
+AddonManagerStartup::InitializeURLPreloader()
+{
Content Security Policy: Directive ‘frame-src’ has been deprecated. Please use directive ‘child-src’ instead. (unknown)
1501559686810 extensions.shield-recipe-client.preference-experiments DEBUG PreferenceExperiments.getAllActive()
While creating services from category 'profile-after-change', service for entry 'Notification Telemetry Service', contract ID '@mozilla.org/notificationTelemetryService;1' does not implement nsIObserver.
OpenGL compositor Initialized Succesfully.
Version: 2.1 ATI-1.51.8
Vendor: ATI Technologies Inc.
Renderer: AMD Radeon R9 M370X OpenGL Engine
FBO Texture Target: TEXTURE_2D
Unix error 2 during operation open on file /Users/rhelmer/Library/Caches/Firefox/Profiles/j7efm381.tmp/directoryLinks.json (No such file or directory) DirectoryLinksProvider.jsm:254
OpenGL compositor Initialized Succesfully.
@rhelmer
rhelmer / instructions.md
Last active November 6, 2017 19:14
testing a signed system add-on update
  1. Download and install the targeted version of Firefox
  2. Create a .xpi file for your add-on (this is just a zip file with install.rdf and bootstrap.js at the root) The filename must start with your add-on ID, for instance my-fix@mozilla.org-v1.xpi
  3. Create an XML file as described in http://firefox-source-docs.mozilla.org/toolkit/mozapps/extensions/addon-manager/SystemAddons.html#update-request
  4. Open about:config and modify the extensions.systemAddon.update.url pref to point to the above XML file
  5. Also in about:config, flip the extensions.logging.enabled and devtools.chrome.enabled prefs to true
  6. Open the Browser Console (Tools->Web Developer->Browser Console)
  7. At the prompt at the bottom of the Browser Console, force an update check by running Cu.import("resource://gre/modules/AddonManager.jsm"); AddonManagerPrivate.backgroundUpdateCheck()
  8. Open about:support and verify that system add-on appears and information is correct
<?xml version="1.0"?>
<updates>
<addons>
<addon id="fox-candy@rhelmer.org"
URL="http://localhost:8080/src/fox-candy@rhelmer.org-v1.xpi"
hashFunction="sha512"
hashValue="63aa2ce3c0632b5b5ad8d878ee7a52029078dbcddbd3d40b32df633079485f0e0b26e746fd5020447d1379d0e882a73a218d154558178d468c95983146e3f287"
size="6129"
version="1.0"/>
</addons>