Run at document_idle to work in most cases