Bug 891745 - Port of bug 899080 to avoid timeout of crashing plugin. r=Standard8,a=orange fix for CLOSED TREE