Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getWindowHandles.js 662B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const uuid_1 = require("uuid");
  4. async function getWindowHandles() {
  5. let newPages = await this.browser.pages();
  6. const stalePageIds = [];
  7. this.windows.forEach((page, id) => {
  8. if (newPages.includes(page)) {
  9. newPages = newPages.filter(newPage => page !== newPage);
  10. }
  11. else {
  12. stalePageIds.push(id);
  13. }
  14. });
  15. stalePageIds.forEach(pageId => this.windows.delete(pageId));
  16. newPages.forEach(page => this.windows.set(uuid_1.v4(), page));
  17. return Array.from(this.windows.keys());
  18. }
  19. exports.default = getWindowHandles;