The ideal way to solve these problems is with [https://developer.mozilla.org/en-US/docs/The_message_manager the message manager]. Any code that touches data in the content process should run in a content script. Content scripts communicate with chrome by message passing. Often, it's fairly easy to partition code into content and chrome portions and use message passing to communicate.
However, there are cases where it is awkward to partition code in this way. In these cases, it may be beneficial to use [https://developer.mozilla.org/en-US/docs/Cross_Process_Object_Wrappers cross-process object wrappers (CPOWs)]. CPOWs make it easy to transparently access content objects from chrome. The main drawback of CPOWs is that they are slow and they cause the chrome process to block, which can lead to jank. However, there are times when it makes sense to use CPOWs. For example, CPOWs are used to generate the menu items for the Firefox content context menu. Creating the content context menu sends a small number of CPOW messages since it doesn't touch the content document very much. And while the main event loop will be blocked while generating the context menu, users are unlikely to notice since they're just waiting for the menu to appear.
==Communication==