Chromium Code Reviews| Index: chrome/renderer/extensions/user_script_slave.cc |
| diff --git a/chrome/renderer/extensions/user_script_slave.cc b/chrome/renderer/extensions/user_script_slave.cc |
| index f9166632d1a2e6dd75584d013f5ae184aa94ab01..1ac0697cfacd1539e66a5e0aee3ad6aed3f23e9d 100644 |
| --- a/chrome/renderer/extensions/user_script_slave.cc |
| +++ b/chrome/renderer/extensions/user_script_slave.cc |
| @@ -271,6 +271,10 @@ void UserScriptSlave::InjectScripts(WebFrame* frame, |
| if (frame->parent() && !script->match_all_frames()) |
| continue; // Only match subframes if the script declared it wanted to. |
| + WebFrame* parent_frame = frame; |
| + while (parent_frame->parent()) |
| + parent_frame = parent_frame->parent(); |
|
abarth-chromium
2012/08/22 00:54:19
Does WebFrame really not have a top() accessor?
zel
2012/08/22 01:39:20
Done.
|
| + |
| const Extension* extension = extensions_->GetByID(script->extension_id()); |
| // Since extension info is sent separately from user script info, they can |
| @@ -281,6 +285,7 @@ void UserScriptSlave::InjectScripts(WebFrame* frame, |
| // Content scripts are not tab-specific. |
| int kNoTabId = -1; |
| if (!extension->CanExecuteScriptOnPage(data_source_url, |
| + parent_frame->document().url(), |
|
abarth-chromium
2012/08/22 00:54:19
parent_frame is really the top_frame or what we ca
zel
2012/08/22 01:39:20
used frame->top() accessor instead. done.
|
| kNoTabId, |
| script, |
| NULL)) { |