Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Issue 1277

Under Construction!

To use this feature, a gadget must require(or optional) the feature like so:

    <Optional feature="shared-script-frame">
      <Param name="view">script</Param>
    </Optional>

Gadgets MUST specify a param named "view" that indicates which gadget view should be rendered as the script frame.  This specified view will render hidden on the page.

The container SHOULD render this gadget view before any other view of the gadget is rendered.  In other words, the script frame view of a gadget SHOULD always be the first view to render in a container page. If all instances of a gadget are removed from the page, it is up to the container if the last remaining script frame view is also removed, or if it will persist to save state in case another view is rendered in the future.

The container MUST only create 1 rendering of the shared script frame view at any given time.  If the container sandboxes gadgets in a way to isolate their execution scope, it should be done in a way so that every gadget instance (of this same gadget) requesting this feature would be able to (in terms of browser security) access the contents of any other instance (of this same gadget).

Gadgets can request a reference to the shared script frame:

  gadgets.util.registerOnLoadHandler(function() {
    gadgets.script.getScriptFrame(function(scriptFrame) {
      // Do something with the script frame here.
    };
  });
  • No labels