Properly focus reader iframe when opening a new reader instance

This commit is contained in:
Martynas Bagdonas 2023-08-18 18:30:06 +02:00
parent 3ef1f09927
commit b05ef8ed04

View file

@ -86,6 +86,11 @@ class ReaderInstance {
return this._type;
}
async focus() {
await this._waitForReader();
this._iframeWindow.focus();
}
getSecondViewState() {
let state = this._iframeWindow.wrappedJSObject.getSecondViewState();
return state ? JSON.parse(JSON.stringify(state)) : undefined;
@ -1441,7 +1446,7 @@ class Reader {
}
if (!openInBackground) {
reader._window.focus();
reader.focus();
}
return reader;
}