Rather than repeatedly initializing a `canvasFactory`-instance for every page, move it to the document-level instead. *Please note:* This patch is written using the GitHub UI, since I'm currently without a dev machine, so hopefully it works correctly.