I'm on the mac dev channel, I believe (4.0.249.30). However, the
version could have been different when I wrote the original email.

I found a workaround for this problem. Right now my content script
fires for every iframe but in the background page request handler I
compare sender.tab.url with request.location.href (which is set to
document.location.href in the content script) and if they aren't the
same, I assume it was an iframe and dismiss the request.

Evgeny
InvisibleHand

On Sun, Dec 13, 2009 at 10:33 AM, Aaron Boodman <a...@google.com> wrote:
> Are you on the beta channel? The all_frames feature doesn't exist on
> the beta channel.
>
> Sorry about the confusing docs. We need to update them.
>
> - a
>
> On Thu, Dec 10, 2009 at 1:33 AM, Evgeny Shadchnev
> <evgeny.shadch...@gmail.com> wrote:
>> 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 <aba...@chromium.org> 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
>>> <evgeny.shadch...@gmail.com> 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
>>> > 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.
>>> >
>>
>> --
>>
>> 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.
>>
>

--

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