Skip to content

Instantly share code, notes, and snippets.

@recyclerobot
Created August 31, 2015 23:58
Show Gist options
  • Select an option

  • Save recyclerobot/f056953f3e0749b2a942 to your computer and use it in GitHub Desktop.

Select an option

Save recyclerobot/f056953f3e0749b2a942 to your computer and use it in GitHub Desktop.

Revisions

  1. recyclerobot renamed this gist Aug 31, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. recyclerobot created this gist Aug 31, 2015.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    // Forward all postMessage calls from the iframes that have data in the form {method:, arguments:} directly to Segment.
    window.onmessage = function(e){
    var method = e.data.method;
    var args = e.data.arguments ? _.values(e.data.arguments) : null;
    if (analytics[method]) {
    analytics[method].apply(analytics, args);
    }
    };