Using an AppleScript command such as set var to the front window does not necessarily set var to the current front window. It's normally something like the first or last window that was opened, not the one that's in front right now.
Which application are you talking about - mozilla or PPEmbed?
It's Mozilla, at least I think it is. I'm not sure what PPEmbed is.
Then it's not an Embedding:Mac bug. Changing the component and giving to sfraser since I think we wrote the AE handling code for moz.
*** This bug has been marked as a duplicate of 119091 ***