Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit d4be79d

Browse files
committed
Remove emitting of lifecycle events
These internal lifecycle events aren't being listened to by any handler. Let's remove it for now and add it back in when there is a need for them.
1 parent ed761ce commit d4be79d

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

common/event_emitter.go

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,23 @@ const (
2929

3030
// Page
3131

32-
EventPageClose string = "close"
33-
EventPageConsole string = "console"
34-
EventPageCrash string = "crash"
35-
EventPageDialog string = "dialog"
36-
EventPageDOMContentLoaded string = "domcontentloaded"
37-
EventPageDownload string = "download"
38-
EventPageFilechooser string = "filechooser"
39-
EventPageFrameAttached string = "frameattached"
40-
EventPageFrameDetached string = "framedetached"
41-
EventPageFrameNavigated string = "framenavigated"
42-
EventPageLoad string = "load"
43-
EventPageError string = "pageerror"
44-
EventPagePopup string = "popup"
45-
EventPageRequest string = "request"
46-
EventPageRequestFailed string = "requestfailed"
47-
EventPageRequestFinished string = "requestfinished"
48-
EventPageResponse string = "response"
49-
EventPageWebSocket string = "websocket"
50-
EventPageWorker string = "worker"
32+
EventPageClose string = "close"
33+
EventPageConsole string = "console"
34+
EventPageCrash string = "crash"
35+
EventPageDialog string = "dialog"
36+
EventPageDownload string = "download"
37+
EventPageFilechooser string = "filechooser"
38+
EventPageFrameAttached string = "frameattached"
39+
EventPageFrameDetached string = "framedetached"
40+
EventPageFrameNavigated string = "framenavigated"
41+
EventPageError string = "pageerror"
42+
EventPagePopup string = "popup"
43+
EventPageRequest string = "request"
44+
EventPageRequestFailed string = "requestfailed"
45+
EventPageRequestFinished string = "requestfinished"
46+
EventPageResponse string = "response"
47+
EventPageWebSocket string = "websocket"
48+
EventPageWorker string = "worker"
5149

5250
// Session
5351

common/frame.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,11 @@ func (f *Frame) recalculateLifecycle() {
219219
f.childFramesMu.RUnlock()
220220

221221
// Check if any of the fired events should be considered fired when looking at the entire subtree.
222-
mainFrame := f.manager.MainFrame()
223222
for k := range events {
224223
if f.hasSubtreeLifecycleEventFired(k) {
225224
continue
226225
}
227226
f.emit(EventFrameAddLifecycle, k)
228-
229-
if f != mainFrame {
230-
continue
231-
}
232-
switch k {
233-
case LifecycleEventLoad:
234-
f.page.emit(EventPageLoad, nil)
235-
case LifecycleEventDOMContentLoad:
236-
f.page.emit(EventPageDOMContentLoaded, nil)
237-
}
238227
}
239228

240229
f.lifecycleEventsMu.Lock()

0 commit comments

Comments
 (0)