Provide an API to allow an embedder to interact with content in a web.Frame using the web-standard postMessage/MessagePort interfaces.
See https://www.w3.org/TR/webmessaging/#message-ports for the HTML5 specification for Web Messaging.
Kevin, I think you're currently working on this?
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b269640d691e81dcf740b1f6c18fb33638229c63 commit b269640d691e81dcf740b1f6c18fb33638229c63 Author: Kevin Marshall <kmarshall@chromium.org> Date: Fri Nov 02 02:53:18 2018 Fuchsia: Add ExecuteJavaScript() to Frame FIDL interface. Enables Frame clients to inject arbitrary JS into browser frames, so that Fuchsia native applications may interact with web content. * Define and implement ScriptInjector Mojo service for RenderFrames. * Rename AllowInjectingJavaScriptForAndroidWebView() to AllowInjectingJavaScript(), to reflect the fact that this feature is no longer exclusive to Android. Bug: 893236 Change-Id: I25b7364db21662af8a763e0788ddb3719d91328a Reviewed-on: https://chromium-review.googlesource.com/c/1295173 Commit-Queue: Kevin Marshall <kmarshall@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Wez <wez@chromium.org> Cr-Commit-Position: refs/heads/master@{#604811} [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/android_webview/browser/aw_browser_main_parts.cc [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/content/browser/frame_host/render_frame_host_impl.cc [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/content/public/browser/render_frame_host.h [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/BUILD.gn [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/DEPS [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/context_impl.cc [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/context_impl.h [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/frame_impl.cc [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/frame_impl.h [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/frame_impl_browsertest.cc [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/run_with_timeout.cc [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/run_with_timeout.h [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/test/data/dynamic_title.html [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/browser/webrunner_browser_main_parts.cc [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/common/OWNERS [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/common/on_load_script_injector.mojom [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/fidl/web/frame.fidl [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/renderer/DEPS [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/renderer/on_load_script_injector.cc [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/renderer/on_load_script_injector.h [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/renderer/webrunner_content_renderer_client.cc [add] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/renderer/webrunner_content_renderer_client.h [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/service/context_provider_impl_unittest.cc [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/service/webrunner_main_delegate.cc [modify] https://crrev.com/b269640d691e81dcf740b1f6c18fb33638229c63/webrunner/service/webrunner_main_delegate.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/45af854adbe2883865cb4df2b976200ab5097970 commit 45af854adbe2883865cb4df2b976200ab5097970 Author: Kevin Marshall <kmarshall@chromium.org> Date: Thu Nov 15 21:26:35 2018 Fuchsia: Add support for Window.postMessage() and MessagePort. Adds a channel for sending messages to web content. Messages can include MessagePorts to allow for bidirectional message exchange between the FIDL client and web content. Promotes Blink CloneableMessage and TransferableMessage struct traits to "public" so that the messages can be serialized and deserialized by code outside Blink. Bug: 893236 Change-Id: If4e23a65e9d35e1ed2ce80de95e9f2212c55aecf Reviewed-on: https://chromium-review.googlesource.com/c/1318839 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Reviewed-by: Marijn Kruisselbrink <mek@chromium.org> Reviewed-by: Wez <wez@chromium.org> Commit-Queue: Kevin Marshall <kmarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#608515} [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/content/browser/message_port_provider.cc [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/content/public/browser/message_port_provider.h [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/common/BUILD.gn [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/common/messaging/cloneable_message.typemap [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/common/messaging/cloneable_message_struct_traits.cc [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/common/messaging/string_message_codec.cc [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/common/messaging/transferable_message.typemap [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/common/messaging/transferable_message_struct_traits.cc [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/public/common/BUILD.gn [rename] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/public/common/messaging/cloneable_message_struct_traits.h [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/public/common/messaging/string_message_codec.h [rename] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/third_party/blink/public/common/messaging/transferable_message_struct_traits.h [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/BUILD.gn [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/DEPS [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/frame_impl.cc [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/frame_impl.h [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/frame_impl_browsertest.cc [add] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/message_port_impl.cc [add] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/message_port_impl.h [add] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/test/data/message_port.html [add] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/test/data/window_post_message.html [add] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/vmo_util.cc [add] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/browser/vmo_util.h [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/fidl/web/frame.fidl [modify] https://crrev.com/45af854adbe2883865cb4df2b976200ab5097970/webrunner/service/context_provider_impl_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ee3f412ff1968f6e3126e9964c03c4ef0433c83d commit ee3f412ff1968f6e3126e9964c03c4ef0433c83d Author: Kevin Marshall <kmarshall@chromium.org> Date: Fri Nov 30 22:09:55 2018 Fuchsia: Fix PostMessage message buffering, add & fix FrameImpl tests. * Fixes issue with an on-receive callback not being unbound, causing the incoming message buffer to be drained immediately. * Add browser tests to verify buffering behavior. * Add browser tests to verify proper origin enforcement for Frame::PostMessage. * Make the AsyncValueReceiver interface a bit nicer to use. * Minor cleanups for other FrameImpl browser tests. Bug: 893236 Change-Id: I521e9316ccf9195133a940be670556a882cb1044 Reviewed-on: https://chromium-review.googlesource.com/c/1351777 Commit-Queue: Kevin Marshall <kmarshall@chromium.org> Reviewed-by: Wez <wez@chromium.org> Cr-Commit-Position: refs/heads/master@{#612812} [modify] https://crrev.com/ee3f412ff1968f6e3126e9964c03c4ef0433c83d/webrunner/browser/frame_impl_browsertest.cc [modify] https://crrev.com/ee3f412ff1968f6e3126e9964c03c4ef0433c83d/webrunner/browser/message_port_impl.cc [modify] https://crrev.com/ee3f412ff1968f6e3126e9964c03c4ef0433c83d/webrunner/browser/test_common.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d2cc2827e3858985640eb100e17e73f9edfc4c61 commit d2cc2827e3858985640eb100e17e73f9edfc4c61 Author: Kevin Marshall <kmarshall@chromium.org> Date: Fri Dec 14 23:12:47 2018 Fuchsia: Add Connector C++ and JS library for injecting channels to JS. The Connector JS library allows callers to create asynchronously-bound ports which can be immediately written to. The Connector will handle the details of connecting the JS and C++ ports together. All details pertaining to the port's connected state are abstracted from the JS side. It will be used as the transport for cast.__platform__ APIs so that they can communicate with other components outside the content boundaries. * Use shared memory for injected scripts so that renderers don't have to store their own copies. * Move some common test code to webrunner/common, including the browser test base class and launcher. Bug: 893236 Change-Id: I6e769ed3422a8acadd696b51021d3877323b416d Reviewed-on: https://chromium-review.googlesource.com/c/1357655 Commit-Queue: Kevin Marshall <kmarshall@chromium.org> Reviewed-by: Wez <wez@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org> Cr-Commit-Position: refs/heads/master@{#616866} [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/BUILD.gn [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/browser/context_impl_browsertest.cc [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/browser/frame_impl.cc [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/browser/frame_impl.h [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/browser/frame_impl_browsertest.cc [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/browser/message_port_impl.cc [delete] https://crrev.com/b1d6fdc08c2c35699450ee464f5e59bfb26c8303/webrunner/browser/vmo_util.cc [delete] https://crrev.com/b1d6fdc08c2c35699450ee464f5e59bfb26c8303/webrunner/browser/vmo_util.h [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/DEPS [add] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/mem_buffer_util.cc [add] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/mem_buffer_util.h [add] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/named_message_port_connector.cc [add] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/named_message_port_connector.h [add] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/named_message_port_connector.js [add] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/named_message_port_connector_browsertest.cc [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/on_load_script_injector.mojom [add] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/data/connector.html [rename] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/run_with_timeout.cc [rename] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/run_with_timeout.h [rename] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/test_common.cc [rename] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/test_common.h [rename] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/webrunner_browser_test.cc [rename] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/webrunner_browser_test.h [rename] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/common/test/webrunner_test_launcher.cc [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/renderer/on_load_script_injector.cc [modify] https://crrev.com/d2cc2827e3858985640eb100e17e73f9edfc4c61/webrunner/renderer/on_load_script_injector.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e4521cda3de864efc621c1bd18f2d4e886cc10bb commit e4521cda3de864efc621c1bd18f2d4e886cc10bb Author: Wez <wez@chromium.org> Date: Thu Jan 10 01:13:41 2019 [Fuchsia] Remove CheckRunWithTimeout() test helper. The ScopedTaskEnvironment now configures a Run() timeout for the test's main thread, removing the need for the custom CheckRunWithTimeout() helper. Bug: 893236 Change-Id: If002158e986ca279860715b78c6b0ee0b52da811 Reviewed-on: https://chromium-review.googlesource.com/c/1401852 Commit-Queue: Wez <wez@chromium.org> Reviewed-by: Kevin Marshall <kmarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#621401} [modify] https://crrev.com/e4521cda3de864efc621c1bd18f2d4e886cc10bb/webrunner/BUILD.gn [modify] https://crrev.com/e4521cda3de864efc621c1bd18f2d4e886cc10bb/webrunner/app/cast/cast_runner_integration_test.cc [modify] https://crrev.com/e4521cda3de864efc621c1bd18f2d4e886cc10bb/webrunner/app/web/webrunner_smoke_test.cc [modify] https://crrev.com/e4521cda3de864efc621c1bd18f2d4e886cc10bb/webrunner/browser/frame_impl_browsertest.cc [modify] https://crrev.com/e4521cda3de864efc621c1bd18f2d4e886cc10bb/webrunner/common/named_message_port_connector_browsertest.cc [delete] https://crrev.com/59bdfdc9aa5cf9148bcd9dcb7cd143111a407443/webrunner/common/test/run_with_timeout.cc [delete] https://crrev.com/59bdfdc9aa5cf9148bcd9dcb7cd143111a407443/webrunner/common/test/run_with_timeout.h
Issue 893230 has been merged into this issue.
Comment 1 by w...@chromium.org
, Oct 8