It's something different. It looks like a content script is invoked for
every iframe though all_frames is explicitely set to false. Here is a test
case:
manifest:
{
"name": "All Frames == false bug",
"version": "1",
"description": "Content script is loaded for all frames though
all_frames is explicitely set to false",
"permissions": [
"tabs"
],
"content_scripts": [
{
"matches": ["http://*/*"],
"js": ["content_script.js"],
"all_frames": false,
"run_at": "document_end"
}
]
}
content_script:
console.log("Content script invoked");
-----------------------
To reproduce:
Install the extension and open http://www.buy.com/prod/210668225.html
What I expect to see:
'Content script invoked' only once for the top frame since all_frames is set
to false
What I get:
'Content script invoked' is repeated 10 times in the log (for every iframe).
Do you want me to file a bug report?
Evgeny
On Tue, Dec 8, 2009 at 10:40 PM, Adam Barth <[email protected]> wrote:
> Sounds like you're running into
> <http://code.google.com/p/chromium/issues/detail?id=29644>. I've just
> brought it to the attention of the team.
>
> Adam
>
>
> On Tue, Dec 8, 2009 at 9:07 AM, Evgeny Shadchnev
> <[email protected]> wrote:
> > Hello,
> > I can't figure out why my content script is executed several times on a
> > single page. My manifest looks like this:
> > "content_scripts": [
> > {
> > "matches": ["http://*/*"],
> > "js": ["jquery-1.3.2.js", "content_script.js"],
> > "css": ["ih.css"],
> > "all_frames": false,
> > "run_at": "document_end"
> > }
> >
> > When my content script is executed, it connects to the background page.
> It
> > turns out that the background page receives several requests in a row
> with
> > the same port.tab.url and port.tab.id. Is it a known bug or am I missing
> > something? An example of a page that leads to multiple
> > requests: http://www.amazon.com/gp/product/B001CDNM04
> > Evgeny
> >
> > --
> >
> > 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.