Note that while you cannot directly access the javascript environment of the
injected page from your script, using the DOM api you can inject a script
tag with code that does this.

For instance, in your content script:

var script = document.createElement("script");
script.innerText = "alert('hello world');";
document.body.appendChild(script);



On Sun, Jan 3, 2010 at 11:50 AM, PhistucK <phist...@gmail.com> wrote:

> No need, you cannot use it anyway.
> You cannot access any global variable from the window, there is no
> "unsafeWindow" or something similar, the user script\content script live in
> a different world than the world of the window.
>
> ☆PhistucK
>
>
> On Sun, Jan 3, 2010 at 20:49, Ian Davis <ihda...@gmail.com> wrote:
>
>> Ok I see.  The entire jQuery library.  Cool.
>>
>> I might research to see if there's a way to tell if the page already has
>> jQuery, and if it doesn't, then define it in the user.js file.
>>
>> THanks again!
>>
>>
>> On Sun, Jan 3, 2010 at 1:46 PM, PhistucK <phist...@gmail.com> wrote:
>>
>>> No, it is not built it, you should paste it into your script.
>>>
>>> ☆PhistucK
>>>
>>>
>>>
>>> On Sun, Jan 3, 2010 at 19:54, Ian Davis <ihda...@gmail.com> wrote:
>>>
>>>> So jQuery is built in? So cool. Ok I'll try and do some $('id').hide()
>>>> to see if that works.
>>>>
>>>>
>>>> On Sun, Jan 3, 2010 at 11:05 AM, PhistucK <phist...@gmail.com> wrote:
>>>>
>>>>> Sure, just include the jQuery code in your script (copy, paste) and use
>>>>> it as you wish.
>>>>>
>>>>>  Could not find any tutorials? Try the Getting 
>>>>> Started<http://code.google.com/chrome/extensions/getstarted.html>page of 
>>>>> the Extension documentation, it is really easy.
>>>>>
>>>>> ☆PhistucK
>>>>>
>>>>>
>>>>>
>>>>> On Sun, Jan 3, 2010 at 16:33, Ian Davis <ihda...@gmail.com> wrote:
>>>>>
>>>>>> That's it! Ha. I'm not sure why Chrome's dev site doesn't have a
>>>>>> template with actual js code in it.
>>>>>>
>>>>>> *Another Question! *(just let me know if I'm buggin' ya, but I feel
>>>>>> like I'm so close!)
>>>>>>
>>>>>> Is there a way to use jQuery in the js code ?  That would be sooooo
>>>>>> nice!  jQuery is the bomb.
>>>>>>
>>>>>> Sometime later I'll figure out how to make an official plugin w/ an
>>>>>> icon that can manipulate the dom.  Don't know how you can do that yet, 
>>>>>> and I
>>>>>> can't find any tutorials on it.  *The AdThwart plugin seems to do it
>>>>>> just fine.*
>>>>>>
>>>>>>
>>>>>> On Sun, Jan 3, 2010 at 12:40 AM, PhistucK <phist...@gmail.com> wrote:
>>>>>>
>>>>>>> You have to append an additional slash to "http://*";.
>>>>>>>
>>>>>>> ☆PhistucK
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Jan 2, 2010 at 23:38, Ian Davis <ihda...@gmail.com> wrote:
>>>>>>>
>>>>>>>> I dragged test.user.js (contents below) into Chrome, and I got the
>>>>>>>> following popup error: "invalid script header"  What am I doing wrong?
>>>>>>>>  Thanks!
>>>>>>>>
>>>>>>>> // ==UserScript==
>>>>>>>> // @match http://*
>>>>>>>> // @match http://*.google.com/*
>>>>>>>> // @match http://www.google.com/*
>>>>>>>> // ==/UserScript==
>>>>>>>> alert('hi');
>>>>>>>>
>>>>>>>> On Tue, Dec 22, 2009 at 1:44 AM, PhistucK <phist...@gmail.com>wrote:
>>>>>>>>
>>>>>>>>> You can do that easily, in the regular way.
>>>>>>>>> Create a "XXX.user.js" file and drag it into Chrome (Beta (not on
>>>>>>>>> Macintosh) or Dev (any platform)!!!).
>>>>>>>>>
>>>>>>>>> ☆PhistucK
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Dec 21, 2009 at 06:21, Ian Davis <ihda...@gmail.com>wrote:
>>>>>>>>>
>>>>>>>>>> I'd love to help but I'm not sure! I'm trying to figure out how to
>>>>>>>>>> manipulate the DOM on whatever page I'm on. It's so easy to do in
>>>>>>>>>> Greasemonkey in Firefox!
>>>>>>>>>>
>>>>>>>>>> On Dec 20, 8:32 pm, FractalBob <ruom...@gmail.com> wrote:
>>>>>>>>>> > Hi,
>>>>>>>>>> >
>>>>>>>>>> > I want to extend Gmail and that includes creating a button in a
>>>>>>>>>> > specific position on the page. I know, visually, where I want it
>>>>>>>>>> to
>>>>>>>>>> > go, but I'm having trouble translating the UI element to the
>>>>>>>>>> stuff the
>>>>>>>>>> > DOM inspector/Developer tool displays. Any guidance would be
>>>>>>>>>> very much
>>>>>>>>>> > appreciated.
>>>>>>>>>> >
>>>>>>>>>> > Bob
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>>> Groups "Chromium-extensions" group.
>>>>>>>>>> To post to this group, send email to
>>>>>>>>>> chromium-extensi...@googlegroups.com.
>>>>>>>>>> To unsubscribe from this group, send email to
>>>>>>>>>> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
>>>>>>>>>> .
>>>>>>>>>> For more options, visit this group at
>>>>>>>>>> http://groups.google.com/group/chromium-extensions?hl=en.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Ian Davis, 540-818-3073
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Ian Davis, 540-818-3073
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Ian Davis, 540-818-3073
>>>>
>>>
>>>
>>
>>
>> --
>> Ian Davis, 540-818-3073
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to chromium-extensi...@googlegroups.com.
> To unsubscribe from this group, send email to
> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/chromium-extensions?hl=en.
>
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.

Reply via email to