chrome-devtools-frontend 1.0.973342 → 1.0.974080

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 (176) hide show
  1. package/config/gni/devtools_grd_files.gni +2 -0
  2. package/config/gni/devtools_image_files.gni +2 -0
  3. package/front_end/Images/src/triangle-collapsed.svg +1 -0
  4. package/front_end/Images/src/triangle-expanded.svg +1 -0
  5. package/front_end/core/common/ParsedURL.ts +9 -9
  6. package/front_end/core/sdk/DOMModel.ts +4 -4
  7. package/front_end/core/sdk/RemoteObject.ts +10 -2
  8. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  9. package/front_end/core/sdk/SourceMap.ts +45 -38
  10. package/front_end/core/sdk/SourceMapManager.ts +2 -2
  11. package/front_end/core/sdk/Target.ts +5 -4
  12. package/front_end/entrypoints/node_app/NodeMain.ts +2 -1
  13. package/front_end/models/bindings/CompilerScriptMapping.ts +3 -2
  14. package/front_end/models/bindings/SASSSourceMapping.ts +1 -1
  15. package/front_end/models/formatter/SourceFormatter.ts +1 -1
  16. package/front_end/models/text_utils/StaticContentProvider.ts +4 -4
  17. package/front_end/models/workspace/UISourceCode.ts +8 -1
  18. package/front_end/panels/application/AppManifestView.ts +10 -4
  19. package/front_end/panels/application/DOMStorageItemsView.ts +2 -1
  20. package/front_end/panels/application/InterestGroupTreeElement.ts +3 -0
  21. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +11 -0
  22. package/front_end/panels/console/ConsolePrompt.ts +8 -0
  23. package/front_end/panels/console/ErrorStackParser.ts +5 -1
  24. package/front_end/panels/elements/StylesSidebarPane.ts +2 -1
  25. package/front_end/panels/network/BinaryResourceView.ts +4 -1
  26. package/front_end/panels/network/RequestTimingView.ts +12 -2
  27. package/front_end/panels/network/ResourceWebSocketFrameView.ts +3 -2
  28. package/front_end/panels/sources/SourcesView.ts +51 -0
  29. package/front_end/third_party/puppeteer/package/README.md +15 -22
  30. package/front_end/third_party/puppeteer/package/cjs-entry-core.js +1 -1
  31. package/front_end/third_party/puppeteer/package/cjs-entry.js +1 -1
  32. package/front_end/third_party/puppeteer/package/install.js +2 -2
  33. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +2 -2
  34. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
  35. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js +46 -13
  36. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js.map +1 -1
  37. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
  38. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +1 -1
  39. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
  40. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +3 -3
  41. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts.map +1 -1
  42. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js +11 -7
  43. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js.map +1 -1
  44. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectionTransport.d.ts +2 -2
  45. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectionTransport.d.ts.map +1 -1
  46. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -1
  47. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js.map +1 -1
  48. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
  49. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +3 -1
  50. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
  51. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
  52. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.js +336 -0
  53. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.js.map +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
  55. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +4 -0
  56. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
  57. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js +2 -1
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js.map +1 -1
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +1 -1
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +9 -0
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +11 -0
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +5 -0
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +7 -0
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js.map +1 -1
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/fetch.js +1 -1
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/fetch.js.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.d.ts +3 -3
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.js +13 -6
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initialize-node.d.ts.map +1 -1
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initialize-node.js +16 -5
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initialize-node.js.map +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +25 -4
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts +5 -4
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js +35 -21
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +5 -5
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts.map +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js +3 -0
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js +12 -6
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +2 -2
  99. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +46 -13
  101. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +3 -3
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +11 -7
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts +2 -2
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +3 -1
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js +336 -0
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +4 -0
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +2 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +9 -0
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +11 -0
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +5 -0
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +7 -0
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js.map +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.js +1 -1
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.js.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts +3 -3
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +13 -6
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +16 -2
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +25 -4
  150. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +5 -4
  152. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +35 -21
  154. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +5 -5
  156. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +3 -0
  158. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +12 -6
  161. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/types.d.ts +32 -18
  164. package/front_end/third_party/puppeteer/package/package.json +36 -35
  165. package/front_end/ui/components/text_editor/config.ts +17 -1
  166. package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -6
  167. package/front_end/ui/components/text_editor/javascript.ts +10 -5
  168. package/front_end/ui/components/text_prompt/TextPrompt.ts +9 -8
  169. package/front_end/ui/components/text_prompt/textPrompt.css +1 -6
  170. package/front_end/ui/legacy/TabbedPane.ts +3 -0
  171. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +17 -3
  172. package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +8 -8
  173. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -1
  174. package/package.json +1 -1
  175. package/scripts/build/assert_third_party_readmes.py +1 -1
  176. package/scripts/build/ninja/README.md +11 -40
