JS code
let obj = Native.getObj();
obj.width = 100;
kotlin code
val native = Native()
val nativeV8Obj = V8Object(v8)
nativeV8Obj.registerJavaMethod(native, "getObj", "getObj", emptyArray())
v8.add("Native", nativeV8Obj)
nativeV8Obj.close()
class Native {
fun getObj(): V8Object {
return ...some v8-obj ...
}
}
Then, execute js code.
How to get notice in java layer once the code obj.width = 100;
executed?
After some testing, I found a solution. js proxy code
At the
v8
init and prepare stage, execute this script.Then change Native's getObj method like below.