Update loadPref.js

replace docmnet.URL with window.location.href