@@ -288,7 +288,7 @@ export declare class Browser extends EventEmitter {
288
288
  * const newWindowTarget = await browser.waitForTarget(target => target.url() === 'https://www.example.com/');
289
289
  * ```
290
290
  */
291
- waitForTarget(predicate: (x: Target) => boolean, options?: WaitForTargetOptions): Promise<Target>;
291
+ waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: WaitForTargetOptions): Promise<Target>;
292
292
  /**
293
293
  * An array of all open pages inside the Browser.
294
294
  *
@@ -425,7 +425,7 @@ export declare class BrowserContext extends EventEmitter {
425
425
  * @returns Promise which resolves to the first target found
426
426
  * that matches the `predicate` function.
427
427
  */
428
- waitForTarget(predicate: (x: Target) => boolean, options?: {
428
+ waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: {
429
429
  timeout?: number;
430
430
  }): Promise<Target>;
431
431
  /**
@@ -751,7 +751,7 @@ export declare class CDPSession extends EventEmitter {
751
751
  /**
752
752
  * @internal
753
753
  */
754
- _connection: Connection;
754
+ _connection?: Connection;
755
755
  private _sessionId;
756
756
  private _targetType;
757
757
  private _callbacks;
@@ -759,7 +759,7 @@ export declare class CDPSession extends EventEmitter {
759
759
  * @internal
760
760
  */
761
761
  constructor(connection: Connection, targetType: string, sessionId: string);
762
- connection(): Connection;
762
+ connection(): Connection | undefined;
763
763
  send<T extends keyof ProtocolMapping.Commands>(method: T, ...paramArgs: ProtocolMapping.Commands[T]['paramsType']): Promise<ProtocolMapping.Commands[T]['returnType']>;
764
764
  /**
765
765
  * @internal
@@ -866,7 +866,7 @@ export declare interface CommonEventEmitter {
866
866
  }
867
867
 
868
868
  /**
869
- * Settings that are common to the Puppeteer class, regardless of enviroment.
869
+ * Settings that are common to the Puppeteer class, regardless of environment.
870
870
  * @internal
871
871
  */
872
872
  export declare interface CommonPuppeteerSettings {
@@ -891,7 +891,7 @@ export declare class Connection extends EventEmitter {
891
891
  _closed: boolean;
892
892
  _callbacks: Map<number, ConnectionCallback>;
893
893
  constructor(url: string, transport: ConnectionTransport, delay?: number);
894
- static fromSession(session: CDPSession): Connection;
894
+ static fromSession(session: CDPSession): Connection | undefined;
895
895
  /**
896
896
  * @param sessionId - The session id
897
897
  * @returns The current CDP session if it exists
@@ -948,8 +948,8 @@ export declare const ConnectionEmittedEvents: {
948
948
  * @public
949
949
  */
950
950
  export declare interface ConnectionTransport {
951
- send(string: any): any;
952
- close(): any;
951
+ send(message: string): void;
952
+ close(): void;
953
953
  onmessage?: (message: string) => void;
954
954
  onclose?: () => void;
955
955
  }
@@ -1952,7 +1952,7 @@ export declare class ExecutionContext {
1952
1952
  *
1953
1953
  * @returns A promise that resolves to the return value of the given function.
1954
1954
  */
1955
- evaluate<ReturnType extends any>(pageFunction: Function | string, ...args: unknown[]): Promise<ReturnType>;
1955
+ evaluate<ReturnType>(pageFunction: Function | string, ...args: unknown[]): Promise<ReturnType>;
1956
1956
  /**
1957
1957
  * @remarks
1958
1958
  * The only difference between `executionContext.evaluate` and
@@ -2171,6 +2171,11 @@ export declare class Frame {
2171
2171
  * @internal
2172
2172
  */
2173
2173
  _updateClient(client: CDPSession): void;
2174
+ /**
2175
+ * @remarks
2176
+ *
2177
+ * @returns `true` if the frame is an OOP frame, or `false` otherwise.
2178
+ */
2174
2179
  isOOPFrame(): boolean;
2175
2180
  /**
2176
2181
  * @remarks
@@ -2240,6 +2245,10 @@ export declare class Frame {
2240
2245
  timeout?: number;
2241
2246
  waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
2242
2247
  }): Promise<HTTPResponse | null>;
2248
+ /**
2249
+ * @internal
2250
+ */
2251
+ client(): CDPSession;
2243
2252
  /**
2244
2253
  * @returns a promise that resolves to the frame's default execution context.
2245
2254
  */
@@ -3142,6 +3151,7 @@ export declare class HTTPResponse {
3142
3151
  private _fromServiceWorker;
3143
3152
  private _headers;
3144
3153
  private _securityDetails;
3154
+ private _timing;
3145
3155
  /**
3146
3156
  * @internal
3147
3157
  */
@@ -3186,6 +3196,10 @@ export declare class HTTPResponse {
3186
3196
  * secure connection, or `null` otherwise.
3187
3197
  */
3188
3198
  securityDetails(): SecurityDetails | null;
3199
+ /**
3200
+ * @returns Timing information related to the response.
3201
+ */
3202
+ timing(): Protocol.Network.ResourceTiming | null;
3189
3203
  /**
3190
3204
  * @returns Promise which resolves to a buffer with response body.
3191
3205
  */
@@ -6232,9 +6246,9 @@ export declare class HTTPResponse {
6232
6246
  * @public
6233
6247
  */
6234
6248
  export declare interface ProductLauncher {
6235
- launch(object: PuppeteerNodeLaunchOptions): any;
6236
- executablePath: (string?: any) => string;
6237
- defaultArgs(object: BrowserLaunchArgumentOptions): any;
6249
+ launch(object: PuppeteerNodeLaunchOptions): Promise<Browser>;
6250
+ executablePath: (path?: any) => string;
6251
+ defaultArgs(object: BrowserLaunchArgumentOptions): string[];
6238
6252
  product: Product;
6239
6253
  }
6240
6254
 
@@ -6436,8 +6450,8 @@ export declare class HTTPResponse {
6436
6450
  * @public
6437
6451
  */
6438
6452
  export declare class PuppeteerNode extends Puppeteer {
6439
- private _lazyLauncher;
6440
- private _projectRoot;
6453
+ private _lazyLauncher?;
6454
+ private _projectRoot?;
6441
6455
  private __productName?;
6442
6456
  /**
6443
6457
  * @internal
@@ -6447,7 +6461,7 @@ export declare class HTTPResponse {
6447
6461
  * @internal
6448
6462
  */
6449
6463
  constructor(settings: {
6450
- projectRoot: string;
6464
+ projectRoot?: string;
6451
6465
  preferredRevision: string;
6452
6466
  productName?: Product;
6453
6467
  } & CommonPuppeteerSettings);
@@ -6463,8 +6477,8 @@ export declare class HTTPResponse {
6463
6477
  /**
6464
6478
  * @internal
6465
6479
  */
6466
- get _productName(): Product;
6467
- set _productName(name: Product);
6480
+ get _productName(): Product | undefined;
6481
+ set _productName(name: Product | undefined);
6468
6482
  /**
6469
6483
  * Launches puppeteer and launches a browser instance with given arguments
6470
6484
  * and options when specified.
@@ -7211,7 +7225,7 @@ export declare class HTTPResponse {
7211
7225
  * @param args - Arguments to pass to `pageFunction`.
7212
7226
  * @returns Promise which resolves to the return value of `pageFunction`.
7213
7227
  */
7214
- evaluate<ReturnType extends any>(pageFunction: Function | string, ...args: any[]): Promise<ReturnType>;
7228
+ evaluate<ReturnType>(pageFunction: Function | string, ...args: any[]): Promise<ReturnType>;
7215
7229
  /**
7216
7230
  * The only difference between `worker.evaluate` and `worker.evaluateHandle`
7217
7231
  * is that `worker.evaluateHandle` returns in-page object (JSHandle). If the
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puppeteer",
3
- "version": "13.1.1",
3
+ "version": "13.4.0",
4
4
  "description": "A high-level API to control headless Chrome over the DevTools Protocol",
5
5
  "main": "./cjs-entry.js",
6
6
  "types": "lib/types.d.ts",
@@ -24,9 +24,9 @@
24
24
  "eslint": "([ \"$CI\" = true ] && eslint --ext js --ext ts --quiet -f codeframe . || eslint --ext js --ext ts .)",
25
25
  "eslint-fix": "eslint --ext js --ext ts --fix .",
26
26
  "commitlint": "commitlint --from=HEAD~1",
27
- "markdownlint": "prettier --check **/README.md docs/troubleshooting.md",
28
- "markdownlint-fix": "prettier --write **/README.md docs/troubleshooting.md",
29
- "lint": "npm run eslint && npm run build && npm run doc && npm run commitlint && npm run markdownlint",
27
+ "prettier": "prettier --check .",
28
+ "prettier-fix": "prettier --write .",
29
+ "lint": "npm run eslint && npm run build && npm run doc && npm run prettier",
30
30
  "doc": "node utils/doclint/cli.js",
31
31
  "clean-lib": "rimraf lib",
32
32
  "build": "npm run tsc && npm run generate-d-ts",
@@ -58,60 +58,61 @@
58
58
  "author": "The Chromium Authors",
59
59
  "license": "Apache-2.0",
60
60
  "dependencies": {
61
- "debug": "4.3.2",
62
- "devtools-protocol": "0.0.948846",
61
+ "cross-fetch": "3.1.5",
62
+ "debug": "4.3.3",
63
+ "devtools-protocol": "0.0.960912",
63
64
  "extract-zip": "2.0.1",
64
65
  "https-proxy-agent": "5.0.0",
65
- "node-fetch": "2.6.5",
66
66
  "pkg-dir": "4.2.0",
67
67
  "progress": "2.0.3",
68
68
  "proxy-from-env": "1.1.0",
69
69
  "rimraf": "3.0.2",
70
70
  "tar-fs": "2.1.1",
71
71
  "unbzip2-stream": "1.4.3",
72
- "ws": "8.2.3"
72
+ "ws": "8.5.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@commitlint/cli": "13.2.0",
76
- "@commitlint/config-conventional": "13.2.0",
77
- "@microsoft/api-documenter": "7.13.65",
78
- "@microsoft/api-extractor": "7.18.15",
75
+ "@commitlint/cli": "16.2.1",
76
+ "@commitlint/config-conventional": "16.2.1",
77
+ "@microsoft/api-documenter": "7.15.3",
78
+ "@microsoft/api-extractor": "7.19.4",
79
79
  "@types/debug": "4.1.7",
80
80
  "@types/mime": "2.0.3",
81
- "@types/mocha": "9.0.0",
82
- "@types/node": "16.10.9",
81
+ "@types/mocha": "9.1.0",
82
+ "@types/node": "17.0.19",
83
+ "@types/progress": "2.0.5",
83
84
  "@types/proxy-from-env": "1.0.1",
84
85
  "@types/rimraf": "3.0.2",
85
- "@types/sinon": "10.0.4",
86
+ "@types/sinon": "10.0.11",
86
87
  "@types/tar-fs": "2.0.1",
87
- "@types/ws": "8.2.0",
88
- "@typescript-eslint/eslint-plugin": "4.23.0",
89
- "@typescript-eslint/parser": "4.33.0",
90
- "@web/test-runner": "0.13.18",
91
- "commonmark": "0.29.3",
88
+ "@types/ws": "8.2.3",
89
+ "@typescript-eslint/eslint-plugin": "5.12.1",
90
+ "@typescript-eslint/parser": "5.12.1",
91
+ "@web/test-runner": "0.13.27",
92
+ "commonmark": "0.30.0",
92
93
  "cross-env": "7.0.3",
93
- "eslint": "7.32.0",
94
- "eslint-config-prettier": "8.3.0",
95
- "eslint-plugin-import": "2.22.1",
96
- "eslint-plugin-mocha": "9.0.0",
94
+ "eslint": "8.9.0",
95
+ "eslint-config-prettier": "8.4.0",
96
+ "eslint-plugin-import": "2.25.4",
97
+ "eslint-plugin-mocha": "10.0.3",
97
98
  "eslint-plugin-prettier": "4.0.0",
98
- "eslint-plugin-unicorn": "37.0.1",
99
+ "eslint-plugin-unicorn": "41.0.0",
99
100
  "esprima": "4.0.1",
100
101
  "expect": "25.2.7",
101
- "husky": "7.0.2",
102
- "jpeg-js": "0.3.7",
103
- "mime": "2.5.2",
104
- "minimist": "1.2.0",
105
- "mocha": "9.1.3",
102
+ "husky": "7.0.4",
103
+ "jpeg-js": "0.4.3",
104
+ "mime": "3.0.0",
105
+ "minimist": "1.2.5",
106
+ "mocha": "9.2.1",
106
107
  "ncp": "2.0.0",
107
108
  "pixelmatch": "5.2.1",
108
109
  "pngjs": "6.0.0",
109
- "prettier": "2.3.0",
110
- "sinon": "9.2.4",
111
- "source-map-support": "0.5.19",
110
+ "prettier": "2.5.1",
111
+ "sinon": "13.0.1",
112
+ "source-map-support": "0.5.21",
112
113
  "standard-version": "9.3.2",
113
114
  "text-diff": "1.0.1",
114
- "ts-node": "10.4.0",
115
- "typescript": "4.4.4"
115
+ "ts-node": "10.5.0",
116
+ "typescript": "4.5.5"
116
117
  }
117
118
  }
@@ -7,6 +7,7 @@ import * as i18n from '../../../core/i18n/i18n.js';
7
7
  import * as WindowBoundsService from '../../../services/window_bounds/window_bounds.js';
8
8
  import * as CM from '../../../third_party/codemirror.next/codemirror.next.js';
9
9
  import * as CodeHighlighter from '../code_highlighter/code_highlighter.js';
10
+ import * as Icon from '../icon_button/icon_button.js';
10
11
 
11
12
  import {editorTheme} from './theme.js';
12
13
 
@@ -82,7 +83,22 @@ export const sourcesAutocompletion = DynamicSetting.bool('textEditorAutocompleti
82
83
 
83
84
  export const bracketMatching = DynamicSetting.bool('textEditorBracketMatching', CM.bracketMatching());
84
85
 
85
- export const codeFolding = DynamicSetting.bool('textEditorCodeFolding', [CM.foldGutter(), CM.keymap.of(CM.foldKeymap)]);
86
+ export const codeFolding = DynamicSetting.bool('textEditorCodeFolding', [
87
+ CM.foldGutter({
88
+ markerDOM(open: boolean): HTMLElement {
89
+ const iconName = open ? 'triangle-expanded' : 'triangle-collapsed';
90
+ const icon = new Icon.Icon.Icon();
91
+ icon.data = {
92
+ iconName,
93
+ color: 'var(--color-text-secondary)',
94
+ width: '12px',
95
+ height: '12px',
96
+ };
97
+ return icon;
98
+ },
99
+ }),
100
+ CM.keymap.of(CM.foldKeymap),
101
+ ]);
86
102
 
87
103
  export function guessIndent(doc: CM.Text): string {
88
104
  const values: {[indent: string]: number} = Object.create(null);
@@ -4,11 +4,12 @@
4
4
 
5
5
  import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
6
6
 
7
+ export const closeTooltip = CodeMirror.StateEffect.define<null>();
8
+
7
9
  export function cursorTooltip(
8
10
  source: (state: CodeMirror.EditorState, pos: number) => Promise<(() => CodeMirror.TooltipView)|null>,
9
11
  ): CodeMirror.Extension {
10
12
  const openTooltip = CodeMirror.StateEffect.define<() => CodeMirror.TooltipView>();
11
- const closeTooltip = CodeMirror.StateEffect.define<null>();
12
13
 
13
14
  const state = CodeMirror.StateField.define<null|CodeMirror.Tooltip>({
14
15
  create() {
@@ -41,18 +42,18 @@ export function cursorTooltip(
41
42
  update(update: CodeMirror.ViewUpdate): void {
42
43
  this.updateID++;
43
44
  if (update.transactions.some(tr => tr.selection) && update.state.selection.main.empty) {
44
- this.scheduleUpdate(update.view);
45
+ this.#scheduleUpdate(update.view);
45
46
  }
46
47
  }
47
48
 
48
- scheduleUpdate(view: CodeMirror.EditorView): void {
49
+ #scheduleUpdate(view: CodeMirror.EditorView): void {
49
50
  if (this.pending > -1) {
50
51
  clearTimeout(this.pending);
51
52
  }
52
- this.pending = window.setTimeout(() => this.startUpdate(view), 50) as unknown as number;
53
+ this.pending = window.setTimeout(() => this.#startUpdate(view), 50) as unknown as number;
53
54
  }
54
55
 
55
- startUpdate(view: CodeMirror.EditorView): void {
56
+ #startUpdate(view: CodeMirror.EditorView): void {
56
57
  this.pending = -1;
57
58
  const {main} = view.state.selection;
58
59
  if (main.empty) {
@@ -60,7 +61,7 @@ export function cursorTooltip(
60
61
  void source(view.state, main.from).then(tooltip => {
61
62
  if (this.updateID !== updateID) {
62
63
  if (this.pending < 0) {
63
- this.scheduleUpdate(view);
64
+ this.#scheduleUpdate(view);
64
65
  }
65
66
  } else if (tooltip) {
66
67
  view.dispatch({effects: openTooltip.of(tooltip)});
@@ -7,7 +7,8 @@ import * as Formatter from '../../../models/formatter/formatter.js';
7
7
  import * as JavaScriptMetaData from '../../../models/javascript_metadata/javascript_metadata.js';
8
8
  import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
9
9
  import * as UI from '../../legacy/legacy.js';
10
- import {cursorTooltip} from './cursor_tooltip.js';
10
+
11
+ import {closeTooltip, cursorTooltip} from './cursor_tooltip.js';
11
12
 
12
13
  export function completion(): CodeMirror.Extension {
13
14
  return CodeMirror.javascript.javascriptLanguage.data.of({
@@ -225,6 +226,7 @@ async function evaluateExpression(
225
226
 
226
227
  const primitivePrototypes = new Map<string, string>([
227
228
  ['string', 'String'],
229
+ ['symbol', 'Symbol'],
228
230
  ['number', 'Number'],
229
231
  ['boolean', 'Boolean'],
230
232
  ['bigint', 'BigInt'],
@@ -319,9 +321,7 @@ async function completePropertiesInner(
319
321
  object = innerObject as SDK.RemoteObject.RemoteObject;
320
322
  }
321
323
 
322
- const toPrototype = object.subtype === 'array' ?
323
- 'Array' :
324
- object.subtype === 'typedarray' ? 'Uint8Array' : primitivePrototypes.get(object.type);
324
+ const toPrototype = primitivePrototypes.get(object.type);
325
325
  if (toPrototype) {
326
326
  object = await evaluateExpression(context, toPrototype + '.prototype', 'completion');
327
327
  }
@@ -329,7 +329,8 @@ async function completePropertiesInner(
329
329
  const functionType = expression === 'globalThis' ? 'function' : 'method';
330
330
  const otherType = expression === 'globalThis' ? 'variable' : 'property';
331
331
  if (object && (object.type === 'object' || object.type === 'function')) {
332
- const properties = await object.getAllProperties(false, false);
332
+ const properties = await object.getAllProperties(
333
+ /* accessorPropertiesOnly */ false, /* generatePreview */ false, /* nonIndexedPropertiesOnly */ true);
333
334
  const isFunction = object.type === 'function';
334
335
  for (const prop of properties.properties || []) {
335
336
  if (!prop.symbol && !(isFunction && (prop.name === 'arguments' || prop.name === 'caller')) &&
@@ -424,6 +425,10 @@ export function argumentHints(): CodeMirror.Extension {
424
425
  return cursorTooltip(getArgumentHints);
425
426
  }
426
427
 
428
+ export function closeArgumentsHintsTooltip(view: CodeMirror.EditorView): void {
429
+ view.dispatch({effects: closeTooltip.of(null)});
430
+ }
431
+
427
432
  async function getArgumentHints(
428
433
  state: CodeMirror.EditorState, pos: number): Promise<(() => CodeMirror.TooltipView)|null> {
429
434
  const node = CodeMirror.syntaxTree(state).resolveInner(pos).enterUnfinishedNodesBefore(pos);
@@ -55,7 +55,7 @@ export class TextPrompt extends HTMLElement {
55
55
  }
56
56
 
57
57
  #input(): HTMLInputElement {
58
- const inputElement = this.#shadow.querySelector<HTMLInputElement>('input');
58
+ const inputElement = this.#shadow.querySelector<HTMLInputElement>('.input');
59
59
  if (!inputElement) {
60
60
  throw new Error('Expected an input element!');
61
61
  }
@@ -67,7 +67,7 @@ export class TextPrompt extends HTMLElement {
67
67
  }
68
68
 
69
69
  onInput(): void {
70
- this.#suggestion().textContent = this.#text();
70
+ this.#suggestion().value = this.#text();
71
71
  this.dispatchEvent(new PromptInputEvent(this.#text().trim()));
72
72
  }
73
73
 
@@ -98,12 +98,13 @@ export class TextPrompt extends HTMLElement {
98
98
 
99
99
  setSuggestion(suggestion: string): void {
100
100
  this.#suggestionText = suggestion;
101
+ this.#suggestion().value += this.#suggestionText;
101
102
  this.#render();
102
103
  }
103
104
 
104
105
  setText(text: string): void {
105
106
  this.#input().value = text;
106
- this.#suggestion().textContent = this.#text();
107
+ this.#suggestion().value = this.#text();
107
108
 
108
109
  if (this.#input().hasFocus()) {
109
110
  this.moveCaretToEndOfInput();
@@ -111,8 +112,8 @@ export class TextPrompt extends HTMLElement {
111
112
  }
112
113
  }
113
114
 
114
- #suggestion(): HTMLSpanElement {
115
- const suggestionElement = this.#shadow.querySelector<HTMLSpanElement>('.suggestion');
115
+ #suggestion(): HTMLInputElement {
116
+ const suggestionElement = this.#shadow.querySelector<HTMLInputElement>('.suggestion');
116
117
  if (!suggestionElement) {
117
118
  throw new Error('Expected an suggestion element!');
118
119
  }
@@ -126,9 +127,9 @@ export class TextPrompt extends HTMLElement {
126
127
  #render(): void {
127
128
  const output = LitHtml.html`
128
129
  <span class="prefix">${this.#prefixText} </span>
129
- <span class="text-prompt-input"><input aria-label=${this.#ariaLabelText} spellcheck="false" @input=${
130
- this.onInput} @keydown=${this.onKeyDown}/><span class='suggestion' suggestion=${
131
- this.#suggestionText}></span></span>`;
130
+ <span class="text-prompt-input"><input class="input" aria-label=${
131
+ this.#ariaLabelText} spellcheck="false" @input=${this.onInput} @keydown=${
132
+ this.onKeyDown}/><input class="suggestion" aria-label=${this.#ariaLabelText + ' Suggestion'}></span>`;
132
133
  LitHtml.render(output, this.#shadow, {host: this});
133
134
  }
134
135
  }
@@ -32,13 +32,8 @@
32
32
  }
33
33
 
34
34
  .text-prompt-input .suggestion {
35
- color: transparent;
35
+ color: var(--color-background-highlight);
36
36
  position: absolute;
37
37
  left: 0;
38
38
  z-index: 1;
39
39
  }
40
-
41
- .text-prompt-input .suggestion::after {
42
- content: attr(suggestion);
43
- color: var(--color-background-highlight);
44
- }
@@ -1019,6 +1019,9 @@ export class TabbedPaneTab {
1019
1019
  this.titleInternal = title;
1020
1020
  if (this.titleElement) {
1021
1021
  this.titleElement.textContent = title;
1022
+ const closeIconContainer = this.tabElementInternal?.querySelector('.close-button');
1023
+ closeIconContainer?.setAttribute('title', i18nString(UIStrings.closeS, {PH1: title}));
1024
+ closeIconContainer?.setAttribute('aria-label', i18nString(UIStrings.closeS, {PH1: title}));
1022
1025
  }
1023
1026
  delete this.measuredWidth;
1024
1027
  }
@@ -1018,9 +1018,23 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
1018
1018
  this.property.value, this.property.wasThrown, showPreview, this.listItemElement, this.linkifier);
1019
1019
  this.valueElement = (this.propertyValue.element as HTMLElement);
1020
1020
  } else if (this.property.getter) {
1021
- this.valueElement = ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(
1022
- (parentMap.get(this.property) as SDK.RemoteObject.RemoteObject), [this.property.name],
1023
- this.onInvokeGetterClick.bind(this));
1021
+ this.valueElement = document.createElement('span');
1022
+ const element = this.valueElement.createChild('span');
1023
+ element.textContent = i18nString(UIStrings.dots);
1024
+ element.classList.add('object-value-calculate-value-button');
1025
+ UI.Tooltip.Tooltip.install(element, i18nString(UIStrings.invokePropertyGetter));
1026
+ const object = parentMap.get(this.property) as SDK.RemoteObject.RemoteObject;
1027
+ const getter = this.property.getter;
1028
+ element.addEventListener('click', (event: Event) => {
1029
+ event.consume();
1030
+ // @ts-ignore No way to teach TypeScript to preserve the Function-ness of `getter`.
1031
+ void object.callFunction(invokeGetter, [SDK.RemoteObject.RemoteObject.toCallArgument(getter)])
1032
+ .then(this.onInvokeGetterClick.bind(this));
1033
+
1034
+ function invokeGetter(this: Object, getter: Function): Object {
1035
+ return Reflect.apply(getter, this, []);
1036
+ }
1037
+ }, false);
1024
1038
  } else {
1025
1039
  this.valueElement = document.createElement('span');
1026
1040
  this.valueElement.classList.add('object-value-undefined');
@@ -8,16 +8,16 @@ import * as TextUtils from '../../../../models/text_utils/text_utils.js';
8
8
 
9
9
  import {ResourceSourceFrame} from './ResourceSourceFrame.js';
10
10
 
11
- // TODO(crbug.com/1253323): Casts to UrlString will be removed from this file when migration to branded types is complete.
12
-
13
11
  export class BinaryResourceViewFactory {
14
12
  private base64content: string;
15
- private readonly contentUrl: string;
13
+ private readonly contentUrl: Platform.DevToolsPath.UrlString;
16
14
  private readonly resourceType: Common.ResourceType.ResourceType;
17
15
  private arrayPromise: Promise<Uint8Array>|null;
18
16
  private hexPromise: Promise<TextUtils.ContentProvider.DeferredContent>|null;
19
17
  private utf8Promise: Promise<TextUtils.ContentProvider.DeferredContent>|null;
20
- constructor(base64content: string, contentUrl: string, resourceType: Common.ResourceType.ResourceType) {
18
+ constructor(
19
+ base64content: string, contentUrl: Platform.DevToolsPath.UrlString,
20
+ resourceType: Common.ResourceType.ResourceType) {
21
21
  this.base64content = base64content;
22
22
  this.contentUrl = contentUrl;
23
23
  this.resourceType = resourceType;
@@ -70,8 +70,8 @@ export class BinaryResourceViewFactory {
70
70
  }
71
71
 
72
72
  createHexView(): ResourceSourceFrame {
73
- const hexViewerContentProvider = new TextUtils.StaticContentProvider.StaticContentProvider(
74
- this.contentUrl as Platform.DevToolsPath.UrlString, this.resourceType, async () => {
73
+ const hexViewerContentProvider =
74
+ new TextUtils.StaticContentProvider.StaticContentProvider(this.contentUrl, this.resourceType, async () => {
75
75
  const contentAsArray = await this.fetchContentAsArray();
76
76
  const content = BinaryResourceViewFactory.uint8ArrayToHexViewer(contentAsArray);
77
77
  return {content, isEncoded: false};
@@ -82,8 +82,8 @@ export class BinaryResourceViewFactory {
82
82
 
83
83
  createUtf8View(): ResourceSourceFrame {
84
84
  const utf8fn = this.utf8.bind(this);
85
- const utf8ContentProvider = new TextUtils.StaticContentProvider.StaticContentProvider(
86
- this.contentUrl as Platform.DevToolsPath.UrlString, this.resourceType, utf8fn);
85
+ const utf8ContentProvider =
86
+ new TextUtils.StaticContentProvider.StaticContentProvider(this.contentUrl, this.resourceType, utf8fn);
87
87
  return new ResourceSourceFrame(
88
88
  utf8ContentProvider, this.resourceType.canonicalMimeType(), {lineNumbers: true, lineWrapping: true});
89
89
  }
@@ -211,7 +211,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
211
211
  TextEditor.Config.sourcesAutocompletion.instance(),
212
212
  TextEditor.Config.showWhitespace.instance(),
213
213
  TextEditor.Config.allowScrollPastEof.instance(),
214
- TextEditor.Config.codeFolding.instance(),
214
+ CodeMirror.Prec.lowest(TextEditor.Config.codeFolding.instance()),
215
215
  TextEditor.Config.autoDetectIndent.instance(),
216
216
  sourceFrameTheme,
217
217
  CodeMirror.EditorView.domEventHandlers({
package/package.json CHANGED
@@ -54,5 +54,5 @@
54
54
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
55
55
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
56
56
  },
57
- "version": "1.0.973342"
57
+ "version": "1.0.974080"
58
58
  }
@@ -54,7 +54,7 @@ def main(argv):
54
54
  print(
55
55
  "Directory `" + listed_directory + "`" +
56
56
  " is not included in `config/gni/devtools_grd_files.gni`." +
57
- " Make sure to only include third_party directoires that are shipped"
57
+ " Make sure to only include third_party directories that are shipped"
58
58
  + " in Chromium.\n")
59
59
 
60
60
  return_code = 1
@@ -3,6 +3,17 @@
3
3
  The DevTools build system contains several templates to integrate files in the build system.
4
4
  Below you can find an overview of which template/combination of templates you need to use and when.
5
5
 
6
+ ## General guidance
7
+
8
+ Whenever you are implementing a template, take into account that GN expects the source folder structure to be [mirrored](https://chromium.googlesource.com/chromium/src/+/HEAD/build/docs/writing_gn_templates.md#where-to-place-outputs) in the out-directory.
9
+ Historically, DevTools used the location-agnostic [`out/Default/resources/inspector`](https://groups.google.com/a/chromium.org/g/devtools-dev/c/BENZ8ZTW0Ls/m/W7BhAvOzBAAJ) folder, but we have since adopted the GN guidelines for mirroring our source folder.
10
+ Primary motivations are the instability of the separate folder, as well as required hacks to compute "relative" sub-folders in GN.
11
+ Since GN has no notion of a "root" folder for DevTools, computation of sub-folders can only be done based on heuristics, which will fail sooner rather than later.
12
+
13
+ Additionally, GN is a [timestamp-based build system](https://gn.googlesource.com/gn/+/master/docs/reference.md#target-declarations-action_declare-a-target-that-runs-a-script-a-single-time-outputs) when checking for correctness.
14
+ This means that you want to avoid writing to the file system if the content stays the same.
15
+ For Node scripts, use the `writeIfChanged` function from [write-if-changed.js](./write-if-changed.js) to integrate nicely with GN.
16
+
6
17
  ## Entrypoints and modules
7
18
 
8
19
  The buildsystem has a concept of "entrypoints" and "modules".
@@ -57,46 +68,6 @@ devtools_entrypoint("bundle") {
57
68
 
58
69
  > Rule: `devtools_entrypoints` is named "bundle", as in a release build it bundles with Rollup
59
70
 
60
- ### Legacy: Non-TypeScript entrypoints
61
-
62
- Not all modules are currently typechecked only by TypeScript.
63
- There are two other options, related to the legacy Closure Compiler.
64
-
65
- #### Typescriptified modules (e.g. TypeScript + Closure Compiler)
66
-
67
- Any module that is fully typescriptified (e.g. a JavaScript file that is typechecked by both TypeScript and Compiler Compiler) can be imported from both TypeScript modules and Closure Compile-checked modules.
68
-
69
- > Rule: Any typescriptified module can never contain an entrypoint or source file in their implementation that is TypeScript-authored. In practice this rule comes down to: you can only have a TypeScript-authored implementation file if the corresponding entrypoint is also TypeScript-authored.
70
-
71
- As such, the following layout is used for TypeScriptified modules:
72
-
73
- ```python
74
- import("../../scripts/build/ninja/devtools_entrypoint.gni")
75
- import("../../scripts/build/ninja/devtools_module.gni")
76
-
77
- devtools_module("my_module") {
78
- sources = [
79
- "implementation_detail.js",
80
- "some_other_file.js",
81
- ]
82
-
83
- deps = [
84
- "../other_dependency:bundle",
85
- ]
86
- }
87
-
88
- devtools_entrypoint("bundle") {
89
- entrypoint = "my_module.js"
90
-
91
- deps = [
92
- ":my_module",
93
- ]
94
- }
95
- ```
96
-
97
- Here, both the entrypoint and the sources of the module are all JavaScript files.
98
- All of these files are typechecked by Closure Compiler and TypeScript.
99
-
100
71
  ## GRD file generation
101
72
 
102
73
  To make sure that files are loaded in Chromium, DevTools generates a GRD file that includes all files that are allowed to be loaded by the backend.