1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

[Editor] When an editor is unselected give the focus to the current page

Follow-up of #16756.
This commit is contained in:
Calixte Denizet 2023-07-27 20:12:38 +02:00
parent 8679199a2f
commit 9d576d5097
4 changed files with 90 additions and 3 deletions

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
exports.loadAndWait = (filename, selector, zoom) =>
exports.loadAndWait = (filename, selector, zoom, pageSetup) =>
Promise.all(
global.integrationSessions.map(async session => {
const page = await session.browser.newPage();
@ -38,6 +38,10 @@ exports.loadAndWait = (filename, selector, zoom) =>
url += `#zoom=${zoom}`;
}
await page.goto(url);
if (pageSetup) {
await pageSetup(page);
}
await page.bringToFront();
await page.waitForSelector(selector, {
timeout: 0,