Events.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * Copyright 2019 Google Inc. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. const Events = {
  17. Page: {
  18. Close: 'close',
  19. Console: 'console',
  20. Dialog: 'dialog',
  21. DOMContentLoaded: 'domcontentloaded',
  22. Error: 'error',
  23. // Can't use just 'error' due to node.js special treatment of error events.
  24. // @see https://nodejs.org/api/events.html#events_error_events
  25. PageError: 'pageerror',
  26. Request: 'request',
  27. Response: 'response',
  28. RequestFailed: 'requestfailed',
  29. RequestFinished: 'requestfinished',
  30. FrameAttached: 'frameattached',
  31. FrameDetached: 'framedetached',
  32. FrameNavigated: 'framenavigated',
  33. Load: 'load',
  34. Metrics: 'metrics',
  35. Popup: 'popup',
  36. WorkerCreated: 'workercreated',
  37. WorkerDestroyed: 'workerdestroyed',
  38. },
  39. Browser: {
  40. TargetCreated: 'targetcreated',
  41. TargetDestroyed: 'targetdestroyed',
  42. TargetChanged: 'targetchanged',
  43. Disconnected: 'disconnected'
  44. },
  45. BrowserContext: {
  46. TargetCreated: 'targetcreated',
  47. TargetDestroyed: 'targetdestroyed',
  48. TargetChanged: 'targetchanged',
  49. },
  50. NetworkManager: {
  51. Request: Symbol('Events.NetworkManager.Request'),
  52. Response: Symbol('Events.NetworkManager.Response'),
  53. RequestFailed: Symbol('Events.NetworkManager.RequestFailed'),
  54. RequestFinished: Symbol('Events.NetworkManager.RequestFinished'),
  55. },
  56. FrameManager: {
  57. FrameAttached: Symbol('Events.FrameManager.FrameAttached'),
  58. FrameNavigated: Symbol('Events.FrameManager.FrameNavigated'),
  59. FrameDetached: Symbol('Events.FrameManager.FrameDetached'),
  60. LifecycleEvent: Symbol('Events.FrameManager.LifecycleEvent'),
  61. FrameNavigatedWithinDocument: Symbol('Events.FrameManager.FrameNavigatedWithinDocument'),
  62. ExecutionContextCreated: Symbol('Events.FrameManager.ExecutionContextCreated'),
  63. ExecutionContextDestroyed: Symbol('Events.FrameManager.ExecutionContextDestroyed'),
  64. },
  65. Connection: {
  66. Disconnected: Symbol('Events.Connection.Disconnected'),
  67. },
  68. CDPSession: {
  69. Disconnected: Symbol('Events.CDPSession.Disconnected'),
  70. },
  71. };
  72. module.exports = { Events };