Remove iframe.getSelection as it is undefined