diff --git a/js/components/frame.js b/js/components/frame.js index d36b44de196..311f3827b93 100644 --- a/js/components/frame.js +++ b/js/components/frame.js @@ -541,8 +541,10 @@ class Frame extends ImmutableComponent { * can either be main frame or subframe. * @param {function=} noFlashCallback - Optional callback to run if Flash is not * installed + * @param {function=} flashCallback - Optional callback to run if Flash is + * accepted */ - showFlashNotification (origin, noFlashCallback) { + showFlashNotification (origin, noFlashCallback, flashCallback) { if (!origin || !UrlUtil.shouldInterceptFlash(origin)) { noFlashCallback() return @@ -573,6 +575,9 @@ class Frame extends ImmutableComponent { } else { appActions.changeSiteSetting(this.origin, 'flash', 1) } + if (flashCallback) { + flashCallback() + } } else { if (persist) { appActions.changeSiteSetting(this.origin, 'flash', false) @@ -763,7 +768,7 @@ class Frame extends ImmutableComponent { method.apply(this, e.args) }) - const interceptFlash = (stopCurrentLoad, adobeUrl) => { + const interceptFlash = (stopCurrentLoad, adobeUrl, redirectUrl) => { if (!this.origin) { return } @@ -781,6 +786,10 @@ class Frame extends ImmutableComponent { if (stopCurrentLoad && adobeUrl) { windowActions.loadUrl(this.frame, adobeUrl) } + }, () => { + if (redirectUrl) { + windowActions.loadUrl(this.frame, redirectUrl) + } }) } @@ -838,7 +847,7 @@ class Frame extends ImmutableComponent { if (hack && hack.enableFlashCTP && !this.webview.allowRunningPlugins && this.props.flashInitialized) { // Fix #3011 - interceptFlash(false) + interceptFlash(false, undefined, hack.redirectURL) } } const loadFail = (e, provisionLoadFailure = false) => { diff --git a/js/data/siteHacks.js b/js/data/siteHacks.js index 0a029865338..e3fa2f8f9f9 100644 --- a/js/data/siteHacks.js +++ b/js/data/siteHacks.js @@ -116,5 +116,9 @@ module.exports.siteHacks = { }, 'play.spotify.com': { enableFlashCTP: true + }, + 'player.siriusxm.com': { + enableFlashCTP: true, + redirectURL: 'https://player.siriusxm.com' } }