Update loadPref.js

added top instead of window and using that instead of ancestorOrigins