Thanks for the suggestion. I was transferring the OffscreenCanvas through postMessage the way you mentioned.
I've also tried your recommendation of creating an iframe in the page that loads a web_accessible_resource instead of using an offscreen document.
So the transfer of the offscreen canvas goes like this: content script --> iframe with extension's bundled page --> Worker spawned from iframe.
When I tried to call a drawing function in the worker, the iframe unloaded itself (presumably crashes) without any error messages (inspecting the iframe shows).
Chrome's console did log this:
[16548:21132:0602/221839.401:ERROR:content\browser\renderer_host\render_process_host_impl.cc:5707] Terminating render process for bad Mojo message: Received bad user message: Invalid client ID
[16548:21132:0602/221839.401:ERROR:content\browser\bad_message.cc:29] Terminating renderer for bad IPC message, reason 123
Could this be because drawing on OffscreenCanvases across origins is not allowed? (I'm not sure if that's an actual restriction, pretty new to offscreen canvases)