/*
* When the browser cleans up extensions of a previous page. It does not check to see
* if the current page is using that extension too. It will unload multiple instances as well.
*/
if( ext instanceof ScriptableFunction ) {
_scriptEngine.addExtension( name, new ScriptableFunctionWrapper( (ScriptableFunction) ext ) );
} else if( ext instanceof Scriptable ) {
_scriptEngine.addExtension( name, new ScriptableWrapper( (Scriptable) ext ) );
} else {
_scriptEngine.addExtension( name, ext );
}