[webkit-dev] safari extension script loading within injected file

Lou Zell lzell11 at gmail.com
Wed Feb 2 22:59:13 PST 2011

On Tue, Feb 1, 2011 at 5:44 PM, Nick Guenther <nick.guenther at dossierview.com
> wrote:

> Cluestick (or n00b question): What's 'document' within the extension scope?

It is not the same as 'document' of the loaded page.  I am no expert with
terminology here, so in case that makes zero sense: If I load up a web page
and use the debugger to print window.document, it is different from the
window.document that I get when I breakpoint on the injected javascript.

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.

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110202/c741ab1f/attachment.html>

More information about the webkit-dev mailing list