lib/onebox/mixins/twitch_onebox.rb in onebox-2.0.2 vs lib/onebox/mixins/twitch_onebox.rb in onebox-2.1.0
- old
+ new
@@ -5,10 +5,11 @@
module TwitchOnebox
def self.included(klass)
klass.include(Onebox::Engine)
klass.matches_regexp(klass.twitch_regexp)
+ klass.requires_iframe_origins "https://player.twitch.tv"
klass.include(InstanceMethods)
end
module InstanceMethods
def twitch_id
@@ -23,10 +24,10 @@
::Onebox::Helpers.video_placeholder_html
end
def to_html
<<~HTML
- <iframe src="//#{base_url}#{query_params}&parent=#{options[:hostname]}&autoplay=false" width="620" height="378" frameborder="0" style="overflow: hidden;" scrolling="no" allowfullscreen="allowfullscreen"></iframe>
+ <iframe src="https://#{base_url}#{query_params}&parent=#{options[:hostname]}&autoplay=false" width="620" height="378" frameborder="0" style="overflow: hidden;" scrolling="no" allowfullscreen="allowfullscreen"></iframe>
HTML
end
end
end
end