@theia/mini-browser 1.45.0 → 1.46.0-next.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +45 -45
  2. package/lib/browser/environment/mini-browser-environment-module.d.ts +3 -3
  3. package/lib/browser/environment/mini-browser-environment-module.js +24 -24
  4. package/lib/browser/environment/mini-browser-environment.d.ts +25 -25
  5. package/lib/browser/environment/mini-browser-environment.js +95 -95
  6. package/lib/browser/environment/mini-browser-environment.js.map +1 -1
  7. package/lib/browser/location-mapper-service.d.ts +58 -58
  8. package/lib/browser/location-mapper-service.js +140 -140
  9. package/lib/browser/mini-browser-content-style.d.ts +17 -17
  10. package/lib/browser/mini-browser-content-style.js +36 -36
  11. package/lib/browser/mini-browser-content.d.ts +177 -177
  12. package/lib/browser/mini-browser-content.js +554 -554
  13. package/lib/browser/mini-browser-frontend-module.d.ts +4 -4
  14. package/lib/browser/mini-browser-frontend-module.js +70 -70
  15. package/lib/browser/mini-browser-frontend-security-warnings.d.ts +11 -11
  16. package/lib/browser/mini-browser-frontend-security-warnings.js +73 -73
  17. package/lib/browser/mini-browser-open-handler.d.ts +76 -76
  18. package/lib/browser/mini-browser-open-handler.js +292 -292
  19. package/lib/browser/mini-browser.d.ts +25 -25
  20. package/lib/browser/mini-browser.js +118 -118
  21. package/lib/common/mini-browser-endpoint.d.ts +12 -12
  22. package/lib/common/mini-browser-endpoint.js +31 -31
  23. package/lib/common/mini-browser-service.d.ts +14 -14
  24. package/lib/common/mini-browser-service.js +20 -20
  25. package/lib/electron-browser/environment/electron-mini-browser-environment-module.d.ts +3 -3
  26. package/lib/electron-browser/environment/electron-mini-browser-environment-module.js +25 -25
  27. package/lib/electron-browser/environment/electron-mini-browser-environment.d.ts +9 -9
  28. package/lib/electron-browser/environment/electron-mini-browser-environment.js +60 -60
  29. package/lib/electron-main/mini-browser-electron-main-contribution.d.ts +12 -12
  30. package/lib/electron-main/mini-browser-electron-main-contribution.js +54 -54
  31. package/lib/node/mini-browser-backend-module.d.ts +3 -3
  32. package/lib/node/mini-browser-backend-module.js +41 -41
  33. package/lib/node/mini-browser-backend-security-warnings.d.ts +5 -5
  34. package/lib/node/mini-browser-backend-security-warnings.js +51 -51
  35. package/lib/node/mini-browser-endpoint.d.ts +97 -97
  36. package/lib/node/mini-browser-endpoint.js +268 -268
  37. package/lib/node/mini-browser-endpoint.js.map +1 -1
  38. package/lib/node/mini-browser-ws-validator.d.ts +12 -12
  39. package/lib/node/mini-browser-ws-validator.js +69 -69
  40. package/lib/package.spec.js +18 -18
  41. package/package.json +5 -6
  42. package/src/browser/environment/mini-browser-environment-module.ts +24 -24
  43. package/src/browser/environment/mini-browser-environment.ts +87 -87
  44. package/src/browser/location-mapper-service.ts +150 -150
  45. package/src/browser/mini-browser-content-style.ts +32 -32
  46. package/src/browser/mini-browser-content.ts +630 -630
  47. package/src/browser/mini-browser-frontend-module.ts +86 -86
  48. package/src/browser/mini-browser-frontend-security-warnings.ts +59 -59
  49. package/src/browser/mini-browser-open-handler.ts +312 -312
  50. package/src/browser/mini-browser.ts +110 -110
  51. package/src/browser/pdfobject.d.ts +99 -99
  52. package/src/browser/style/index.css +157 -157
  53. package/src/browser/style/mini-browser.svg +17 -17
  54. package/src/common/mini-browser-endpoint.ts +28 -28
  55. package/src/common/mini-browser-service.ts +29 -29
  56. package/src/electron-browser/environment/electron-mini-browser-environment-module.ts +25 -25
  57. package/src/electron-browser/environment/electron-mini-browser-environment.ts +53 -53
  58. package/src/electron-main/mini-browser-electron-main-contribution.ts +42 -42
  59. package/src/node/mini-browser-backend-module.ts +41 -41
  60. package/src/node/mini-browser-backend-security-warnings.ts +45 -45
  61. package/src/node/mini-browser-endpoint.ts +315 -315
  62. package/src/node/mini-browser-ws-validator.ts +56 -56
  63. package/src/package.spec.ts +21 -21
