I'm using UniWebView as a UI for Unity. I need to send touchevents to modify a 3D asset. Uniwebview's messaging is done via URL format and thus has to be strings.
When I try to send a touchevent with JSON.stringify()
it only sends {isTrusted: true}
. I have gone through everything in this question without luck. The functions in the second and third answers return the same result, only the isTrusted
object.
In the top answer, the author explicitly stated you should not delete all the DOM references, but in my use-case I think it's completely acceptable.
How can I do that?
It would be nice if it did it automagically (detecting if it was a DOM element ("circular references")) but I think I could also manually filter the following keys:
- changedTouches[x].target
- currentTarget
- path[]
- srcElement
- target
- targetTouches[x].target
- touches[x].target
- view
I found this question for looping through an object recursively, but the comments imply that circular references may cause an overflow. On top of that, I'm not sure how I would "rebuild" the object.
Any help would be appreciated.