You mean, there is a function on the background page called "submitForm"
which sends a message back to the content script (page) and triggers this
function?
If not, you cannot execute functions of content scripts in the context of a
background page, you will have to send a message to the content script that
will trigger the function.

☆PhistucK


On Sun, Nov 29, 2009 at 19:30, Yuval Koren <[email protected]> wrote:

> I have a very simple method in a content script which is supposed to
> press a button:
> function submitForm() {
> var submitButton = document.getElementById('submit_form');
> submitButton.click();
> }
>
> I added a small div to the page, and inside the div I placed a button
> which upon click triggers this method. This approach works fine.
> However, if I set this method as a callback function from a message to
> the background page, or, if I set a time out: setTimeout(submitForm,
> 5000)
> The method is called, but the button isn't clicked (the form doesn't
> get submitted).
>
> Anyone knows what could lead to that?
>
> Thanks,
> Yuval
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<chromium-extensions%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to