On Wed, Feb 2, 2011 at 10:59 PM, Lou Zell <[email protected]> wrote: > I made a simple test where I load a single javascript file from within the > injected js. This single file creates a variable, window.MyGlobal. What is > very interesting to me is that this object is accessible from the loaded > page! Meaning if I create an html file that tries to access > window.MyGlobal, it can. I don't think web page authors are supposed to be > able to access variables created by extensions. > > After giving this more thought. This behavior does seem perfectly reasonable. The javascript I'm using (in the first email) loads the second script by appending a <script> tag to <head>. So obviously whatever is in that script is going to be accessible by the page's author.
> I'm going to pose the question in the Apple list Adam suggested. I'll post > the solution here for completeness when I get one. > So, it appears the answer to my question is: you're doing it wrong! Any javascript that my extension needs must be injected in. I can specify multiple files to inject, but I was trying to only load files as I needed them--instead of injecting them all on each page load. In the future I can imagine Apple adding some form of conditional injection to extensions. Best, Lou
_______________________________________________ webkit-dev mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

