File tree Expand file tree Collapse file tree
gen-src/ChromeDevtoolsProtocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121use ChromeDevtoolsProtocol \Domain \DeviceOrientationDomainInterface ;
2222use ChromeDevtoolsProtocol \Domain \EmulationDomainInterface ;
2323use ChromeDevtoolsProtocol \Domain \EventBreakpointsDomainInterface ;
24+ use ChromeDevtoolsProtocol \Domain \FedCmDomainInterface ;
2425use ChromeDevtoolsProtocol \Domain \FetchDomainInterface ;
2526use ChromeDevtoolsProtocol \Domain \HeadlessExperimentalDomainInterface ;
2627use ChromeDevtoolsProtocol \Domain \HeapProfilerDomainInterface ;
@@ -200,6 +201,14 @@ public function emulation(): EmulationDomainInterface;
200201 public function eventBreakpoints (): EventBreakpointsDomainInterface ;
201202
202203
204+ /**
205+ * This domain allows interacting with the FedCM dialog.
206+ *
207+ * @experimental
208+ */
209+ public function fedCm (): FedCmDomainInterface ;
210+
211+
203212 /**
204213 * A domain for letting clients substitute browser's network layer with client code.
205214 */
Original file line number Diff line number Diff line change 4040use ChromeDevtoolsProtocol \Domain \EmulationDomainInterface ;
4141use ChromeDevtoolsProtocol \Domain \EventBreakpointsDomain ;
4242use ChromeDevtoolsProtocol \Domain \EventBreakpointsDomainInterface ;
43+ use ChromeDevtoolsProtocol \Domain \FedCmDomain ;
44+ use ChromeDevtoolsProtocol \Domain \FedCmDomainInterface ;
4345use ChromeDevtoolsProtocol \Domain \FetchDomain ;
4446use ChromeDevtoolsProtocol \Domain \FetchDomainInterface ;
4547use ChromeDevtoolsProtocol \Domain \HeadlessExperimentalDomain ;
@@ -333,6 +335,18 @@ public function eventBreakpoints(): EventBreakpointsDomainInterface
333335 }
334336
335337
338+ public function fedCm (): FedCmDomainInterface
339+ {
340+ if (!isset ($ this ->domains ['FedCm ' ])) {
341+ /** @var InternalClientInterface $this */
342+ $ this ->domains ['FedCm ' ] = new FedCmDomain ($ this );
343+ }
344+ /** @var FedCmDomainInterface $domain */
345+ $ domain = $ this ->domains ['FedCm ' ];
346+ return $ domain ;
347+ }
348+
349+
336350 public function fetch (): FetchDomainInterface
337351 {
338352 if (!isset ($ this ->domains ['Fetch ' ])) {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace ChromeDevtoolsProtocol \Domain ;
4+
5+ use ChromeDevtoolsProtocol \ContextInterface ;
6+ use ChromeDevtoolsProtocol \InternalClientInterface ;
7+ use ChromeDevtoolsProtocol \Model \FedCm \DialogShownEvent ;
8+ use ChromeDevtoolsProtocol \SubscriptionInterface ;
9+
10+ class FedCmDomain implements FedCmDomainInterface
11+ {
12+ /** @var InternalClientInterface */
13+ public $ internalClient ;
14+
15+
16+ public function __construct (InternalClientInterface $ internalClient )
17+ {
18+ $ this ->internalClient = $ internalClient ;
19+ }
20+
21+
22+ public function disable (ContextInterface $ ctx ): void
23+ {
24+ $ request = new \stdClass ();
25+ $ this ->internalClient ->executeCommand ($ ctx , 'FedCm.disable ' , $ request );
26+ }
27+
28+
29+ public function enable (ContextInterface $ ctx ): void
30+ {
31+ $ request = new \stdClass ();
32+ $ this ->internalClient ->executeCommand ($ ctx , 'FedCm.enable ' , $ request );
33+ }
34+
35+
36+ public function addDialogShownListener (callable $ listener ): SubscriptionInterface
37+ {
38+ return $ this ->internalClient ->addListener ('FedCm.dialogShown ' , function ($ event ) use ($ listener ) {
39+ return $ listener (DialogShownEvent::fromJson ($ event ));
40+ });
41+ }
42+
43+
44+ public function awaitDialogShown (ContextInterface $ ctx ): DialogShownEvent
45+ {
46+ return DialogShownEvent::fromJson ($ this ->internalClient ->awaitEvent ($ ctx , 'FedCm.dialogShown ' ));
47+ }
48+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace ChromeDevtoolsProtocol \Domain ;
4+
5+ use ChromeDevtoolsProtocol \ContextInterface ;
6+ use ChromeDevtoolsProtocol \Model \FedCm \DialogShownEvent ;
7+ use ChromeDevtoolsProtocol \SubscriptionInterface ;
8+
9+ /**
10+ * This domain allows interacting with the FedCM dialog.
11+ *
12+ * @experimental
13+ *
14+ * @generated This file has been auto-generated, do not edit.
15+ *
16+ * @author Jakub Kulhan <jakub.kulhan@gmail.com>
17+ */
18+ interface FedCmDomainInterface
19+ {
20+ /**
21+ * Call FedCm.disable command.
22+ *
23+ * @param ContextInterface $ctx
24+ *
25+ * @return void
26+ */
27+ public function disable (ContextInterface $ ctx ): void ;
28+
29+
30+ /**
31+ * Call FedCm.enable command.
32+ *
33+ * @param ContextInterface $ctx
34+ *
35+ * @return void
36+ */
37+ public function enable (ContextInterface $ ctx ): void ;
38+
39+
40+ /**
41+ * Subscribe to FedCm.dialogShown event.
42+ *
43+ * Listener will be called whenever event FedCm.dialogShown is fired.
44+ *
45+ * @param callable $listener
46+ *
47+ * @return SubscriptionInterface
48+ */
49+ public function addDialogShownListener (callable $ listener ): SubscriptionInterface ;
50+
51+
52+ /**
53+ * Wait for FedCm.dialogShown event.
54+ *
55+ * Method will block until first FedCm.dialogShown event is fired.
56+ *
57+ * @param ContextInterface $ctx
58+ *
59+ * @return DialogShownEvent
60+ */
61+ public function awaitDialogShown (ContextInterface $ ctx ): DialogShownEvent ;
62+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace ChromeDevtoolsProtocol \Model \FedCm ;
4+
5+ /**
6+ * Named type FedCm.DialogShownEvent.
7+ *
8+ * @generated This file has been auto-generated, do not edit.
9+ *
10+ * @author Jakub Kulhan <jakub.kulhan@gmail.com>
11+ */
12+ final class DialogShownEvent implements \JsonSerializable
13+ {
14+ /**
15+ * @param object $data
16+ * @return static
17+ */
18+ public static function fromJson ($ data )
19+ {
20+ $ instance = new static ();
21+ return $ instance ;
22+ }
23+
24+
25+ public function jsonSerialize ()
26+ {
27+ $ data = new \stdClass ();
28+ return $ data ;
29+ }
30+ }
Original file line number Diff line number Diff line change 1008110081 ],
1008210082 "events": []
1008310083 },
10084+ {
10085+ "domain": "FedCm",
10086+ "description": "This domain allows interacting with the FedCM dialog.",
10087+ "experimental": true,
10088+ "events": [
10089+ {
10090+ "name": "dialogShown"
10091+ }
10092+ ],
10093+ "commands": [
10094+ {
10095+ "name": "disable"
10096+ },
10097+ {
10098+ "name": "enable"
10099+ }
10100+ ]
10101+ },
1008410102 {
1008510103 "domain": "Fetch",
1008610104 "description": "A domain for letting clients substitute browser's network layer with client code.",
Original file line number Diff line number Diff line change 1- 506e354a921917d07e6468551b699bd1 protocol.json
1+ 02c5e0749aef0b6ad99f6f5d32911f75 protocol.json
You can’t perform that action at this time.
0 commit comments