Commit Graph

3 Commits

Author SHA1 Message Date
Thomas Buckley-Houston d2aaa33963 Refactored webext background script 2018-01-10 22:54:51 +08:00
Thomas Buckley-Houston be2b961cfe Sample text colour using monochar block font trick
Using JS's `getComputedStyle()` for every character is too CPU
intensive, so instead I'm experimenting with using a custom font
to take the canvas snapshot. The font is made up of only the unicode
block character, which basically fills the entire space given to a
monospace glyph. This also means that we can fairly reliably work out
the visibility (whether it's obscured or hidden with CSS) of text.
2018-01-01 22:10:10 +08:00
Thomas Buckley-Houston d00361f87d First draft of rewrite to Webextension and Rust
This proves that frames can be generated on Firefox using the canvas and
a Tree Walker to examine text nodes. Already with little optimisation
frames don't ever take longer than 200ms to render.

Chrome has a MediaStream of the viewport, hopefully that will prove
performant as well.

This doesn't have functioning text colour detection or text occlusion
support. But early research suggests this will possible by comparing 2
screenshots: one with and the other without rendered text.
2018-01-01 21:50:30 +08:00