Skip to content

Commit f9cfcf0

Browse files
committed
Update protocol to latest version
1 parent 9e1364f commit f9cfcf0

File tree

127 files changed

+7165
-670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+7165
-670
lines changed

browser_protocol.json

Lines changed: 1423 additions & 208 deletions
Large diffs are not rendered by default.

cdt-java-client/src/main/java/com/github/kklisura/cdt/protocol/commands/Audits.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
* #L%
2121
*/
2222

23+
import com.github.kklisura.cdt.protocol.events.audits.IssueAdded;
24+
import com.github.kklisura.cdt.protocol.support.annotations.EventName;
2325
import com.github.kklisura.cdt.protocol.support.annotations.Experimental;
2426
import com.github.kklisura.cdt.protocol.support.annotations.Optional;
2527
import com.github.kklisura.cdt.protocol.support.annotations.ParamName;
28+
import com.github.kklisura.cdt.protocol.support.types.EventHandler;
29+
import com.github.kklisura.cdt.protocol.support.types.EventListener;
2630
import com.github.kklisura.cdt.protocol.types.audits.EncodedResponse;
2731
import com.github.kklisura.cdt.protocol.types.audits.GetEncodedResponseEncoding;
2832

@@ -55,4 +59,16 @@ EncodedResponse getEncodedResponse(
5559
@ParamName("encoding") GetEncodedResponseEncoding encoding,
5660
@Optional @ParamName("quality") Double quality,
5761
@Optional @ParamName("sizeOnly") Boolean sizeOnly);
62+
63+
/** Disables issues domain, prevents further issues from being reported to the client. */
64+
void disable();
65+
66+
/**
67+
* Enables issues domain, sends the issues collected so far to the client by means of the
68+
* `issueAdded` event.
69+
*/
70+
void enable();
71+
72+
@EventName("issueAdded")
73+
EventListener onIssueAdded(EventHandler<IssueAdded> eventListener);
5874
}

