Skip to content

Instantly share code, notes, and snippets.

View brendandahl's full-sized avatar

Brendan Dahl brendandahl

  • Google
  • San Francisco, CA
View GitHub Profile
@brendandahl
brendandahl / xul_overlay_usage.md
Last active February 26, 2024 07:11
XUL Overlay Usage in Firefox

XUL Overlays Usage

There are three ways to use an overlay 1) explicitly, 2) dynamically, and 3) runtime dynamic.

Overlays Used

Explicit

Loaded using <?xul-overlay in xul file.

@brendandahl
brendandahl / rebase.diff
Created October 27, 2023 20:17
emscripten size tests
diff --git a/test/other/metadce/test_metadce_files_wasmfs.size b/test/other/metadce/test_metadce_files_wasmfs.size
index 7e63637a7..e8a794252 100644
--- a/test/other/metadce/test_metadce_files_wasmfs.size
+++ b/test/other/metadce/test_metadce_files_wasmfs.size
@@ -1 +1 @@
-51626
+51634
diff --git a/test/other/metadce/test_metadce_hello_dylink.size b/test/other/metadce/test_metadce_hello_dylink.size
index 5c3d25d34..03aa96dc2 100644
--- a/test/other/metadce/test_metadce_hello_dylink.size
diff --git a/test/other/metadce/test_metadce_cxx_ctors1.jssize b/test/other/metadce/test_metadce_cxx_ctors1.jssize
index d4c636143..c0ec1b6fd 100644
--- a/test/other/metadce/test_metadce_cxx_ctors1.jssize
+++ b/test/other/metadce/test_metadce_cxx_ctors1.jssize
@@ -1 +1 @@
-26008
+26031
diff --git a/test/other/metadce/test_metadce_cxx_ctors2.jssize b/test/other/metadce/test_metadce_cxx_ctors2.jssize
index af118f35f..3a2c12952 100644
--- a/test/other/metadce/test_metadce_cxx_ctors2.jssize

Keybase proof

I hereby claim:

  • I am brendandahl on github.
  • I am bdahlmoz (https://keybase.io/bdahlmoz) on keybase.
  • I have a public key ASAdMWA4LEj8U65mGa6hBg8l3BOY-j6N3a8e_bxgkvsdOAo

To claim this, I am signing this object:

@brendandahl
brendandahl / dom_load_events.js
Created May 23, 2019 20:39
Log the load events of a document.
const domContentLoadedPromise = new Promise(resolve => {
window.addEventListener("DOMContentLoaded", () => {
dump(">>> dialog - DOMContentLoaded event" + window.document.documentURI + "\n");
resolve();
}, { capture: true, once: true });
});
domContentLoadedPromise.then(() => {
dump(">>> dialog - Promise for domContentLoadedPromise resolved\n");
});
let fs = require("fs");
var {
Parser
} = require("saxen");
function structure(filename) {
let contents = fs.readFileSync(filename, "utf8");
let parser = new Parser();
let indent = 0;
let out = "";
@brendandahl
brendandahl / tags.js
Last active May 10, 2019 18:11
XUL element names and HTML element namesa
let xulElements = ["action","arrowscrollbox","assign","bbox","binding","bindings","box","broadcaster","broadcasterset","browser","button","caption","checkbox","colorpicker","column","columns","command","commandset","conditions","content","datepicker","deck","description","dialog","dialogheader","dropmarker","editor","Findbar","grid","grippy","groupbox","hbox","iframe","image","key","keyset","label","listbox","listcell","listcol","listcols","listhead","listheader","listitem","member","menu","menubar","menuitem","menulist","menupopup","menuseparator","notification","notificationbox","observes","page","panel","param","popup","popupset","preference","preferences","prefpane","prefwindow","progressmeter","query","queryset","radio","radiogroup","resizer","richlistbox","richlistitem","row","rows","rule","scale","script","scrollbar","scrollbox","scrollcorner","separator","spacer","spinbuttons","splitter","stack","statusbar","statusbarpanel","stringbundle","stringbundleset","tab","tabbox","tabbrowser","tabpanel","tabpa
@brendandahl
brendandahl / gist:8853d78b159e939e2bbc46b1e9b7ab94
Created April 18, 2019 15:26
Increase number of inodes for MacOS (make git status fast again for mozilla central)
sudo sysctl kern.maxvnodes=$((512*1024))
@brendandahl
brendandahl / chrome_url_to_file_path.js
Created November 8, 2018 22:26
chrome url to file path
function toFile(url) { var chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry); return chromeRegistry.convertChromeURL(Services.io.newURI(url)).QueryInterface(Ci.nsIFileURL).file.path; }
@brendandahl
brendandahl / overlay_notes.md
Last active February 28, 2018 19:29
XUL overlay within an Overlay

Say there are two overlays placesOverlay.xul and macBrowserOverlay.xul and a master document aboutDialog.xul. The relationship is: aboutDialog.xul includes macBrowserOverlay.xul and macBrowserOverlay.xul includes placesOverlay.xul.

Example 1

placesOverlay.xul

<commandset id="zzz">
  <command id="zzzPlacesOverlay"/>
</commandset>