network_executive 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,12 +3,12 @@
3
3
 
4
4
  # Tell the parent that we are ready
5
5
  @addEventListener 'DOMContentLoaded', (e) =>
6
- @parent.postMessage { event:'domloaded:iframe' }, @location.origin
6
+ @parent.postMessage { event:'domloaded:iframe' }, '*'
7
7
  , false
8
8
 
9
9
  events = [ 'load', 'error', 'change', 'hashchange', 'resize', 'pageshow', 'pagehide', 'beforeunload' ]
10
10
 
11
11
  events.forEach (evt) =>
12
12
  @addEventListener evt, (e) =>
13
- @parent.postMessage { event:"#{evt}:iframe" }, @location.origin
13
+ @parent.postMessage { event:"#{evt}:iframe" }, '*'
14
14
  , false
@@ -24,6 +24,8 @@ class @NE.SetTopBox
24
24
  establishUplink : ->
25
25
  @uplink = new EventSource( "tune_in/#{@channel}" )
26
26
 
27
+ @uplink.addEventListener 'message', @purgeOnIframeLoad, false
28
+
27
29
  @uplink.addEventListener 'open', @onUplinkUp, false
28
30
  @uplink.addEventListener 'message', @onUplinkMessage, false
29
31
  @uplink.addEventListener 'error', @onUplinkDown, false
@@ -69,13 +71,18 @@ class @NE.SetTopBox
69
71
 
70
72
  payload.onLoad.event = 'load:program'
71
73
 
72
- e.detail.source.postMessage payload.onLoad, win.location.origin
74
+ e.detail.source.postMessage payload.onLoad, '*'
73
75
 
74
- win.removeEventListener 'load:iframe', onIframeLoad
76
+ @onIframeLoad = onIframeLoad
75
77
 
76
78
  win.addEventListener 'load:iframe', onIframeLoad, false
77
79
 
78
80
  @goTo payload.url
79
81
 
80
82
  onProgramUpdate : (payload) ->
81
- @program.postMessage payload, win.location.origin
83
+ @program.postMessage payload, '*'
84
+
85
+ purgeOnIframeLoad : (e) =>
86
+ win.removeEventListener 'load:iframe', @onIframeLoad, false
87
+
88
+ @onIframeLoad = null
@@ -1,3 +1,3 @@
1
1
  module NetworkExecutive
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network_executive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -366,7 +366,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
366
366
  version: '0'
367
367
  segments:
368
368
  - 0
369
- hash: -2106451608601115387
369
+ hash: -2692534620276244653
370
370
  requirements: []
371
371
  rubyforge_project:
372
372
  rubygems_version: 1.8.24