Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Issue 60112: Implement chromium.self in content scripts, fix bugs (Closed)

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

Description

Implement chromium.self in content scripts, so that developers don't have to know and copy/paste their extension ID. This required moving the code that defaults the extension ID earlier in the load process. Also fixed some bugs: * fixed a bug that was causing all user scripts to get executed in the same context. * made the greasemonkey api only available in 'standalone' user scripts. * re-added the anonymous function wrapper that is supposed to wrap content scripts. Also added unit tests for the fixed bugs.

Patch Set 1 #

Patch Set 2 : Remove some unneeded changes #

Total comments: 33

Patch Set 3 : Review responses #

Patch Set 4 : Minor cleanup #

Total comments: 2

Patch Set 5 : fixedy fixedy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+444 lines, -132 lines) Patch
M chrome/browser/extensions/extension.h View 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/extensions/extension.cc View 4 chunks +18 lines, -18 lines 0 comments Download
A chrome/browser/extensions/extension_content_script_inject_unittest.cc View 1 chunk +62 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_ui_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_unittest.cc View 1 2 7 chunks +33 lines, -28 lines 0 comments Download
M chrome/browser/extensions/extension_view_unittest.cc View 5 chunks +7 lines, -56 lines 0 comments Download
M chrome/browser/extensions/extensions_service.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extensions_service.cc View 1 2 4 chunks +9 lines, -15 lines 0 comments Download
A chrome/browser/extensions/test_extension_loader.h View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/browser/extensions/test_extension_loader.cc View 1 2 1 chunk +63 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/user_script.h View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/common/extensions/user_script.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/renderer/resources/extension_process_bindings.js View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/renderer/user_script_slave.cc View 3 chunks +28 lines, -7 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject/js_test.js View 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject/manifest.json View 1 chunk +21 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject/script1.css View 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject/script1a.js View 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject/script1b.js View 1 chunk +27 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject/script2.js View 1 chunk +12 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject/script3.js View 3 4 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/content_script_inject_page.html View 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/test/unit/unittests.vcproj View 1 2 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Aaron Boodman
11 years, 8 months ago (2009-04-04 00:58:16 UTC) #1
Erik does not do reviews
http://codereview.chromium.org/60112/diff/1001/1005 File chrome/browser/extensions/extension_unittest.cc (right): http://codereview.chromium.org/60112/diff/1001/1005#newcode41 Line 41: ASSERT_TRUE(extension.InitFromValue(*valid_value, true, &error)); we should add back in ...
11 years, 8 months ago (2009-04-06 17:25:16 UTC) #2
Aaron Boodman
Ready for another look. http://codereview.chromium.org/60112/diff/1001/1005 File chrome/browser/extensions/extension_unittest.cc (right): http://codereview.chromium.org/60112/diff/1001/1005#newcode41 Line 41: ASSERT_TRUE(extension.InitFromValue(*valid_value, true, &error)); On ...
11 years, 8 months ago (2009-04-06 20:51:01 UTC) #3
Erik does not do reviews
11 years, 8 months ago (2009-04-06 21:12:06 UTC) #4
LGTM

http://codereview.chromium.org/60112/diff/3001/4022
File chrome/test/data/extensions/content_script_inject/script3.js (right):

http://codereview.chromium.org/60112/diff/3001/4022#newcode11
Line 11: // This tests that early injection is working properly and that wea re
getting
typo: wea re -> we are

http://codereview.chromium.org/60112/diff/3001/4022#newcode12
Line 12: // run after the documentElement is available, but before anything else
happens.
this doesn't run at the proper time

Powered by Google App Engine
This is Rietveld 408576698