Skip to content

Commit

Permalink
Add window.top.document as fallback document in plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGoumX committed Apr 18, 2022
1 parent 5f3abde commit cac43af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugins/badge.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ class Badge

_head: -> @parent_doc.head || @parent_doc.getElementsByTagName('head')[0]

_setParentDoc: -> @parent_doc = window.parent.document
_setParentDoc: -> @parent_doc = window.parent.document || window.top.document

_ratingToStars: (rating = 0, limit = 5) ->
return [] if @_noStars(rating)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/order_stash.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ class OrderStash
_head: -> @parent_doc.head || @parent_doc.getElementsByTagName('head')[0]
_animationSupport: -> @$el.style.animation?

_setParentDoc: -> @parent_doc = window.parent.document
_setParentDoc: -> @parent_doc = window.parent.document || window.top.document

_endpoint: ->
params =
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/partner_sku_reviews.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class PartnerSkuReviews
asset_url = (source) -> "#{settings.url.base}/assets/#{source}"

constructor: ->
@parent_doc = window.parent.document
@parent_doc = window.parent.document || window.top.document
@onDOMReady =>
@head = @parent_doc.getElementsByTagName('head')[0]
@_renderAll()
Expand Down

0 comments on commit cac43af

Please sign in to comment.