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 / 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>
./mach try -b o -p win64,linux64,macosx64 -u none -t all --rebuild-talos 6
do that with and without your commits applied, then plug the revs into this url:
https://treeherder.mozilla.org/perf.html#/compare?originalProject=try&originalRevision=a661bd8f849f75e66ab59832eb01ee5b138f6f60&newProject=try&newRevision=d32c92bd5d0e3a757d3dd00426e48a9e3c70097d&framework=1&showOnlyImportant=1
(original revision = mach try without your patch and new revision = mach try with your patch)
@brendandahl
brendandahl / scratchpad-custom-elements.diff
Last active November 28, 2024 12:50
Scratchpad - Replacing Overlays
index 8b9aff040b6d..ebff698f235d 100644
--- a/devtools/client/scratchpad/scratchpad.xul
+++ b/devtools/client/scratchpad/scratchpad.xul
@@ -15,7 +15,6 @@
<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://devtools/skin/scratchpad.css"?>
-<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<window id="main-window"
This file has been truncated, but you can view the full file.
DEBUG:cargo::update: executing; cmd=cargo-update; args=["/home/bdahl/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo", "update", "-p", "gkrust-shared", "--aggressive"]
TRACE:cargo::util::toml: read_manifest; path=/home/bdahl/projects/gecko/toolkit/library/rust/Cargo.toml; source-id=file:///home/bdahl/projects/gecko/toolkit/library/rust
DEBUG:cargo::core::workspace: find_root - trying /home/bdahl/projects/gecko/toolkit/library/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /home/bdahl/projects/gecko/toolkit/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /home/bdahl/projects/gecko/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /home/bdahl/projects/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /home/bdahl/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /home/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /Cargo.toml
DEBUG:cargo::core::workspace: find_members - only me as a member
@brendandahl
brendandahl / test_element_from_point.html
Created January 17, 2018 00:16
Test element from point
<html>
<head></head>
<body>
<div style="width:400px; heigh: 400px">Hello</div>
<script type="text/javascript">
var el = document.elementFromPoint(10, 10);
dump(">>> element=" + (el ? el.textContent : "null") + "\n");
</script>
</body>
</html>
@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 / snap_screen.js
Last active November 28, 2024 12:50
Snapshot a page in Firefox
// Current window
var el = window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
el.width = window.innerWidth;
el.height = window.innerHeight;
var ctx = el.getContext("2d");
SpecialPowers.wrap(ctx).drawWindow(window, 0, 0, window.innerWidth, window.innerHeight, "rgba(0,0,0,0)",
ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_DRAW_CARET);
dump("\n" + el.toDataURL() + "\n");
// Parent window in e10s mode
@brendandahl
brendandahl / gist:08c5a40ecf357e2f098de30d95fd76b8
Last active November 28, 2024 12:50
Remove non-deterministic output from gekco log
cat headless.txt | sed -E 's/GECKO\([0-9]+\)/GECKO/g' | sed -E 's/0x[a-f0-9]+/0xADRESS/g' | sed -E 's/pid = [0-9]+/pid/g' | sed -E 's/id = \{[0-9a-f\-]+\}/id/g' | sed -E 's/\[[0-9]+\] WARNING:/[] WARNING:/g' | sed -E 's/took [0-9]+ms/took xms/g' | sed -E 's/[0-9]+ INFO/x INFO/g' | sed -E 's/INFO None[0-9]+/INFO Nonex/g' | sed -E 's/[0-9]+:[0-9]+:[0-9]+ INFO /INFO /g' | sed -E 's/\[[0-9]+, Main Thread\]/THREAD_ID Main Thread/g' > headless_filt.txt
LLDB: b js::math_atan2_handle
GDB: break js::math_atan2_handle
@brendandahl
brendandahl / gist:60ce0d769c21321c209548f2ae049b5d
Created July 11, 2017 18:26
rebase mozilla central to inbound
git rebase --onto mozilla/inbound mozilla/central fullscreen-crash