BTAndroidWebViewSelection icon indicating copy to clipboard operation
BTAndroidWebViewSelection copied to clipboard

How to Deserialize the selected Range?

Open inventionlabs opened this issue 12 years ago • 5 comments

Hi, This is a amazing work in android webview. Thanks for the effort. Presently I am try to make a selection in webview and save it in the android DB. I am able to save the serialized string from your code but I am not able to deserialize the string. I am getting this error "Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1"

when I call the rangy.deserialize(selectedrange).

Please help me to save and highlight the text in webview by using your excellent idea.

Thank You, Abu Saad Papa

inventionlabs avatar Jul 19 '12 11:07 inventionlabs

Try this,

var highlightRange = rangy.deserializeSelection(selectedrange); var range = rangy.getSelection();

btate avatar Jul 19 '12 17:07 btate

Hi, i am trying to implement deserialize the Selection, for that i using rangy.deserializeSelection(selectedrange); methode. in javascript layer it throughing error "jserror: Undefined" at b.setEnd(a.node,a.offset); in function q(c,a,b) of rangy-serializer.js file.

Please Help me for this issue.

Bijaya Guin

BijayaGuin avatar Oct 04 '12 12:10 BijayaGuin

Can you send me some code? Not sure what you're doing to get that error.

btate avatar Oct 04 '12 14:10 btate

Hi, I am able to make a selection in webview and able to save the serialized selection value in android DB . at the time of deserialize, i am getting serialized selection value from DB and i used below methode for deserialized.

var highlightRange = rangy.deserializeSelection(selectedrange);

then am getting this error:: JSError: deserializeRange: checksums of serialized range root node (a88e5b11) and target root node (f24b7ae8) do not match.

One thing i noticed, when i select some content from webview it gives a serialized String value. if again i am selecting same content it gives different serialized String value.

Thank you, Bijaya Guin

BijayaGuin avatar Oct 05 '12 07:10 BijayaGuin

Hi BijayaGuin

did you got any solution for deserialize? I am also having the same problem. I am not able to deserialize the selection.

btate, can you help?

Thanks!

Neernay avatar Jun 06 '13 11:06 Neernay