@theia/mini-browser 1.45.1 → 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,86 +1,86 @@
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
-
17
- import '../../src/browser/style/index.css';
18
-
19
- import { ContainerModule } from '@theia/core/shared/inversify';
20
- import URI from '@theia/core/lib/common/uri';
21
- import { OpenHandler } from '@theia/core/lib/browser/opener-service';
22
- import { WidgetFactory } from '@theia/core/lib/browser/widget-manager';
23
- import { bindContributionProvider } from '@theia/core/lib/common/contribution-provider';
24
- import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging/ws-connection-provider';
25
- import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
26
- import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
27
- import { CommandContribution } from '@theia/core/lib/common/command';
28
- import { MenuContribution } from '@theia/core/lib/common/menu';
29
- import { NavigatableWidgetOptions } from '@theia/core/lib/browser/navigatable';
30
- import { MiniBrowserOpenHandler } from './mini-browser-open-handler';
31
- import { MiniBrowserService, MiniBrowserServicePath } from '../common/mini-browser-service';
32
- import { MiniBrowser, MiniBrowserOptions } from './mini-browser';
33
- import { MiniBrowserProps, MiniBrowserContentFactory, MiniBrowserContent } from './mini-browser-content';
34
- import {
35
- LocationMapperService,
36
- FileLocationMapper,
37
- HttpLocationMapper,
38
- HttpsLocationMapper,
39
- LocationMapper,
40
- LocationWithoutSchemeMapper,
41
- } from './location-mapper-service';
42
- import { MiniBrowserFrontendSecurityWarnings } from './mini-browser-frontend-security-warnings';
43
-
44
- export default new ContainerModule(bind => {
45
- bind(MiniBrowserContent).toSelf();
46
- bind(MiniBrowserContentFactory).toFactory(context => (props: MiniBrowserProps) => {
47
- const { container } = context;
48
- const child = container.createChild();
49
- child.bind(MiniBrowserProps).toConstantValue(props);
50
- return child.get(MiniBrowserContent);
51
- });
52
-
53
- bind(MiniBrowser).toSelf();
54
- bind(WidgetFactory).toDynamicValue(context => ({
55
- id: MiniBrowser.ID,
56
- async createWidget(options: NavigatableWidgetOptions): Promise<MiniBrowser> {
57
- const { container } = context;
58
- const child = container.createChild();
59
- const uri = new URI(options.uri);
60
- child.bind(MiniBrowserOptions).toConstantValue({ uri });
61
- return child.get(MiniBrowser);
62
- }
63
- })).inSingletonScope();
64
-
65
- bind(MiniBrowserOpenHandler).toSelf().inSingletonScope();
66
- bind(OpenHandler).toService(MiniBrowserOpenHandler);
67
- bind(FrontendApplicationContribution).toService(MiniBrowserOpenHandler);
68
- bind(CommandContribution).toService(MiniBrowserOpenHandler);
69
- bind(MenuContribution).toService(MiniBrowserOpenHandler);
70
- bind(TabBarToolbarContribution).toService(MiniBrowserOpenHandler);
71
-
72
- bindContributionProvider(bind, LocationMapper);
73
- bind(LocationMapper).to(FileLocationMapper).inSingletonScope();
74
- bind(LocationMapper).to(HttpLocationMapper).inSingletonScope();
75
- bind(LocationMapper).to(HttpsLocationMapper).inSingletonScope();
76
- bind(LocationWithoutSchemeMapper).toSelf().inSingletonScope();
77
- bind(LocationMapper).toService(LocationWithoutSchemeMapper);
78
- bind(LocationMapperService).toSelf().inSingletonScope();
79
-
80
- bind(MiniBrowserService).toDynamicValue(
81
- ctx => WebSocketConnectionProvider.createProxy(ctx.container, MiniBrowserServicePath)
82
- ).inSingletonScope();
83
-
84
- bind(MiniBrowserFrontendSecurityWarnings).toSelf().inSingletonScope();
85
- bind(FrontendApplicationContribution).toService(MiniBrowserFrontendSecurityWarnings);
86
- });
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
+
17
+ import '../../src/browser/style/index.css';
18
+
19
+ import { ContainerModule } from '@theia/core/shared/inversify';
20
+ import URI from '@theia/core/lib/common/uri';
21
+ import { OpenHandler } from '@theia/core/lib/browser/opener-service';
22
+ import { WidgetFactory } from '@theia/core/lib/browser/widget-manager';
23
+ import { bindContributionProvider } from '@theia/core/lib/common/contribution-provider';
24
+ import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging/ws-connection-provider';
25
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
26
+ import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
27
+ import { CommandContribution } from '@theia/core/lib/common/command';
28
+ import { MenuContribution } from '@theia/core/lib/common/menu';
29
+ import { NavigatableWidgetOptions } from '@theia/core/lib/browser/navigatable';
30
+ import { MiniBrowserOpenHandler } from './mini-browser-open-handler';
31
+ import { MiniBrowserService, MiniBrowserServicePath } from '../common/mini-browser-service';
32
+ import { MiniBrowser, MiniBrowserOptions } from './mini-browser';
33
+ import { MiniBrowserProps, MiniBrowserContentFactory, MiniBrowserContent } from './mini-browser-content';
34
+ import {
35
+ LocationMapperService,
36
+ FileLocationMapper,
37
+ HttpLocationMapper,
38
+ HttpsLocationMapper,
39
+ LocationMapper,
40
+ LocationWithoutSchemeMapper,
41
+ } from './location-mapper-service';
42
+ import { MiniBrowserFrontendSecurityWarnings } from './mini-browser-frontend-security-warnings';
43
+
44
+ export default new ContainerModule(bind => {
45
+ bind(MiniBrowserContent).toSelf();
46
+ bind(MiniBrowserContentFactory).toFactory(context => (props: MiniBrowserProps) => {
47
+ const { container } = context;
48
+ const child = container.createChild();
49
+ child.bind(MiniBrowserProps).toConstantValue(props);
50
+ return child.get(MiniBrowserContent);
51
+ });
52
+
53
+ bind(MiniBrowser).toSelf();
54
+ bind(WidgetFactory).toDynamicValue(context => ({
55
+ id: MiniBrowser.ID,
56
+ async createWidget(options: NavigatableWidgetOptions): Promise<MiniBrowser> {
57
+ const { container } = context;
58
+ const child = container.createChild();
59
+ const uri = new URI(options.uri);
60
+ child.bind(MiniBrowserOptions).toConstantValue({ uri });
61
+ return child.get(MiniBrowser);
62
+ }
63
+ })).inSingletonScope();
64
+
65
+ bind(MiniBrowserOpenHandler).toSelf().inSingletonScope();
66
+ bind(OpenHandler).toService(MiniBrowserOpenHandler);
67
+ bind(FrontendApplicationContribution).toService(MiniBrowserOpenHandler);
68
+ bind(CommandContribution).toService(MiniBrowserOpenHandler);
69
+ bind(MenuContribution).toService(MiniBrowserOpenHandler);
70
+ bind(TabBarToolbarContribution).toService(MiniBrowserOpenHandler);
71
+
72
+ bindContributionProvider(bind, LocationMapper);
73
+ bind(LocationMapper).to(FileLocationMapper).inSingletonScope();
74
+ bind(LocationMapper).to(HttpLocationMapper).inSingletonScope();
75
+ bind(LocationMapper).to(HttpsLocationMapper).inSingletonScope();
76
+ bind(LocationWithoutSchemeMapper).toSelf().inSingletonScope();
77
+ bind(LocationMapper).toService(LocationWithoutSchemeMapper);
78
+ bind(LocationMapperService).toSelf().inSingletonScope();
79
+
80
+ bind(MiniBrowserService).toDynamicValue(
81
+ ctx => WebSocketConnectionProvider.createProxy(ctx.container, MiniBrowserServicePath)
82
+ ).inSingletonScope();
83
+
84
+ bind(MiniBrowserFrontendSecurityWarnings).toSelf().inSingletonScope();
85
+ bind(FrontendApplicationContribution).toService(MiniBrowserFrontendSecurityWarnings);
86
+ });
@@ -1,59 +1,59 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 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 { MessageService } from '@theia/core';
18
- import { Dialog, FrontendApplicationContribution } from '@theia/core/lib/browser';
19
- import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
20
- import { nls } from '@theia/core/lib/common/nls';
21
- import { WindowService } from '@theia/core/lib/browser/window/window-service';
22
- import { inject, injectable } from '@theia/core/shared/inversify';
23
- import { MiniBrowserEndpoint } from '../common/mini-browser-endpoint';
24
- import { MiniBrowserEnvironment } from './environment/mini-browser-environment';
25
-
26
- @injectable()
27
- export class MiniBrowserFrontendSecurityWarnings implements FrontendApplicationContribution {
28
-
29
- @inject(WindowService)
30
- protected windowService: WindowService;
31
-
32
- @inject(MessageService)
33
- protected messageService: MessageService;
34
-
35
- @inject(MiniBrowserEnvironment)
36
- protected miniBrowserEnvironment: MiniBrowserEnvironment;
37
-
38
- initialize(): void {
39
- this.checkHostPattern();
40
- }
41
-
42
- protected async checkHostPattern(): Promise<void> {
43
- if (FrontendApplicationConfigProvider.get()['warnOnPotentiallyInsecureHostPattern'] === false) {
44
- return;
45
- }
46
- const hostPattern = await this.miniBrowserEnvironment.hostPatternPromise;
47
- if (hostPattern !== MiniBrowserEndpoint.HOST_PATTERN_DEFAULT) {
48
- const goToReadme = nls.localize('theia/webview/goToReadme', 'Go To README');
49
- const message = nls.localize('theia/webview/messageWarning', '\
50
- The {0} endpoint\'s host pattern has been changed to `{1}`; changing the pattern can lead to security vulnerabilities. \
51
- See `{2}` for more information.', 'mini-browser', hostPattern, '@theia/mini-browser/README.md');
52
- this.messageService.warn(message, Dialog.OK, goToReadme).then(action => {
53
- if (action === goToReadme) {
54
- this.windowService.openNewWindow('https://www.npmjs.com/package/@theia/mini-browser', { external: true });
55
- }
56
- });
57
- }
58
- }
59
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 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 { MessageService } from '@theia/core';
18
+ import { Dialog, FrontendApplicationContribution } from '@theia/core/lib/browser';
19
+ import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
20
+ import { nls } from '@theia/core/lib/common/nls';
21
+ import { WindowService } from '@theia/core/lib/browser/window/window-service';
22
+ import { inject, injectable } from '@theia/core/shared/inversify';
23
+ import { MiniBrowserEndpoint } from '../common/mini-browser-endpoint';
24
+ import { MiniBrowserEnvironment } from './environment/mini-browser-environment';
25
+
26
+ @injectable()
27
+ export class MiniBrowserFrontendSecurityWarnings implements FrontendApplicationContribution {
28
+
29
+ @inject(WindowService)
30
+ protected windowService: WindowService;
31
+
32
+ @inject(MessageService)
33
+ protected messageService: MessageService;
34
+
35
+ @inject(MiniBrowserEnvironment)
36
+ protected miniBrowserEnvironment: MiniBrowserEnvironment;
37
+
38
+ initialize(): void {
39
+ this.checkHostPattern();
40
+ }
41
+
42
+ protected async checkHostPattern(): Promise<void> {
43
+ if (FrontendApplicationConfigProvider.get()['warnOnPotentiallyInsecureHostPattern'] === false) {
44
+ return;
45
+ }
46
+ const hostPattern = await this.miniBrowserEnvironment.hostPatternPromise;
47
+ if (hostPattern !== MiniBrowserEndpoint.HOST_PATTERN_DEFAULT) {
48
+ const goToReadme = nls.localize('theia/webview/goToReadme', 'Go To README');
49
+ const message = nls.localize('theia/webview/messageWarning', '\
50
+ The {0} endpoint\'s host pattern has been changed to `{1}`; changing the pattern can lead to security vulnerabilities. \
51
+ See `{2}` for more information.', 'mini-browser', hostPattern, '@theia/mini-browser/README.md');
52
+ this.messageService.warn(message, Dialog.OK, goToReadme).then(action => {
53
+ if (action === goToReadme) {
54
+ this.windowService.openNewWindow('https://www.npmjs.com/package/@theia/mini-browser', { external: true });
55
+ }
56
+ });
57
+ }
58
+ }
59
+ }