diff --git a/src/ecmascript/see/window.c b/src/ecmascript/see/window.c index 36587d771..749a2ba95 100644 --- a/src/ecmascript/see/window.c +++ b/src/ecmascript/see/window.c @@ -211,7 +211,8 @@ js_window_alert(struct SEE_interpreter *interp, struct SEE_object *self, struct view_state *vs = win->vs; unsigned char *string; - see_check_class(interp, thisobj, &js_window_object_class); + if (thisobj != interp->Global) + see_check_class(interp, thisobj, &js_window_object_class); SEE_SET_BOOLEAN(res, 1); if (argc < 1) @@ -248,7 +249,8 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self, static int ratelimit_count; #endif - see_check_class(interp, thisobj, &js_window_object_class); + if (thisobj != interp->Global) + see_check_class(interp, thisobj, &js_window_object_class); SEE_SET_OBJECT(res, (struct SEE_object *)win); if (get_opt_bool("ecmascript.block_window_opening")) { @@ -341,7 +343,8 @@ js_setTimeout(struct SEE_interpreter *interp, struct SEE_object *self, unsigned char *code; int timeout; - see_check_class(interp, thisobj, &js_window_object_class); + if (thisobj != interp->Global) + see_check_class(interp, thisobj, &js_window_object_class); if (argc != 2) return; ei = ((struct global_object *)interp)->interpreter;