cdt-java-client/src/main/java/com/github/kklisura/cdt/protocol/commands/Browser.java

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.github.kklisura.cdt.protocol.types.browser.PermissionDescriptor;
3131
import com.github.kklisura.cdt.protocol.types.browser.PermissionSetting;
3232
import com.github.kklisura.cdt.protocol.types.browser.PermissionType;
33+
import com.github.kklisura.cdt.protocol.types.browser.SetDownloadBehaviorBehavior;
3334
import com.github.kklisura.cdt.protocol.types.browser.Version;
3435
import com.github.kklisura.cdt.protocol.types.browser.WindowForTarget;
3536
import java.util.List;
@@ -40,54 +41,49 @@ public interface Browser {
4041
/**
4142
* Set permission settings for given origin.
4243
*
43-
* @param origin Origin the permission applies to.
4444
* @param permission Descriptor of permission to override.
4545
* @param setting Setting of the permission.
4646
*/
4747
@Experimental
4848
void setPermission(
49-
@ParamName("origin") String origin,
5049
@ParamName("permission") PermissionDescriptor permission,
5150
@ParamName("setting") PermissionSetting setting);
5251

5352
/**
5453
* Set permission settings for given origin.
5554
*
56-
* @param origin Origin the permission applies to.
5755
* @param permission Descriptor of permission to override.
5856
* @param setting Setting of the permission.
57+
* @param origin Origin the permission applies to, all origins if not specified.
5958
* @param browserContextId Context to override. When omitted, default browser context is used.
6059
*/
6160
@Experimental
6261
void setPermission(
63-
@ParamName("origin") String origin,
6462
@ParamName("permission") PermissionDescriptor permission,
6563
@ParamName("setting") PermissionSetting setting,
64+
@Optional @ParamName("origin") String origin,
6665
@Optional @ParamName("browserContextId") String browserContextId);
6766

6867
/**
6968
* Grant specific permissions to the given origin and reject all others.
7069
*
71-
* @param origin
7270
* @param permissions
7371
*/
7472
@Experimental
75-
void grantPermissions(
76-
@ParamName("origin") String origin,
77-
@ParamName("permissions") List<PermissionType> permissions);
73+
void grantPermissions(@ParamName("permissions") List<PermissionType> permissions);
7874

7975
/**
8076
* Grant specific permissions to the given origin and reject all others.
8177
*
82-
* @param origin
8378
* @param permissions
79+
* @param origin Origin the permission applies to, all origins if not specified.
8480
* @param browserContextId BrowserContext to override permissions. When omitted, default browser
8581
* context is used.
8682
*/
8783
@Experimental
8884
void grantPermissions(
89-
@ParamName("origin") String origin,
9085
@ParamName("permissions") List<PermissionType> permissions,
86+
@Optional @ParamName("origin") String origin,
9187
@Optional @ParamName("browserContextId") String browserContextId);
9288

9389
/** Reset all permission management for all origins. */
@@ -103,6 +99,33 @@ void grantPermissions(
10399
@Experimental
104100
void resetPermissions(@Optional @ParamName("browserContextId") String browserContextId);
105101

102+
/**
103+
* Set the behavior when downloading a file.
104+
*
105+
* @param behavior Whether to allow all or deny all download requests, or use default Chrome
106+
* behavior if available (otherwise deny). |allowAndName| allows download and names files
107+
* according to their dowmload guids.
108+
*/
109+
@Experimental
110+
void setDownloadBehavior(@ParamName("behavior") SetDownloadBehaviorBehavior behavior);
111+
112+
/**
113+
* Set the behavior when downloading a file.
114+
*
115+
* @param behavior Whether to allow all or deny all download requests, or use default Chrome
116+
* behavior if available (otherwise deny). |allowAndName| allows download and names files
117+
* according to their dowmload guids.
118+
* @param browserContextId BrowserContext to set download behavior. When omitted, default browser
119+
* context is used.
120+
* @param downloadPath The default path to save downloaded files to. This is requred if behavior
121+
* is set to 'allow' or 'allowAndName'.
122+
*/
123+
@Experimental
124+
void setDownloadBehavior(
125+
@ParamName("behavior") SetDownloadBehaviorBehavior behavior,
126+
@Optional @ParamName("browserContextId") String browserContextId,
127+
@Optional @ParamName("downloadPath") String downloadPath);
128+
106129
/** Close browser gracefully. */
107130
void close();
108131

cdt-java-client/src/main/java/com/github/kklisura/cdt/protocol/commands/CSS.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import com.github.kklisura.cdt.protocol.types.css.SelectorList;
4545
import com.github.kklisura.cdt.protocol.types.css.SourceRange;
4646
import com.github.kklisura.cdt.protocol.types.css.StyleDeclarationEdit;
47+
import com.github.kklisura.cdt.protocol.types.css.TakeCoverageDelta;
4748
import com.github.kklisura.cdt.protocol.types.css.Value;
4849
import java.util.List;
4950

@@ -245,9 +246,7 @@ String setStyleSheetText(
245246
* Obtain list of rules that became used since last call to this method (or since start of
246247
* coverage instrumentation)
247248
*/
248-
@Returns("coverage")
249-
@ReturnTypeParameter(RuleUsage.class)
250-
List<RuleUsage> takeCoverageDelta();
249+
TakeCoverageDelta takeCoverageDelta();
251250

252251
/**
253252
* Fires whenever a web font is updated. A non-empty font parameter indicates a successfully

cdt-java-client/src/main/java/com/github/kklisura/cdt/protocol/commands/CacheStorage.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,8 @@ CachedResponse requestCachedResponse(
7575
* Requests data from cache.
7676
*
7777
* @param cacheId ID of cache to get entries from.
78-
* @param skipCount Number of records to skip.
79-
* @param pageSize Number of records to fetch.
8078
*/
81-
RequestEntries requestEntries(
82-
@ParamName("cacheId") String cacheId,
83-
@ParamName("skipCount") Integer skipCount,
84-
@ParamName("pageSize") Integer pageSize);
79+
RequestEntries requestEntries(@ParamName("cacheId") String cacheId);
8580

8681
/**
8782
* Requests data from cache.
@@ -93,7 +88,7 @@ RequestEntries requestEntries(
9388
*/
9489
RequestEntries requestEntries(
9590
@ParamName("cacheId") String cacheId,
96-
@ParamName("skipCount") Integer skipCount,
97-
@ParamName("pageSize") Integer pageSize,
91+
@Optional @ParamName("skipCount") Integer skipCount,
92+
@Optional @ParamName("pageSize") Integer pageSize,
9893
@Optional @ParamName("pathFilter") String pathFilter);
9994
}

cdt-java-client/src/main/java/com/github/kklisura/cdt/protocol/commands/DOM.java

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.github.kklisura.cdt.protocol.types.dom.Node;
4848
import com.github.kklisura.cdt.protocol.types.dom.NodeForLocation;
4949
import com.github.kklisura.cdt.protocol.types.dom.PerformSearch;
50+
import com.github.kklisura.cdt.protocol.types.dom.Rect;
5051
import com.github.kklisura.cdt.protocol.types.runtime.RemoteObject;
5152
import com.github.kklisura.cdt.protocol.types.runtime.StackTrace;
5253
import java.util.List;
@@ -129,6 +130,30 @@ Node describeNode(
129130
@Optional @ParamName("depth") Integer depth,
130131
@Optional @ParamName("pierce") Boolean pierce);
131132

133+
/**
134+
* Scrolls the specified rect of the given node into view if not already visible. Note: exactly
135+
* one between nodeId, backendNodeId and objectId should be passed to identify the node.
136+
*/
137+
@Experimental
138+
void scrollIntoViewIfNeeded();
139+
140+
/**
141+
* Scrolls the specified rect of the given node into view if not already visible. Note: exactly
142+
* one between nodeId, backendNodeId and objectId should be passed to identify the node.
143+
*
144+
* @param nodeId Identifier of the node.
145+
* @param backendNodeId Identifier of the backend node.
146+
* @param objectId JavaScript object id of the node wrapper.
147+
* @param rect The rect to be scrolled into view, relative to the node's border box, in CSS
148+
* pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
149+
*/
150+
@Experimental
151+
void scrollIntoViewIfNeeded(
152+
@Optional @ParamName("nodeId") Integer nodeId,
153+
@Optional @ParamName("backendNodeId") Integer backendNodeId,
154+
@Optional @ParamName("objectId") String objectId,
155+
@Optional @ParamName("rect") Rect rect);
156+
132157
/** Disables DOM agent for the given page. */
133158
void disable();
134159

@@ -251,7 +276,6 @@ List<Node> getFlattenedDocument(
251276
* @param x X coordinate.
252277
* @param y Y coordinate.
253278
*/
254-
@Experimental
255279
NodeForLocation getNodeForLocation(@ParamName("x") Integer x, @ParamName("y") Integer y);
256280

257281
/**
@@ -262,12 +286,14 @@ List<Node> getFlattenedDocument(
262286
* @param y Y coordinate.
263287
* @param includeUserAgentShadowDOM False to skip to the nearest non-UA shadow root ancestor
264288
* (default: false).
289+
* @param ignorePointerEventsNone Whether to ignore pointer-events: none on elements and hit test
290+
* them.
265291
*/
266-
@Experimental
267292
NodeForLocation getNodeForLocation(
268293
@ParamName("x") Integer x,
269294
@ParamName("y") Integer y,
270-
@Optional @ParamName("includeUserAgentShadowDOM") Boolean includeUserAgentShadowDOM);
295+
@Optional @ParamName("includeUserAgentShadowDOM") Boolean includeUserAgentShadowDOM,
296+
@Optional @ParamName("ignorePointerEventsNone") Boolean ignorePointerEventsNone);
271297

272298
/** Returns node's HTML markup. */
273299
@Returns("outerHTML")

cdt-java-client/src/main/java/com/github/kklisura/cdt/protocol/commands/Debugger.java

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
import com.github.kklisura.cdt.protocol.types.debugger.BreakLocation;
3737
import com.github.kklisura.cdt.protocol.types.debugger.ContinueToLocationTargetCallFrames;
3838
import com.github.kklisura.cdt.protocol.types.debugger.EvaluateOnCallFrame;
39+
import com.github.kklisura.cdt.protocol.types.debugger.ExecuteWasmEvaluator;
3940
import com.github.kklisura.cdt.protocol.types.debugger.Location;
4041
import com.github.kklisura.cdt.protocol.types.debugger.RestartFrame;
4142
import com.github.kklisura.cdt.protocol.types.debugger.ScriptPosition;
43+
import com.github.kklisura.cdt.protocol.types.debugger.ScriptSource;
4244
import com.github.kklisura.cdt.protocol.types.debugger.SearchMatch;
4345
import com.github.kklisura.cdt.protocol.types.debugger.SetBreakpoint;
4446
import com.github.kklisura.cdt.protocol.types.debugger.SetBreakpointByUrl;
@@ -132,6 +134,29 @@ EvaluateOnCallFrame evaluateOnCallFrame(
132134
@Optional @ParamName("throwOnSideEffect") Boolean throwOnSideEffect,
133135
@Experimental @Optional @ParamName("timeout") Double timeout);
134136

137+
/**
138+
* Execute a Wasm Evaluator module on a given call frame.
139+
*
140+
* @param callFrameId WebAssembly call frame identifier to evaluate on.
141+
* @param evaluator Code of the evaluator module.
142+
*/
143+
@Experimental
144+
ExecuteWasmEvaluator executeWasmEvaluator(
145+
@ParamName("callFrameId") String callFrameId, @ParamName("evaluator") String evaluator);
146+
147+
/**
148+
* Execute a Wasm Evaluator module on a given call frame.
149+
*
150+
* @param callFrameId WebAssembly call frame identifier to evaluate on.
151+
* @param evaluator Code of the evaluator module.
152+
* @param timeout Terminate execution after timing out (number of milliseconds).
153+
*/
154+
@Experimental
155+
ExecuteWasmEvaluator executeWasmEvaluator(
156+
@ParamName("callFrameId") String callFrameId,
157+
@ParamName("evaluator") String evaluator,
158+
@Experimental @Optional @ParamName("timeout") Double timeout);
159+
135160
/**
136161
* Returns possible locations for breakpoint. scriptId in start and end range locations should be
137162
* the same.
@@ -164,8 +189,16 @@ List<BreakLocation> getPossibleBreakpoints(
164189
*
165190
* @param scriptId Id of the script to get source for.
166191
*/
167-
@Returns("scriptSource")
168-
String getScriptSource(@ParamName("scriptId") String scriptId);
192+
ScriptSource getScriptSource(@ParamName("scriptId") String scriptId);
193+
194+
/**
195+
* This command is deprecated. Use getScriptSource instead.
196+
*
197+
* @param scriptId Id of the Wasm script to get source for.
198+
*/
199+
@Deprecated
200+
@Returns("bytecode")
201+
String getWasmBytecode(@ParamName("scriptId") String scriptId);
169202

170203
/**
171204
* Returns stack trace with given `stackTraceId`.
@@ -183,6 +216,7 @@ List<BreakLocation> getPossibleBreakpoints(
183216
* @param parentStackTraceId Debugger will pause when async call with given stack trace is
184217
* started.
185218
*/
219+
@Deprecated
186220
@Experimental
187221
void pauseOnAsyncCall(@ParamName("parentStackTraceId") StackTraceId parentStackTraceId);
188222

@@ -203,6 +237,17 @@ List<BreakLocation> getPossibleBreakpoints(
203237
/** Resumes JavaScript execution. */
204238
void resume();
205239

240+
/**
241+
* Resumes JavaScript execution.
242+
*
243+
* @param terminateOnResume Set to true to terminate execution upon resuming execution. In
244+
* contrast to Runtime.terminateExecution, this will allows to execute further JavaScript
245+
* (i.e. via evaluation) until execution of the paused code is actually resumed, at which
246+
* point termination is triggered. If execution is currently not paused, this parameter has no
247+
* effect.
248+
*/
249+
void resume(@Optional @ParamName("terminateOnResume") Boolean terminateOnResume);
250+
206251
/**
207252
* Searches for given string in script content.
208253
*
@@ -418,8 +463,8 @@ void setVariableValue(
418463
/**
419464
* Steps into the function call.
420465
*
421-
* @param breakOnAsyncCall Debugger will issue additional Debugger.paused notification if any
422-
* async task is scheduled before next pause.
466+
* @param breakOnAsyncCall Debugger will pause on the execution of the first async task which was
467+
* scheduled before next pause.
423468
*/
424469
void stepInto(@Experimental @Optional @ParamName("breakOnAsyncCall") Boolean breakOnAsyncCall);
425470

0 commit comments

Comments
 (0)