How to run my plugin only when the whole page is sent?

How to run my plugin only when the whole page is sent?