1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type Protocol from 'devtools-protocol';
|
8 |
|
9 | import type {EventType} from '../common/EventEmitter.js';
|
10 |
|
11 | import type {CdpFrame} from './Frame.js';
|
12 | import type {IsolatedWorld} from './IsolatedWorld.js';
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export namespace FrameManagerEvent {
|
22 | export const FrameAttached = Symbol('FrameManager.FrameAttached');
|
23 | export const FrameNavigated = Symbol('FrameManager.FrameNavigated');
|
24 | export const FrameDetached = Symbol('FrameManager.FrameDetached');
|
25 | export const FrameSwapped = Symbol('FrameManager.FrameSwapped');
|
26 | export const LifecycleEvent = Symbol('FrameManager.LifecycleEvent');
|
27 | export const FrameNavigatedWithinDocument = Symbol(
|
28 | 'FrameManager.FrameNavigatedWithinDocument',
|
29 | );
|
30 | export const ConsoleApiCalled = Symbol('FrameManager.ConsoleApiCalled');
|
31 | export const BindingCalled = Symbol('FrameManager.BindingCalled');
|
32 | }
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export interface FrameManagerEvents extends Record<EventType, unknown> {
|
38 | [FrameManagerEvent.FrameAttached]: CdpFrame;
|
39 | [FrameManagerEvent.FrameNavigated]: CdpFrame;
|
40 | [FrameManagerEvent.FrameDetached]: CdpFrame;
|
41 | [FrameManagerEvent.FrameSwapped]: CdpFrame;
|
42 | [FrameManagerEvent.LifecycleEvent]: CdpFrame;
|
43 | [FrameManagerEvent.FrameNavigatedWithinDocument]: CdpFrame;
|
44 |
|
45 | [FrameManagerEvent.ConsoleApiCalled]: [
|
46 | IsolatedWorld,
|
47 | Protocol.Runtime.ConsoleAPICalledEvent,
|
48 | ];
|
49 | [FrameManagerEvent.BindingCalled]: [
|
50 | IsolatedWorld,
|
51 | Protocol.Runtime.BindingCalledEvent,
|
52 | ];
|
53 | }
|