Help get this topic noticed by sharing it on Twitter, Facebook, or email.

What *exactly* does enabling iFrames do?

Is there a document which explains in more detail exactly, precisely what enabling the iFrames feature (in Settings) does? The verbiage the setting itself is pretty brief. I think I may need it, but would feel better if I knew exactly what it does rather than trying to infer from the short description.
1 person has
this question
+1
Reply
  • Hello Bryan,

    Thank you for your question. By default, extensions only run on the main/parent page and not its iframes. Enabling this feature simply makes your extension run in iframes as well.

    This is often desirable where you either want to run the extension on iframes, or in many cases want the parent page to interact its iframes. For this purpose, we provide the means to identify when your code is running in an iframe (appAPI.dom.isIframe) and the mechanisms to communicate between the parent page and its iframes appAPI.message.toCurrentTabWindow and appAPI.message.toCurrentTabIframes.

    So, for example:

    <code>appAPI.ready(function($) {
    // iframe code
    if (appAPI.dom.isIframe()) {
    appAPI.message.addListener(function(msg) {
    if (msg.action === 'bgColorBlue') {
    $('body').css('background-color', '#0000FF');
    }
    });
    return;
    }

    // Parent code
    appAPI.message.toCurrentTabIframes({action: 'bgColorBlue'});
    });
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited