Let icons load in iframes without a location (#2259)
Currently, icons will fail to load if the player is placed inside an iframe without a window.location. This adds an additional check to use `window.top.location` if the window does not have a location.
This commit is contained in:
parent
882952bba6
commit
c2bfe489ea
3
src/js/controls.js
vendored
3
src/js/controls.js
vendored
@ -38,7 +38,8 @@ const controls = {
|
|||||||
// Get icon URL
|
// Get icon URL
|
||||||
getIconUrl() {
|
getIconUrl() {
|
||||||
const url = new URL(this.config.iconUrl, window.location);
|
const url = new URL(this.config.iconUrl, window.location);
|
||||||
const cors = url.host !== window.location.host || (browser.isIE && !window.svg4everybody);
|
const host = window.location.host ? window.location.host : window.top.location.host;
|
||||||
|
const cors = url.host !== host || (browser.isIE && !window.svg4everybody);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: this.config.iconUrl,
|
url: this.config.iconUrl,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user