@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,178 +1,178 @@
1
- import { Message } from '@theia/core/shared/@phosphor/messaging';
2
- import { ILogger } from '@theia/core/lib/common/logger';
3
- import { Emitter } from '@theia/core/lib/common/event';
4
- import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
5
- import { WindowService } from '@theia/core/lib/browser/window/window-service';
6
- import { DisposableCollection } from '@theia/core/lib/common/disposable';
7
- import { BaseWidget } from '@theia/core/lib/browser/widgets/widget';
8
- import { LocationMapperService } from './location-mapper-service';
9
- import { ApplicationShellMouseTracker } from '@theia/core/lib/browser/shell/application-shell-mouse-tracker';
10
- import { FileService } from '@theia/filesystem/lib/browser/file-service';
11
- /**
12
- * Initializer properties for the embedded browser widget.
13
- */
14
- export declare class MiniBrowserProps {
15
- /**
16
- * `show` if the toolbar should be visible. If `read-only`, the toolbar is visible but the address cannot be changed and it acts as a link instead.\
17
- * `hide` if the toolbar should be hidden. `show` by default. If the `startPage` is not defined, this property is always `show`.
18
- */
19
- readonly toolbar?: 'show' | 'hide' | 'read-only';
20
- /**
21
- * If defined, the browser will load this page on startup. Otherwise, it show a blank page.
22
- */
23
- readonly startPage?: string;
24
- /**
25
- * Sandbox options for the underlying `iframe`. Defaults to `SandboxOptions#DEFAULT` if not provided.
26
- */
27
- readonly sandbox?: MiniBrowserProps.SandboxOptions[];
28
- /**
29
- * The optional icon class for the widget.
30
- */
31
- readonly iconClass?: string;
32
- /**
33
- * The desired name of the widget.
34
- */
35
- readonly name?: string;
36
- /**
37
- * `true` if the `iFrame`'s background has to be reset to the default white color. Otherwise, `false`. `false` is the default.
38
- */
39
- readonly resetBackground?: boolean;
40
- }
41
- export declare namespace MiniBrowserProps {
42
- /**
43
- * Enumeration of the supported `sandbox` options for the `iframe`.
44
- */
45
- enum SandboxOptions {
46
- /**
47
- * Allows form submissions.
48
- */
49
- 'allow-forms' = 0,
50
- /**
51
- * Allows popups, such as `window.open()`, `showModalDialog()`, `target=”_blank”`, etc.
52
- */
53
- 'allow-popups' = 1,
54
- /**
55
- * Allows pointer lock.
56
- */
57
- 'allow-pointer-lock' = 2,
58
- /**
59
- * Allows the document to maintain its origin. Pages loaded from https://example.com/ will retain access to that origin’s data.
60
- */
61
- 'allow-same-origin' = 3,
62
- /**
63
- * Allows JavaScript execution. Also allows features to trigger automatically (as they’d be trivial to implement via JavaScript).
64
- */
65
- 'allow-scripts' = 4,
66
- /**
67
- * Allows the document to break out of the frame by navigating the top-level `window`.
68
- */
69
- 'allow-top-navigation' = 5,
70
- /**
71
- * Allows the embedded browsing context to open modal windows.
72
- */
73
- 'allow-modals' = 6,
74
- /**
75
- * Allows the embedded browsing context to disable the ability to lock the screen orientation.
76
- */
77
- 'allow-orientation-lock' = 7,
78
- /**
79
- * Allows a sandboxed document to open new windows without forcing the sandboxing flags upon them.
80
- * This will allow, for example, a third-party advertisement to be safely sandboxed without forcing the same restrictions upon a landing page.
81
- */
82
- 'allow-popups-to-escape-sandbox' = 8,
83
- /**
84
- * Allows embedders to have control over whether an iframe can start a presentation session.
85
- */
86
- 'allow-presentation' = 9,
87
- /**
88
- * Allows the embedded browsing context to navigate (load) content to the top-level browsing context only when initiated by a user gesture.
89
- * If this keyword is not used, this operation is not allowed.
90
- */
91
- 'allow-top-navigation-by-user-activation' = 10
92
- }
93
- namespace SandboxOptions {
94
- /**
95
- * The default `sandbox` options, if other is not provided.
96
- *
97
- * See: https://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
98
- */
99
- const DEFAULT: SandboxOptions[];
100
- }
101
- }
102
- export declare const MiniBrowserContentFactory: unique symbol;
103
- export declare type MiniBrowserContentFactory = (props: MiniBrowserProps) => MiniBrowserContent;
104
- export declare class MiniBrowserContent extends BaseWidget {
105
- protected readonly props: MiniBrowserProps;
106
- protected readonly logger: ILogger;
107
- protected readonly windowService: WindowService;
108
- protected readonly locationMapper: LocationMapperService;
109
- protected readonly keybindings: KeybindingRegistry;
110
- protected readonly mouseTracker: ApplicationShellMouseTracker;
111
- protected readonly fileService: FileService;
112
- protected readonly submitInputEmitter: Emitter<string>;
113
- protected readonly navigateBackEmitter: Emitter<void>;
114
- protected readonly navigateForwardEmitter: Emitter<void>;
115
- protected readonly refreshEmitter: Emitter<void>;
116
- protected readonly openEmitter: Emitter<void>;
117
- protected readonly input: HTMLInputElement;
118
- protected readonly loadIndicator: HTMLElement;
119
- protected readonly errorBar: HTMLElement & Readonly<{
120
- message: HTMLElement;
121
- }>;
122
- protected readonly frame: HTMLIFrameElement;
123
- protected readonly transparentOverlay: HTMLElement;
124
- protected readonly pdfContainer: HTMLElement;
125
- protected frameLoadTimeout: number;
126
- protected readonly initialHistoryLength: number;
127
- protected readonly toDisposeOnGo: DisposableCollection;
128
- constructor(props: MiniBrowserProps);
129
- protected init(): void;
130
- protected onActivateRequest(msg: Message): void;
131
- protected listenOnContentChange(location: string): Promise<void>;
132
- protected createToolbar(parent: HTMLElement): HTMLDivElement & Readonly<{
133
- input: HTMLInputElement;
134
- }>;
135
- protected getToolbarProps(): 'show' | 'hide' | 'read-only';
136
- protected createContentArea(parent: HTMLElement): HTMLElement & Readonly<{
137
- frame: HTMLIFrameElement;
138
- loadIndicator: HTMLElement;
139
- errorBar: HTMLElement & Readonly<{
140
- message: HTMLElement;
141
- }>;
142
- pdfContainer: HTMLElement;
143
- transparentOverlay: HTMLElement;
144
- }>;
145
- protected createIFrame(): HTMLIFrameElement;
146
- protected createErrorBar(): HTMLElement & Readonly<{
147
- message: HTMLElement;
148
- }>;
149
- protected onFrameLoad(): void;
150
- protected onFrameError(): void;
151
- protected onFrameTimeout(): void;
152
- protected showLoadIndicator(): void;
153
- protected hideLoadIndicator(): void;
154
- protected showErrorBar(message: string): void;
155
- protected hideErrorBar(): void;
156
- protected maybeResetBackground(): void;
157
- protected handleBack(): void;
158
- protected handleForward(): void;
159
- protected handleRefresh(): void;
160
- protected handleOpen(): void;
161
- protected createInput(parent: HTMLElement): HTMLInputElement;
162
- protected handleInputChange(e: KeyboardEvent): void;
163
- protected createPrevious(parent: HTMLElement): HTMLElement;
164
- protected createNext(parent: HTMLElement): HTMLElement;
165
- protected createRefresh(parent: HTMLElement): HTMLElement;
166
- protected createOpen(parent: HTMLElement): HTMLElement;
167
- protected createButton(parent: HTMLElement, title: string, ...className: string[]): HTMLElement;
168
- protected onClick(element: HTMLElement, emitter: Emitter<any>): HTMLElement;
169
- protected mapLocation(location: string): Promise<string>;
170
- protected setInput(value: string): void;
171
- protected frameSrc(): string;
172
- protected contentDocument(): Document | null;
173
- protected go(location: string, options?: Partial<{
174
- showLoadIndicator: boolean;
175
- preserveFocus: boolean;
176
- }>): Promise<void>;
177
- }
1
+ import { Message } from '@theia/core/shared/@phosphor/messaging';
2
+ import { ILogger } from '@theia/core/lib/common/logger';
3
+ import { Emitter } from '@theia/core/lib/common/event';
4
+ import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
5
+ import { WindowService } from '@theia/core/lib/browser/window/window-service';
6
+ import { DisposableCollection } from '@theia/core/lib/common/disposable';
7
+ import { BaseWidget } from '@theia/core/lib/browser/widgets/widget';
8
+ import { LocationMapperService } from './location-mapper-service';
9
+ import { ApplicationShellMouseTracker } from '@theia/core/lib/browser/shell/application-shell-mouse-tracker';
10
+ import { FileService } from '@theia/filesystem/lib/browser/file-service';
11
+ /**
12
+ * Initializer properties for the embedded browser widget.
13
+ */
14
+ export declare class MiniBrowserProps {
15
+ /**
16
+ * `show` if the toolbar should be visible. If `read-only`, the toolbar is visible but the address cannot be changed and it acts as a link instead.\
17
+ * `hide` if the toolbar should be hidden. `show` by default. If the `startPage` is not defined, this property is always `show`.
18
+ */
19
+ readonly toolbar?: 'show' | 'hide' | 'read-only';
20
+ /**
21
+ * If defined, the browser will load this page on startup. Otherwise, it show a blank page.
22
+ */
23
+ readonly startPage?: string;
24
+ /**
25
+ * Sandbox options for the underlying `iframe`. Defaults to `SandboxOptions#DEFAULT` if not provided.
26
+ */
27
+ readonly sandbox?: MiniBrowserProps.SandboxOptions[];
28
+ /**
29
+ * The optional icon class for the widget.
30
+ */
31
+ readonly iconClass?: string;
32
+ /**
33
+ * The desired name of the widget.
34
+ */
35
+ readonly name?: string;
36
+ /**
37
+ * `true` if the `iFrame`'s background has to be reset to the default white color. Otherwise, `false`. `false` is the default.
38
+ */
39
+ readonly resetBackground?: boolean;
40
+ }
41
+ export declare namespace MiniBrowserProps {
42
+ /**
43
+ * Enumeration of the supported `sandbox` options for the `iframe`.
44
+ */
45
+ enum SandboxOptions {
46
+ /**
47
+ * Allows form submissions.
48
+ */
49
+ 'allow-forms' = 0,
50
+ /**
51
+ * Allows popups, such as `window.open()`, `showModalDialog()`, `target=”_blank”`, etc.
52
+ */
53
+ 'allow-popups' = 1,
54
+ /**
55
+ * Allows pointer lock.
56
+ */
57
+ 'allow-pointer-lock' = 2,
58
+ /**
59
+ * Allows the document to maintain its origin. Pages loaded from https://example.com/ will retain access to that origin’s data.
60
+ */
61
+ 'allow-same-origin' = 3,
62
+ /**
63
+ * Allows JavaScript execution. Also allows features to trigger automatically (as they’d be trivial to implement via JavaScript).
64
+ */
65
+ 'allow-scripts' = 4,
66
+ /**
67
+ * Allows the document to break out of the frame by navigating the top-level `window`.
68
+ */
69
+ 'allow-top-navigation' = 5,
70
+ /**
71
+ * Allows the embedded browsing context to open modal windows.
72
+ */
73
+ 'allow-modals' = 6,
74
+ /**
75
+ * Allows the embedded browsing context to disable the ability to lock the screen orientation.
76
+ */
77
+ 'allow-orientation-lock' = 7,
78
+ /**
79
+ * Allows a sandboxed document to open new windows without forcing the sandboxing flags upon them.
80
+ * This will allow, for example, a third-party advertisement to be safely sandboxed without forcing the same restrictions upon a landing page.
81
+ */
82
+ 'allow-popups-to-escape-sandbox' = 8,
83
+ /**
84
+ * Allows embedders to have control over whether an iframe can start a presentation session.
85
+ */
86
+ 'allow-presentation' = 9,
87
+ /**
88
+ * Allows the embedded browsing context to navigate (load) content to the top-level browsing context only when initiated by a user gesture.
89
+ * If this keyword is not used, this operation is not allowed.
90
+ */
91
+ 'allow-top-navigation-by-user-activation' = 10
92
+ }
93
+ namespace SandboxOptions {
94
+ /**
95
+ * The default `sandbox` options, if other is not provided.
96
+ *
97
+ * See: https://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
98
+ */
99
+ const DEFAULT: SandboxOptions[];
100
+ }
101
+ }
102
+ export declare const MiniBrowserContentFactory: unique symbol;
103
+ export declare type MiniBrowserContentFactory = (props: MiniBrowserProps) => MiniBrowserContent;
104
+ export declare class MiniBrowserContent extends BaseWidget {
105
+ protected readonly props: MiniBrowserProps;
106
+ protected readonly logger: ILogger;
107
+ protected readonly windowService: WindowService;
108
+ protected readonly locationMapper: LocationMapperService;
109
+ protected readonly keybindings: KeybindingRegistry;
110
+ protected readonly mouseTracker: ApplicationShellMouseTracker;
111
+ protected readonly fileService: FileService;
112
+ protected readonly submitInputEmitter: Emitter<string>;
113
+ protected readonly navigateBackEmitter: Emitter<void>;
114
+ protected readonly navigateForwardEmitter: Emitter<void>;
115
+ protected readonly refreshEmitter: Emitter<void>;
116
+ protected readonly openEmitter: Emitter<void>;
117
+ protected readonly input: HTMLInputElement;
118
+ protected readonly loadIndicator: HTMLElement;
119
+ protected readonly errorBar: HTMLElement & Readonly<{
120
+ message: HTMLElement;
121
+ }>;
122
+ protected readonly frame: HTMLIFrameElement;
123
+ protected readonly transparentOverlay: HTMLElement;
124
+ protected readonly pdfContainer: HTMLElement;
125
+ protected frameLoadTimeout: number;
126
+ protected readonly initialHistoryLength: number;
127
+ protected readonly toDisposeOnGo: DisposableCollection;
128
+ constructor(props: MiniBrowserProps);
129
+ protected init(): void;
130
+ protected onActivateRequest(msg: Message): void;
131
+ protected listenOnContentChange(location: string): Promise<void>;
132
+ protected createToolbar(parent: HTMLElement): HTMLDivElement & Readonly<{
133
+ input: HTMLInputElement;
134
+ }>;
135
+ protected getToolbarProps(): 'show' | 'hide' | 'read-only';
136
+ protected createContentArea(parent: HTMLElement): HTMLElement & Readonly<{
137
+ frame: HTMLIFrameElement;
138
+ loadIndicator: HTMLElement;
139
+ errorBar: HTMLElement & Readonly<{
140
+ message: HTMLElement;
141
+ }>;
142
+ pdfContainer: HTMLElement;
143
+ transparentOverlay: HTMLElement;
144
+ }>;
145
+ protected createIFrame(): HTMLIFrameElement;
146
+ protected createErrorBar(): HTMLElement & Readonly<{
147
+ message: HTMLElement;
148
+ }>;
149
+ protected onFrameLoad(): void;
150
+ protected onFrameError(): void;
151
+ protected onFrameTimeout(): void;
152
+ protected showLoadIndicator(): void;
153
+ protected hideLoadIndicator(): void;
154
+ protected showErrorBar(message: string): void;
155
+ protected hideErrorBar(): void;
156
+ protected maybeResetBackground(): void;
157
+ protected handleBack(): void;
158
+ protected handleForward(): void;
159
+ protected handleRefresh(): void;
160
+ protected handleOpen(): void;
161
+ protected createInput(parent: HTMLElement): HTMLInputElement;
162
+ protected handleInputChange(e: KeyboardEvent): void;
163
+ protected createPrevious(parent: HTMLElement): HTMLElement;
164
+ protected createNext(parent: HTMLElement): HTMLElement;
165
+ protected createRefresh(parent: HTMLElement): HTMLElement;
166
+ protected createOpen(parent: HTMLElement): HTMLElement;
167
+ protected createButton(parent: HTMLElement, title: string, ...className: string[]): HTMLElement;
168
+ protected onClick(element: HTMLElement, emitter: Emitter<any>): HTMLElement;
169
+ protected mapLocation(location: string): Promise<string>;
170
+ protected setInput(value: string): void;
171
+ protected frameSrc(): string;
172
+ protected contentDocument(): Document | null;
173
+ protected go(location: string, options?: Partial<{
174
+ showLoadIndicator: boolean;
175
+ preserveFocus: boolean;
176
+ }>): Promise<void>;
177
+ }
178
178
  //# sourceMappingURL=mini-browser-content.d.ts.map