Skip to content

Instantly share code, notes, and snippets.

View dholbert's full-sized avatar

Daniel Holbert dholbert

View GitHub Profile
@dholbert
dholbert / just-print-what-I-see-on-screen.md
Last active March 21, 2024 16:28
Just print what I see on screen

When looking at bug reports in Firefox’s printing code, I occasionally see users requesting that we add a checkbox to our print dialog to “just print out the website exactly as I see it laid out on the screen”.

It turns out there are quite a few pitfalls buried in this proposed feature. Not-addressing those pitfalls would make the feature into a bit of a footgun; and it turns out that addressing the pitfalls would largely end up making the feature do what browsers already do for print layout.

Let’s explore this. Pretend you’re a browser developer who’s been tasked to implement this feature: a checkbox labeled “Print the website exactly as it looks in my browser” in the print dialog.

INITIAL VERSION: You add code to take a screenshot of the browser’s viewport (the viewport’s entire scrollable height), and then you draw that directly onto one or more printed pages, pixel-for-pixel.

It’s great! Users are intrigued by this checkbox and start using it, but pre

@dholbert
dholbert / grunt-serve-output.txt
Created March 4, 2016 06:00
output when trying to run grunt serve for angular1-slack project
$ /home/dholbert/programs/npm/lib/node_modules/grunt-cli/bin/grunt serve --force
Running "serve" task
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
@dholbert
dholbert / grunt-output.txt
Created March 4, 2016 05:58
output when trying to run grunt for angular1-slack project
$ /home/dholbert/programs/npm/lib/node_modules/grunt-cli/bin/grunt --force
Running "newer:jshint" (newer) task
Running "newer:jshint:all" (newer) task
No newer files to process.
Running "newer:jshint:test" (newer) task
No newer files to process.
Running "newer:jscs" (newer) task
### Keybase proof
I hereby claim:
* I am dholbert on github.
* I am dholbert (https://keybase.io/dholbert) on keybase.
* I have a public key whose fingerprint is 5620 331F A1E0 4359 5A02 0C5D EC57 90F7 D1B3 5332
To claim this, I am signing this object: