Cannot access window object in option page

My simple variable window.myflag that I use in option page, is reset/undefined and the value I store is only accessible from within the specific function calling it. In my content script, the window object retain its values instead.

I generally send a message from the options page to the background script for global values needed to lay out the page. And send changes back to the background script. Probably not the most efficient method, but…

Since storage is available in the option page, I directly read it there.