Skip to content

Commit

Permalink
Add ProxyWindow.getWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Brain committed Jan 27, 2019
1 parent 1e5d446 commit b87ec93
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/serialize/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,19 @@ export class ProxyWindow {
});
}

getWindow() : ?CrossDomainWindowType {
return this.actualWindow;
}

setWindow(win : CrossDomainWindowType) {
this.actualWindow = win;
this.actualWindowPromise.resolve(win);
}

awaitWindow() : ZalgoPromise<CrossDomainWindowType> {
return this.actualWindowPromise;
}

matchWindow(win : CrossDomainWindowType) : ZalgoPromise<boolean> {
return ZalgoPromise.try(() => {
if (this.actualWindow) {
Expand All @@ -154,10 +162,6 @@ export class ProxyWindow {
return this.actualWindow || this;
}

awaitWindow() : ZalgoPromise<CrossDomainWindowType> {
return this.actualWindowPromise;
}

getInstanceID() : ZalgoPromise<string> {
if (this.actualWindow) {
return getWindowInstanceID(this.actualWindow);
Expand Down

0 comments on commit b87ec93

Please # to comment.