Flow DiagramEdit this page on GitHub
- Opener/Parent tab(
P
) opens up a new Child tab(C
). C
initiates a handshake with theP
tab by sending apostMessage
.P
acknowledges the request and sendsC
it's identity i.e.UUID
along withP
information.- This sets up a communication channel between Parent and Child tab.
- Now,
P
andC
can share custom messages with each other. - Whenever
C
gets closed/refreshed,P
is notified. - Whenever
P
is closed/refreshed, all children ofP
tab gets notified.
Explanation of diagram
- Parent(
P
) opens CHild tab(C1
) att=1
. c1a
- WhenC1
initiates a handshake with the Parent.P1
- WhenP
receivesC1
message.P2
-P
acknowledges the request and sends theC1
its identity.c1b
- WhenC1
receives acknowledgemnet message along with identity fromP
.
Total Tabs Associated: 1 | Opened Tabs: 1 | Closed Tabs: 0
- Parent(
P
) opens CHild tab(C2
) att=10
. c2a
- WhenC2
initiates a handshake with the Parent.P3
- WhenP
receivesC2
message.P4
-P
acknowledges the request and sends theC2
its identity.c2b
- WhenC2
receives acknowledgemnet message along with identity fromP
.
Total Tabs Associated: 2 | Opened Tabs: 2 | Closed Tabs: 0
c1c
- TabC1
closes.P5
-P
is notified about theC1
. Parent updates the list.
Total Tabs Associated: 2 | Opened Tabs: 1 | Closed Tabs: 1
- Parent(
P
) opens CHild tab(C3
) att=25
. c3a
- WhenC3
initiates a handshake with the Parent.P6
- WhenP
receivesC3
message.c2c
- TabC2
sends acustom
message.P7
- WhenP
receives a message from tabC2
. It processes it.P8
-P
acknowledges the request and sends theC3
its identity.c3b
- WhenC3
receives acknowledgemnet message along with identity fromP
.
Total Tabs Associated: 3 | Opened Tabs: 2 | Closed Tabs: 1
- When Parent Tab
P
is closed, all the opened tabs are notified about it.