I've tried and failed to write a testcase. Somehow there is a window wrapper to a window which has (still?) docshell but doesn't have contentviewer. Will upload a patch which should fix the issue shown in the stack trace. I haven't figured out what could cause something similar with onstorage.
Bug 1581084 Comment 6 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I've tried and failed to write a testcase. Somehow there is a window wrapper to a window which has (still?) docshell but doesn't have contentviewer. Will upload a patch which should fix the issue shown in the stack trace. I haven't figured out what could cause something similar with onstorage. The patch will take the principal from window object without accessing docshell. And if there is no document to get principal, window will ask its parent (which is effectively what implicit about:blank creation and getting principal does too with iframes). ShouldResistFingerprinting(foo*) methods in general seem to have the problem that they return false if null is passed. That is not something I'm trying to fix here.