Skip to content

Commit

Permalink
Merge pull request #33 from xsolla/PAYMENTS-9772-new-window-error
Browse files Browse the repository at this point in the history
PAYMENTS-9772-new-window-error: update readme
  • Loading branch information
A-Neganova authored Aug 10, 2022
2 parents df5033c + 94ec722 commit 8ea43c5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog

## 1.2.8
- [fix] Fix iframe closing case

## 1.2.7
- [feature] Added close function

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,13 @@ HTML example:
``` html
<button data-xpaystation-widget-open>Buy Credits</button>
```

### Troubleshooting

Browsers are sensitive to anything that could affect user security.
You should work carefully with [user trusted events](https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted), such as click handling.
If a payment method opens in a new browser tab, you must ensure there is a connection between this functionality and a trusted event.
If the conditions for opening a new tab depend on asynchronous code, the event won’t be trusted and result in an error.
Refactoring the callback code that opens a new tab in synchronous style can resolve this problem.

Additional code that runs on a widget button click may also cause similar problems.
5 changes: 4 additions & 1 deletion dist/widget.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/widget.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/widget.min.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ module.exports = (function () {
this.message.on('widget-close', (function () {
this.closeFrame();
}).bind(this));
this.message.on('close', (function () {
this.closeFrame();
}).bind(this));
this.message.on('status', (function (event) {
this.triggerEvent('status', event.detail);
}).bind(this));
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = '1.2.7';
module.exports = '1.2.8';

0 comments on commit 8ea43c5

Please sign in to comment.