Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
blocks:app-note:intra-browser-communication [2022-03-22 09:56]
admin More postMessage examples
blocks:app-note:intra-browser-communication [2023-08-01 21:06]
admin [Installation]
Line 10: Line 10:
 ===== Installation ===== ===== Installation =====
  
-You need a computer running Blocks server software and a web browser to run this application note. Here's the {{ :blocks:app-note:intra-browser-communication:intrabrowsercomms.zip |Blocks root}} containing this application note. See the [[https://int.pixilab.se/docs/blocks/app-note/start|general setup]] article for details on how to download and install the root on your blocks server. +You need a computer running Blocks server software and a web browser to run this application note. Here's the {{ :blocks:app-note:intra-browser-communication:intrabrowsercomms.zip |Blocks root}} containing this application note. See the[[blocks:app-note:start|general setup]] article for details on how to download and install the root on your blocks server. 
  
 ===== Running the Example ===== ===== Running the Example =====
Line 54: Line 54:
  
 <code> <code>
-/* Keep Blocks Attractor at bay when user interacts with content. +/* Keep Blocks Attractor at bay when user interacts with content. 
- Block can not detect user interaction inside a Web Block without +  Block can not detect user interaction inside a Web Block without 
- such notifications.+  such notifications.
 */ */
 parent.postMessage({type: 'action'}, '*'); parent.postMessage({type: 'action'}, '*');
  
-/* Navigate to specified child block. Always uses absolute block path starting +/* Navigate to specified child block. Always uses absolute block path starting 
- from he outermost block playing on the spot. If you're using Reference Block +   from he outermost block playing on the spot. If you're using Reference Block 
- to bring in the content making the outgoing call, remember that all paths +   to bring in the content making the outgoing call, remember that all paths 
- must be specified from the top of the outermost (root) block, not relative +   must be specified from the top of the outermost (root) block, not relative 
- to the referenced block.+   to the referenced block.
 */ */
 parent.postMessage({type: 'goto-block', data: "/path/to/block"}, '*'); parent.postMessage({type: 'goto-block', data: "/path/to/block"}, '*');
  
-/* Go back to previous block path.+/* Go back to previous block path.
 */ */
 parent.postMessage({type: 'go-back'}, '*'); parent.postMessage({type: 'go-back'}, '*');
  
-/* Tell any Locator to locate Spot with Location ID 12.+/* Tell any Locator to locate Spot with Location ID 12.
 */ */
 parent.postMessage({type: 'set-location', data: 12}, '*'); parent.postMessage({type: 'set-location', data: 12}, '*');
  
-/* Specify local tags of this Spot. Comma separate multiple tags.+/* Specify local tags of this Spot. Comma separate multiple tags.
 */ */
 parent.postMessage({type: 'set-tags', data: 12}, '*'); parent.postMessage({type: 'set-tags', data: 12}, '*');