Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(44)

Issue 412008: Introduce a new 'all_frames' property to content scripts and (Closed)

Created:
8 years, 9 months ago by Aaron Boodman
Modified:
7 years, 1 month ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Introduce a new 'all_frames' property to content scripts and default it to false. This should improve performance in sites that use frames and elimiate confusion, since in most cases developers *don't* expect content scripts to match frames. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=33035

Patch Set 1 #

Patch Set 2 : update samples #

Patch Set 3 : cleanup #

Total comments: 6

Patch Set 4 : responses to comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -16 lines) Patch
M chrome/chrome.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/docs/content_scripts.html View 3 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/examples/api/messaging/timer/page.js View 1 chunk +8 lines, -10 lines 0 comments Download
M chrome/common/extensions/docs/static/content_scripts.html View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 2 chunks +14 lines, -1 line 0 comments Download
M chrome/common/extensions/extension_constants.h View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_constants.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/user_script.h View 3 chunks +10 lines, -1 line 0 comments Download
M chrome/common/extensions/user_script.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/renderer/user_script_slave.cc View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/content_script_all_frames/all_frames.js View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/content_script_all_frames/manifest.json View 1 chunk +18 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/content_script_all_frames/test.html View 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/content_script_all_frames/top_frame_only.js View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/data/extensions/subscribe_page_action/feed_finder.js View 1 chunk +2 lines, -4 lines 0 comments Download
A chrome/test/data/extensions/test_file_with_iframe.html View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Aaron Boodman
8 years, 9 months ago (2009-11-20 03:43:25 UTC) #1
Aaron Boodman
8 years, 9 months ago (2009-11-20 22:39:45 UTC) #2
Erik does not do reviews
http://codereview.chromium.org/412008/diff/2004/3019 File chrome/common/extensions/docs/static/content_scripts.html (right): http://codereview.chromium.org/412008/diff/2004/3019#newcode133 Line 133: <td><em>Optional.</em></td> move the </td> to the end, it ...
8 years, 9 months ago (2009-11-20 23:14:45 UTC) #3
Aaron Boodman
http://codereview.chromium.org/412008/diff/2004/3028 File chrome/test/data/extensions/api_test/content_script_all_frames/test.html (right): http://codereview.chromium.org/412008/diff/2004/3028#newcode22 Line 22: if (num_all_frames_messages == 2 && num_top_frame_only_messages == 1) ...
8 years, 9 months ago (2009-11-21 07:49:59 UTC) #4
Erik does not do reviews
8 years, 8 months ago (2009-11-23 15:47:12 UTC) #5
http://codereview.chromium.org/412008/diff/2004/3028
File chrome/test/data/extensions/api_test/content_script_all_frames/test.html
(right):

http://codereview.chromium.org/412008/diff/2004/3028#newcode22
chrome/test/data/extensions/api_test/content_script_all_frames/test.html:22: if
(num_all_frames_messages == 2 && num_top_frame_only_messages == 1) {
On 2009/11/21 07:49:59, Aaron Boodman wrote:
> On 2009/11/20 23:14:45, Erik Kay wrote:
> > This test doesn't feel that reliable to me.  If more messages are still
coming
> > at this point, you wouldn't know it because you exit immediately.  Maybe you
> > need to have a second message in order to guarantee that the first message
was
> > completely processed?
> 
> I understand what you mean, but I don't see a general way to solve this
problem.
> 
> We expect three messages and wait for three. Even if we had a fourth "i'm all
> done now" message, we could never know that something wouldn't have gone
haywire
> after that causing more messages to be sent.
> 
> I think those are bugs that we will have to discover and write specific tests
> for.
What I meant was that if you sent a second separate message from the background
page, it would always be delivered after the first message, right?  My hope was
that should mean that the reply would get delivered after all of the other
replies as well.

I'm fine with punting on this for now, just add a comment warning about the
issue.

Powered by Google App Engine
This is Rietveld 408576698