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.

closeWindow.js 770B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const uuid_1 = require("uuid");
  4. async function closeWindow() {
  5. delete this.currentFrame;
  6. const page = this.getPageHandle();
  7. await page.close();
  8. this.windows.delete(this.currentWindowHandle || '');
  9. const handles = this.windows.keys();
  10. this.currentWindowHandle = handles.next().value;
  11. if (!this.currentWindowHandle) {
  12. const page = await this.browser.newPage();
  13. const newWindowHandle = uuid_1.v4();
  14. this.windows.set(newWindowHandle, page);
  15. this.currentWindowHandle = newWindowHandle;
  16. }
  17. const newPage = this.getPageHandle();
  18. await newPage.bringToFront();
  19. return this.currentWindowHandle;
  20. }
  21. exports.default = closeWindow;