Detect DOM instances by constructor function instead of XPCOM interface