[webkit-dev] safari extension script loading within injected file
lzell11 at gmail.com
Wed Feb 2 23:37:07 PST 2011
On Wed, Feb 2, 2011 at 10:59 PM, Lou Zell <lzell11 at gmail.com> wrote:
> 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
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
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev