javascript - Store & Restore Highlighted Selection -


i writing chrome extention need store , restore user's highlighted selection. stored information stored on server. wondering how this?

i looked using range, unsure if right way since example below worked in firefox.

i found example works in firefox :(

i think technique on page work in chrome: there's no reason why shouldn't. when save selection , reload, see selection restore , disappear, suspect in page (possibly ads) destroying selection somehow.

if can't work, try serializer module of rangy library, although it's overkill chrome.

in general, using browser's selection , range apis way go. standardized , universally supported (with quirks , bugs, naturally) in current browsers.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -