You need to sign in to do that
Don't have an account?
Florian.Gümbel
LockerService causes error in window.crypto.getRandomValues()
Hi there,
I'm working on react modules for lightning components.
Some of my modules uses the window.crypt api.
The fact that LockerService encapsulates every compontent to have their own window etc. it seems that there is something going wrong:
This is my test js controller code:
The react component uses the code in a simliar way.
It seems that the Uint8Array loses the binding (however) to the ArrayBufferView interface that the first argument needs to implement.
Any ideas to solve this?
Thank in advance!
I'm working on react modules for lightning components.
Some of my modules uses the window.crypt api.
The fact that LockerService encapsulates every compontent to have their own window etc. it seems that there is something going wrong:
This is my test js controller code:
({ init : function(component, event, helper) { console.log(window.crypto.getRandomValues(new window.Uint8Array(16))); } })This will thorw the following error:
This page has an error. You might just need to refresh it. Error during init [Action failed: c:reactTest$controller$init [Failed to execute 'getRandomValues' on 'Crypto': parameter 1 is not of type 'ArrayBufferView'.]]
The react component uses the code in a simliar way.
It seems that the Uint8Array loses the binding (however) to the ArrayBufferView interface that the first argument needs to implement.
Any ideas to solve this?
Thank in advance!
Might be a real problem in the LockerService implementation :(