@@ -1,70 +1,70 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2020 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.MiniBrowserWsRequestValidator = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const url = require("url");
30
- const mini_browser_endpoint_1 = require("../common/mini-browser-endpoint");
31
- /**
32
- * Prevents explicit WebSocket connections from the mini-browser virtual host.
33
- */
34
- let MiniBrowserWsRequestValidator = class MiniBrowserWsRequestValidator {
35
- constructor() {
36
- this.serveSameOrigin = false;
37
- }
38
- init() {
39
- const pattern = process.env[mini_browser_endpoint_1.MiniBrowserEndpoint.HOST_PATTERN_ENV] || mini_browser_endpoint_1.MiniBrowserEndpoint.HOST_PATTERN_DEFAULT;
40
- if (pattern === '{{hostname}}') {
41
- this.serveSameOrigin = true;
42
- }
43
- const vhostRe = pattern
44
- .replace(/\./g, '\\.')
45
- .replace('{{uuid}}', '.+')
46
- .replace('{{hostname}}', '.+');
47
- this.miniBrowserHostRe = new RegExp(vhostRe, 'i');
48
- }
49
- async allowWsUpgrade(request) {
50
- if (request.headers.origin && !this.serveSameOrigin) {
51
- const origin = url.parse(request.headers.origin);
52
- if (origin.host && this.miniBrowserHostRe.test(origin.host)) {
53
- // If the origin comes from the WebViews, refuse:
54
- return false;
55
- }
56
- }
57
- return true;
58
- }
59
- };
60
- __decorate([
61
- (0, inversify_1.postConstruct)(),
62
- __metadata("design:type", Function),
63
- __metadata("design:paramtypes", []),
64
- __metadata("design:returntype", void 0)
65
- ], MiniBrowserWsRequestValidator.prototype, "init", null);
66
- MiniBrowserWsRequestValidator = __decorate([
67
- (0, inversify_1.injectable)()
68
- ], MiniBrowserWsRequestValidator);
69
- exports.MiniBrowserWsRequestValidator = MiniBrowserWsRequestValidator;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2020 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.MiniBrowserWsRequestValidator = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const url = require("url");
30
+ const mini_browser_endpoint_1 = require("../common/mini-browser-endpoint");
31
+ /**
32
+ * Prevents explicit WebSocket connections from the mini-browser virtual host.
33
+ */
34
+ let MiniBrowserWsRequestValidator = class MiniBrowserWsRequestValidator {
35
+ constructor() {
36
+ this.serveSameOrigin = false;
37
+ }
38
+ init() {
39
+ const pattern = process.env[mini_browser_endpoint_1.MiniBrowserEndpoint.HOST_PATTERN_ENV] || mini_browser_endpoint_1.MiniBrowserEndpoint.HOST_PATTERN_DEFAULT;
40
+ if (pattern === '{{hostname}}') {
41
+ this.serveSameOrigin = true;
42
+ }
43
+ const vhostRe = pattern
44
+ .replace(/\./g, '\\.')
45
+ .replace('{{uuid}}', '.+')
46
+ .replace('{{hostname}}', '.+');
47
+ this.miniBrowserHostRe = new RegExp(vhostRe, 'i');
48
+ }
49
+ async allowWsUpgrade(request) {
50
+ if (request.headers.origin && !this.serveSameOrigin) {
51
+ const origin = url.parse(request.headers.origin);
52
+ if (origin.host && this.miniBrowserHostRe.test(origin.host)) {
53
+ // If the origin comes from the WebViews, refuse:
54
+ return false;
55
+ }
56
+ }
57
+ return true;
58
+ }
59
+ };
60
+ __decorate([
61
+ (0, inversify_1.postConstruct)(),
62
+ __metadata("design:type", Function),
63
+ __metadata("design:paramtypes", []),
64
+ __metadata("design:returntype", void 0)
65
+ ], MiniBrowserWsRequestValidator.prototype, "init", null);
66
+ MiniBrowserWsRequestValidator = __decorate([
67
+ (0, inversify_1.injectable)()
68
+ ], MiniBrowserWsRequestValidator);
69
+ exports.MiniBrowserWsRequestValidator = MiniBrowserWsRequestValidator;
70
70
  //# sourceMappingURL=mini-browser-ws-validator.js.map
