Skip to content

Commit ee9c3f1

Browse files
committed
Method name change; Make listeners object public
1 parent 6fb90a7 commit ee9c3f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Popup.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export class Popup {
3737
private static EVENT_METHOD_SUCCESS: string = 'success';
3838
private static EVENT_METHOD_DOMAIN: string = 'domain';
3939
private static EVENT_METHOD_ABORTED: string = 'aborted';
40-
private listeners: { [name: string]: () => void } = {};
40+
public listeners: { [name: string]: () => void } = {};
4141
private domain: string = "";
4242

4343
public constructor(userConfiguration: PopupConfiguration) {
4444
const configuration = { ...DEFAULT_POPUP_CONFIG, ...userConfiguration };
45-
this.popUp = Popup.createPopUp(configuration);
45+
this.popUp = Popup.openPopUp(configuration);
4646
this.unregisterEventListener = addWindowEventListener('message', this.attachEventListeners());
4747
this.interval = setInterval(() => {
4848
if (this.popUp && this.popUp.closed) {
@@ -74,7 +74,7 @@ export class Popup {
7474
};
7575
};
7676

77-
private static createPopUp(configuration: Configuration): Window | null {
77+
private static openPopUp(configuration: Configuration): Window | null {
7878
const popUp = window.open(
7979
'about:blank',
8080
configuration.title,
@@ -86,12 +86,14 @@ export class Popup {
8686
location=no, status=no,
8787
directories=no, titlebar=no`,
8888
);
89+
8990
if (!popUp) {
9091
logMessage('error', {
9192
code: 'ERR_POPUP_BLOCKED',
9293
message: 'Popup is blocked! Make sure to enable popups!',
9394
});
9495
}
96+
9597
return popUp;
9698
}
9799

0 commit comments

Comments
 (0)