Commit 31e7159a authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

Add note to prefer web::WebFrame API over WebState::ExecuteJavaScript.

Bug: 905939
Change-Id: Iae8ed5b83aa8bb384ed2c8e65f345547f188a986
Reviewed-on: https://chromium-review.googlesource.com/c/1357382Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613217}
parent 645bcff8
......@@ -153,6 +153,11 @@ class WebState : public base::SupportsUserData {
// Gets the CRWJSInjectionReceiver associated with this WebState.
virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0;
// DISCOURAGED. Prefer using |WebFrame CallJavaScriptFunction| instead because
// it restricts JavaScript execution to functions within __gCrWeb and can also
// call those functions on any frame in the page. ExecuteJavaScript here can
// execute arbitrary JavaScript code, which is not as safe and is retricted to
// executing only on the main frame.
// Runs JavaScript in the main frame's context. If a callback is provided, it
// will be used to return the result, when the result is available or script
// execution has failed due to an error.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment