(apologies for resend)

Your call to executeScript should use tab.id (an integer), not tab (an
object).

Erik


On Tue, Nov 24, 2009 at 12:03 PM, Keithamus <keitha...@gmail.com> wrote:

> As the title suggests, I am trying to find a way to fill all of the
> password boxes on a page, while in a browser action. From what I can
> see the best way to do this is using chrome.tabs.executeScript();
>
> I'll show you my code so far:
>
> var script =
>                                        var script = function() {
>                                                var forms,i,form,n;
>                                                f = document.forms;
>                                                for(n=0; n<forms.length;
> ++n) {
>                                                        form = forms[n];
>                                                        for (i=0;
> i<form.length; ++i) {
>                                                                if
> (form[i].type.toLowerCase() == 'password') {
>
>  form[i].value=Passwd;
>                                                                }
>                                                        }
>                                                }
>                                        }
>
>
>  chrome.tabs.getSelected(null,function(tab) {
>
>  chrome.tabs.executeScript(tab,{code:script,allFrames:true})
>                                        });
>
> When I run this I get the following:
>
> Uncaught Error: Invalid value for argument 0. Expected 'integer' but
> got 'object'    chrome/ExtensionProcessBindings:54
>
> Which is infuriating as it tells me nothing.
>
> Am I just noobing this, or am I on the right path? If people could
> point me in the right direction that'd be great. Cheers
>
> --
>
> 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