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.

newWindow.js 964B

1234567891011121314151617181920212223
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const newWindow_1 = __importDefault(require("../../scripts/newWindow"));
  7. async function newWindow(url, { windowName = 'New Window', windowFeatures = '' } = {}) {
  8. if (typeof url !== 'string') {
  9. throw new Error('number or type of arguments don\'t agree with newWindow command');
  10. }
  11. if (this.isMobile) {
  12. throw new Error('newWindow command is not supported on mobile platforms');
  13. }
  14. await this.execute(newWindow_1.default, url, windowName, windowFeatures);
  15. const tabs = await this.getWindowHandles();
  16. const newTab = tabs.pop();
  17. if (!newTab) {
  18. throw new Error('No window handle was found to switch to');
  19. }
  20. await this.switchToWindow(newTab);
  21. return newTab;
  22. }
  23. exports.default = newWindow;