wait for DOM ready to invoke prefs