| Index: extensions/browser/api/execute_code_function.cc
|
| diff --git a/extensions/browser/api/execute_code_function.cc b/extensions/browser/api/execute_code_function.cc
|
| index 21845aa47ec48b07e549e7b449c10d0641799358..e468f40b28f953d15f86141632c184481a7d44f9 100644
|
| --- a/extensions/browser/api/execute_code_function.cc
|
| +++ b/extensions/browser/api/execute_code_function.cc
|
| @@ -139,7 +139,10 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) {
|
| ScriptExecutor::FrameScope frame_scope =
|
| details_->all_frames.get() && *details_->all_frames
|
| ? ScriptExecutor::ALL_FRAMES
|
| - : ScriptExecutor::TOP_FRAME;
|
| + : ScriptExecutor::SINGLE_FRAME;
|
| +
|
| + // If a frame_id is given, use it. Otherwise, use the top-level frame (0).
|
| + int frame_id = details_->frame_id.get() ? *details_->frame_id : 0;
|
|
|
| ScriptExecutor::MatchAboutBlank match_about_blank =
|
| details_->match_about_blank.get() && *details_->match_about_blank
|
| @@ -166,6 +169,7 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) {
|
| script_type,
|
| code_string,
|
| frame_scope,
|
| + frame_id,
|
| match_about_blank,
|
| run_at,
|
| ScriptExecutor::ISOLATED_WORLD,
|
|
|