Using a context variable instead of switching it when checking for web workers