Here are sample capxs to show how to recognize the main frame.
Daughter, mother
Daughter (child frame) will be embedded into mother (main frame), how to recognize the main frame from child frame?
A possible solution is using frame message plugin -
In daughter capx,
1. call function "Mom?"
2. wait 0.1 second
3. check the global variable "FindMyMom"
And this capx has a return handler of "Mom?" which sets global variable "FindMyMom".
In mother capx, it has a function body "Mom?" which return a value to daughter.
If the daughter frame is not embedded in mother frame, the return handler of "Mom?" will not be triggered, so global variable "FindMyMom" will not be set.