use document.referrer instead of history.length (#13697)
Contributed by Filou Centrinov.
Authored by: tmaruyama 2013-05-24
Parent: [r11899]
Child: [r11901]