dglux5_wiki:dataflow:dataflow_blocks_reference:browser_api:iframe_message

IFrame Message

Block Group: Browser API
Icon:IFrame Message block icon

Sends and receives window messages. It can send a message from a page shown in an IFrame to its parent page, and it can receive messages posted to this page, for example by a page in an IFrame. This block can be used to get information from another domain or another instance of this .dg5 file.

For information on using dataflow blocks, see Dataflow.


These properties can take input and give output.

  • invoke (trigger)
  • enabled (boolean)
  • interval (number)
  • autoRun (boolean)
  • timeout (number)
  • message (string)
  • key (string)
  • match (string)
  • origin (string)
  • matchRegExp (string)

invoke causes the message to be sent to the parent window. Only works if enabled is set to TRUE.

enabled specifies whether message sending is enabled.

  • TRUE: Messages are sent as specified by invoke, autoRun, and interval.
  • FALSE: No messages are sent.

interval specifies how often the message is sent automatically, in seconds. A value of 0 means that it is sent on autoRun or invoke only.

autoRun specifies whether the message is sent automatically whenever message changes.

timeout specifies how long the sending attempt will continue before it is canceled, in seconds.

message holds the message to send to the parent window. It must be a JSON string; it is parsed and sent as an object. If it is not valid JSON, nothing is sent and error returns "invalid Json".

key and match filter the messages that this block receives. A received message is returned in output if:

  • key is *. In this case, every message is accepted. When you add this block from the palette, key and match are both *.
  • The message is an object that contains key, and the value of key equals match. Use a value of * for match to accept any value for the specified key.

origin is used for both sending and receiving. When sending, it is the target origin of the message. When receiving, only messages from this origin are accepted. The default is *, which matches any domain.

matchRegExp specifies a regular expression. A received message that is a plain string is returned in output if it matches this expression. It is hidden on the block by default.


These properties can give output. They cannot take input.

  • loading (boolean)
  • output (string)
  • error (string)

loading returns TRUE if the message is currently being sent, FALSE otherwise. Because messages are sent immediately, this is normally FALSE.

output returns the last received message that matched key/match or matchRegExp. It is cleared when this block sends a message.

error returns the error message, if any.


This is a basic use of the block.

Dataflow Model
IFrame Message dataflow modelA key called "status" is required. Because "status" is one of the keys in the received message, the message is returned in output.

  • dglux5_wiki/dataflow/dataflow_blocks_reference/browser_api/iframe_message.txt
  • Last modified: 2026/10/22 13:25
  • by 127.0.0.1