@@ -1,19 +1,19 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
- describe('mini-browser package', () => {
17
- it('support code coverage statistics', () => true);
18
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+ describe('mini-browser package', () => {
17
+ it('support code coverage statistics', () => true);
18
+ });
19
19
  //# sourceMappingURL=package.spec.js.map
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@theia/mini-browser",
3
- "version": "1.45.0",
3
+ "version": "1.46.0-next.72+4a275b29d",
4
4
  "description": "Theia - Mini-Browser Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.45.0",
7
- "@theia/filesystem": "1.45.0",
6
+ "@theia/core": "1.46.0-next.72+4a275b29d",
7
+ "@theia/filesystem": "1.46.0-next.72+4a275b29d",
8
8
  "@types/mime-types": "^2.1.0",
9
9
  "mime-types": "^2.1.18",
10
10
  "pdfobject": "^2.0.201604172",
11
- "uuid": "^8.0.0",
12
11
  "vhost": "^3.0.2"
13
12
  },
14
13
  "publishConfig": {
@@ -49,10 +48,10 @@
49
48
  "watch": "theiaext watch"
50
49
  },
51
50
  "devDependencies": {
52
- "@theia/ext-scripts": "1.45.0"
51
+ "@theia/ext-scripts": "1.46.0"
53
52
  },
54
53
  "nyc": {
55
54
  "extends": "../../configs/nyc.json"
56
55
  },
57
- "gitHead": "2b20a60a0f9b54b19838a0f71760989a19622495"
56
+ "gitHead": "4a275b29d0db6c81190488c7f76cb667da05ef19"
58
57
  }
