Skip to content

Commit

Permalink
STENCIL-3252 fix iframe bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mcampa committed Mar 9, 2017
1 parent c3e8e5e commit 2cd94f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ node_modules/
.stencil
.DS_Store
assets/css-artifacts
assets/js/bundle.js
dist/
*.js.map
4 changes: 2 additions & 2 deletions assets/js/theme/common/product-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class Product {
*/
isRunningInIframe() {
try {
return this.window.self !== this.window.top;
return window.self !== window.top;
} catch (e) {
return true;
}
Expand Down Expand Up @@ -274,7 +274,7 @@ export default class Product {
* @param {String} url
*/
redirectTo(url) {
if (this.isRunningInIframe()) {
if (this.isRunningInIframe() && !window.iframeSdk) {
window.top.location = url;
} else {
window.location = url;
Expand Down

0 comments on commit 2cd94f2

Please sign in to comment.