I am creating a google chrome extension which, when activated on a tab, loads some custom code and a few new views into the document of that window. I'd like to use requireJS to load these new modules of code called by the extension. However, I worried about a possible conflict or name collision that might occur if the app/website this extension is called on is already running requireJS, and my calling it from scratch either wipes the sites native require.config or otherwise causes some unknown mischief. This would cause the site to break every time my extension is activated on it.
So is there a way to load entirely new and "independent" instances of requireJS and backboneJS onto a site that MAY already have its own instances running? If not, is there a way to reconcile my requirements and configs with those of the target app?
EDIT W/ MORE DETAILS: Ok, so a little more detail on my extension: I am creating an iFrame on the page, which has a completely unique document space. But I still need the iFrame to be aware of certain things going on in the original document (ex: when the user clicks on a certain div in that document, I want this event to be passed to the iFrame). To do this, I pass various objects through the original document's content script, up to the extension, back to the iframe's content script, and then finally (using window.onMessage), on to the iFrame's javascript environment. The process I've developed is roughly similar to the one described here. And yes, it makes my head hurt.
Anyway, the point of all that is that I have a LOT of code going on in the iframe, the extension, and the original source document. So, I'd like to have a require instance in each of these contexts.