@@ -1,24 +1,24 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { FrontendApplicationContribution } from '@theia/core/lib/browser';
18
- import { ContainerModule } from '@theia/core/shared/inversify';
19
- import { MiniBrowserEnvironment } from './mini-browser-environment';
20
-
21
- export default new ContainerModule(bind => {
22
- bind(MiniBrowserEnvironment).toSelf().inSingletonScope();
23
- bind(FrontendApplicationContribution).toService(MiniBrowserEnvironment);
24
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
18
+ import { ContainerModule } from '@theia/core/shared/inversify';
19
+ import { MiniBrowserEnvironment } from './mini-browser-environment';
20
+
21
+ export default new ContainerModule(bind => {
22
+ bind(MiniBrowserEnvironment).toSelf().inSingletonScope();
23
+ bind(FrontendApplicationContribution).toService(MiniBrowserEnvironment);
24
+ });
@@ -1,87 +1,87 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { Endpoint, FrontendApplicationContribution } from '@theia/core/lib/browser';
18
- import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
19
- import { environment } from '@theia/core/shared/@theia/application-package/lib/environment';
20
- import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
21
- import { v4 } from 'uuid';
22
- import { MiniBrowserEndpoint } from '../../common/mini-browser-endpoint';
23
-
24
- /**
25
- * Fetch values from the backend's environment and caches them locally.
26
- * Helps with deploying various mini-browser endpoints.
27
- */
28
- @injectable()
29
- export class MiniBrowserEnvironment implements FrontendApplicationContribution {
30
-
31
- protected _hostPatternPromise: Promise<string>;
32
- protected _hostPattern?: string;
33
-
34
- @inject(EnvVariablesServer)
35
- protected environment: EnvVariablesServer;
36
-
37
- @postConstruct()
38
- protected init(): void {
39
- this._hostPatternPromise = this.getHostPattern()
40
- .then(pattern => this._hostPattern = pattern);
41
- }
42
-
43
- get hostPatternPromise(): Promise<string> {
44
- return this._hostPatternPromise;
45
- }
46
-
47
- get hostPattern(): string | undefined {
48
- return this._hostPattern;
49
- }
50
-
51
- async onStart(): Promise<void> {
52
- await this._hostPatternPromise;
53
- }
54
-
55
- /**
56
- * Throws if `hostPatternPromise` is not yet resolved.
57
- */
58
- getEndpoint(uuid: string, hostname?: string): Endpoint {
59
- if (this._hostPattern === undefined) {
60
- throw new Error('MiniBrowserEnvironment is not finished initializing');
61
- }
62
- return new Endpoint({
63
- path: MiniBrowserEndpoint.PATH,
64
- host: this._hostPattern
65
- .replace('{{uuid}}', uuid)
66
- .replace('{{hostname}}', hostname || this.getDefaultHostname()),
67
- });
68
- }
69
-
70
- /**
71
- * Throws if `hostPatternPromise` is not yet resolved.
72
- */
73
- getRandomEndpoint(): Endpoint {
74
- return this.getEndpoint(v4());
75
- }
76
-
77
- protected async getHostPattern(): Promise<string> {
78
- return environment.electron.is()
79
- ? MiniBrowserEndpoint.HOST_PATTERN_DEFAULT
80
- : this.environment.getValue(MiniBrowserEndpoint.HOST_PATTERN_ENV)
81
- .then(envVar => envVar?.value || MiniBrowserEndpoint.HOST_PATTERN_DEFAULT);
82
- }
83
-
84
- protected getDefaultHostname(): string {
85
- return self.location.host;
86
- }
87
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { Endpoint, FrontendApplicationContribution } from '@theia/core/lib/browser';
18
+ import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
19
+ import { environment } from '@theia/core/shared/@theia/application-package/lib/environment';
20
+ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
21
+ import { generateUuid } from '@theia/core/lib/common/uuid';
22
+ import { MiniBrowserEndpoint } from '../../common/mini-browser-endpoint';
23
+
24
+ /**
25
+ * Fetch values from the backend's environment and caches them locally.
26
+ * Helps with deploying various mini-browser endpoints.
27
+ */
28
+ @injectable()
29
+ export class MiniBrowserEnvironment implements FrontendApplicationContribution {
30
+
31
+ protected _hostPatternPromise: Promise<string>;
32
+ protected _hostPattern?: string;
33
+
34
+ @inject(EnvVariablesServer)
35
+ protected environment: EnvVariablesServer;
36
+
37
+ @postConstruct()
38
+ protected init(): void {
39
+ this._hostPatternPromise = this.getHostPattern()
40
+ .then(pattern => this._hostPattern = pattern);
41
+ }
42
+
43
+ get hostPatternPromise(): Promise<string> {
44
+ return this._hostPatternPromise;
45
+ }
46
+
47
+ get hostPattern(): string | undefined {
48
+ return this._hostPattern;
49
+ }
50
+
51
+ async onStart(): Promise<void> {
52
+ await this._hostPatternPromise;
53
+ }
54
+
55
+ /**
56
+ * Throws if `hostPatternPromise` is not yet resolved.
57
+ */
58
+ getEndpoint(uuid: string, hostname?: string): Endpoint {
59
+ if (this._hostPattern === undefined) {
60
+ throw new Error('MiniBrowserEnvironment is not finished initializing');
61
+ }
62
+ return new Endpoint({
63
+ path: MiniBrowserEndpoint.PATH,
64
+ host: this._hostPattern
65
+ .replace('{{uuid}}', uuid)
66
+ .replace('{{hostname}}', hostname || this.getDefaultHostname()),
67
+ });
68
+ }
69
+
70
+ /**
71
+ * Throws if `hostPatternPromise` is not yet resolved.
72
+ */
73
+ getRandomEndpoint(): Endpoint {
74
+ return this.getEndpoint(generateUuid());
75
+ }
76
+
77
+ protected async getHostPattern(): Promise<string> {
78
+ return environment.electron.is()
79
+ ? MiniBrowserEndpoint.HOST_PATTERN_DEFAULT
80
+ : this.environment.getValue(MiniBrowserEndpoint.HOST_PATTERN_ENV)
81
+ .then(envVar => envVar?.value || MiniBrowserEndpoint.HOST_PATTERN_DEFAULT);
82
+ }
83
+
84
+ protected getDefaultHostname(): string {
85
+ return self.location.host;
86
+ }
87
+ }