Safari for iPhone: window.getSelection(); in a bookmarklet does not work

Originator:robotspacer
Number:rdar://7013257 Date Originated:2009-06-27
Status:Duplicate Resolved:
Product:iPhone Product Version:3.0
Classification:Enhancement Reproducible:Always
 
Summary: 
When a JavaScript bookmarklet in Safari for iPhone 3.0 uses window.getSelection(), it does not work. The selection is removed as soon as the bookmarks menu is opened.

Steps to Reproduce:
1. Install a JavaScript bookmarklet that uses window.getSelection(), like the one here: https://junecloud.com/ds/grab/ or the "view selection" one here: https://www.squarefree.com/bookmarklets/pagedata.html
2. Open a web page
3. Select some text
4. Tap the bookmarks button
5. Select the bookmarklet

Expected Results:
The bookmarklet should be able to access the selected text.

Actual Results:
As soon as the bookmarks button is tapped, the selection is removed, so the script is unable to see what text was selected.

Regression:
N/A

Notes:
N/A

Comments

Duplicate

This is a duplicate of rdar://7024250

By robotspacer at Aug. 20, 2010, 10:26 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!