I know that for us, we have found that if the course is in the LMS player window, which exists under a different domain to the popup window content we can't actually bring "focus" back to the player window.If I were you I would test and see whether or not if you remove the window focus code, if the error disappears...