unrelenting.technology

Ported the Firefox Profiler to FreeBSD in order to investigate why WebRender has some jank when scrolling some walls of text on my 4K/HiDPI setup.

The profiler code initially looked somewhat scary: some Google Breakpad code is used, a custom stack unwinder called LUL is used on Linux (which also partially derived from Breakpad code)…

Initially, I got it working with “pre-symbolication” (an option to build the goblin ELF parser into Firefox for this purpose) only, ifdef’ing any Breakpad code out.

Turns out:

  • the only part of Breakpad used is extracting build IDs from shared objects (and in fact the “base profiler”, a copy (for now) of the Gecko profiler used for profiling during the early startup phase, just copied all the relevant code);
  • devel/breakpad was there in FreeBSD Ports (but expires in like three days!), and its patches showed that it’s really trivial to get all it working.

So I got the main symbolication system working. Which, it turns out, runs WebAssembly-compiled goblin in a web worker! Fun stuff. Requires stripping libxul for now tho.

In the end, the patch turned out to be mostly just ifdef‘s! The only meaningful parts are: thr_self/thr_kill2 instead of gettid/tgkill, supporting the different mcontext structs, and (for the pre-symbolication code path) ignoring symbol names returned by dladdr because they’re hilariously bad.

BTW, earlier in the dev-tools-on-FreeBSD space: heaptrack! I even used it to find a real memory leak in Wayfire.

Screenshot of Shadertoy in Firefox, with procstat showing C flag on firefox processes
Download original

Firefox content process sandboxing with Capsicum: it’s alive! Work in progress, but I have WebGL and audio working :)

Was wondering for a month why Firefox on my laptop would forget my GitHub session (and some other sessions) after restarting. Turns out “Delete cookies and site data when Firefox is closed” got enabled somehow. Facepalm.

I was wondering why I can’t watch Twitch streams in Firefox… turns out they serve a broken player if your User-Agent does not contain Linux/Windows/macOS. Fail.

AMO front page screenshot, "YouTube boosters" featured section

haha wow my SoundFixer addon is on the addons.mozilla.org front page

The best Cloud-to-Butt replacement I’ve seen yet, thanks to this page:

Butthole was released in 2016 for Firefox to make Buttflare captchas less painful

yay, Firefox will use SHM_ANON on FreeBSD now

LOL. MEGA says “use Chrome to download large files because Firefox has a small buffer”. Opened in Chromium… “unzoom or use Firefox because of a zoom rendering bug in Chrome/ium” :D

haha, Phoronix wrote about the stuff I posted on wayland-devel@. So yeah, I’m working on Rust bindings for libweston that would eventually allow me to write the best Wayland compositor ever :)

And fractional HiDPI scaling was pretty easy to add. Wayland apps look awesome. However, X11 apps are blurry now, and bypassing the scaling for Xwayland is not as easy… So I made some changes to my Ports fork to enable Wayland support in more apps. Turns out a lot of complex applications run fine — LibreOffice (!), Inkscape, MyPaint, RawTherapee, Darktable.

The Firefox Wayland support though… is not usable yet :( It looks awesome but EGL isn’t working and, even worse, the screen doesn’t refresh when it needs to — so you’re typing and letters don’t appear until you scroll or some time passes. Hopefully this will be fixed soon.

FirefoxSettings

Buffer more video: media.cache_readhead_limit = lots

Disable backspace-to-go-back to prevent accidental form loss: browser.backspace_action = 0

Warning on Ctrl-Q: browser.tabs.warnOnClose = true browser.showQuitWarning = true and DO NOT SET “Show my windows and tabs from last time”! Also, a WebExtension for this.

Wide gamut color: gfx.color_management.mode = 1

Save session less often: browser.sessionstore.interval = 60000

Kill safe mode prompt: toolkit.startup.max_resumed_crashes = -1

Force compositing acceleration: layers.acceleration.force-enabled = true

Force canvas acceleration: gfx.canvas.azure.accelerated = true (must create)

Smooth libinput touchpad scrolling and touchscreen on X11 (not needed on Wayland): MOZ_USE_XINPUT2=1

Faster mouse scrolling: mousewheel.default.delta_multiplier_y = 150

Arch Wiki Firefox/Tweaks

How to stop Firefox from making automatic connections