We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 555c711 commit 443de05Copy full SHA for 443de05
test/server.rb
@@ -42,8 +42,13 @@ def script_tag src
42
content_type 'application/json'
43
data.to_json
44
elsif params[:iframe]
45
+ payload = data.to_json.gsub('<', '<').gsub('>', '>')
46
<<-HTML
- <script>window.top.jQuery.event.trigger('iframe:loaded', #{data.to_json})</script>
47
+ <script>
48
+ if (window.top && window.top !== window)
49
+ window.top.jQuery.event.trigger('iframe:loaded', #{payload})
50
+ </script>
51
+ <p>You shouldn't be seeing this. <a href="#{request.env['HTTP_REFERER']}">Go back</a></p>
52
HTML
53
else
54
content_type 'text/plain'
0 commit comments