Moodle

popupchecker() in javascript-static.js doesnt work in google chrome

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Quiz
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

popupchecker() relies on window.open returning null if there is a popup blocker active. Unfortunately google chrome works differently from IE, firefox and safari and returns a window object even with the popup blocker active.

A possible system for detecting whether there is a popup blocker active in all browsers can be found here. http://stackoverflow.com/questions/668286/detect-blocked-popup-in-chrome

Activity

Hide
Tim Hunt added a comment -

I'll try to fix this before the release.

Show
Tim Hunt added a comment - I'll try to fix this before the release.
Hide
Tim Hunt added a comment -

I don't actually see the problem with Chrome. The popupchecker JavaScript function may return the 'wrong' result, but actually, the quiz works. When you click on the start quiz button, the pop-up actually appears, and you can take the quiz, because modern pop-up blockers are clever, and will allow a pop-up if you just clicked on something.

I think the problem is with Firefox, and similar, where the behaviour is the same as in Chrome. You click on the start attempt button, and the quiz opens in a popup. The only problem is that when you arrive at the quiz view page, you get a stupid alert telling you to turn off your pop-up blocker.

So I have just removed the pop-up blocker check. Since the quiz was the only user of the broken popupchecker function, I removed that function too.

I have tested on IE, Firefox, Chrome, Safari and Opera (all on Windows) and it all seems to work.

Except in Opera, which is nice to its users, and does not let you open obnoxious full-screen pop-ups. The quiz still works though, it just appears in a new tab.

By the way, the whole full-screen pop-up thing is a bit silly on a multi-monitor system such as the one I have here. It just opens full-screen on one of the monitors, so you can still get at other stuff. I really wish I could get rid of 'secure' mode, but Martin won't let me.

Anyway, I think my change is the best we can do for now.

Show
Tim Hunt added a comment - I don't actually see the problem with Chrome. The popupchecker JavaScript function may return the 'wrong' result, but actually, the quiz works. When you click on the start quiz button, the pop-up actually appears, and you can take the quiz, because modern pop-up blockers are clever, and will allow a pop-up if you just clicked on something. I think the problem is with Firefox, and similar, where the behaviour is the same as in Chrome. You click on the start attempt button, and the quiz opens in a popup. The only problem is that when you arrive at the quiz view page, you get a stupid alert telling you to turn off your pop-up blocker. So I have just removed the pop-up blocker check. Since the quiz was the only user of the broken popupchecker function, I removed that function too. I have tested on IE, Firefox, Chrome, Safari and Opera (all on Windows) and it all seems to work. Except in Opera, which is nice to its users, and does not let you open obnoxious full-screen pop-ups. The quiz still works though, it just appears in a new tab. By the way, the whole full-screen pop-up thing is a bit silly on a multi-monitor system such as the one I have here. It just opens full-screen on one of the monitors, so you can still get at other stuff. I really wish I could get rid of 'secure' mode, but Martin won't let me. Anyway, I think my change is the best we can do for now.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: