The problem is that addons nowadays end up using xray-wrappers. This will cause a number of differences in behavior, behavior of ArrayBuffers being a quite important one.
I think we need to do one or both of: 1. Enable an addon to choose not to get xray-wrappers (we can debate what the default should be) 2. Enable addons that do have an xray wrapper to get access to some utilities, like Components.utils.cloneInto and Components.utils.waiveXrays. Most likely we'll need to do 1 if we expect to be able to make it easy to port chrome addons to Firefox/FirefoxOS. / Jonas On Tue, Oct 13, 2015 at 9:16 AM, <[email protected]> wrote: > Hi, > > > I have a FxOS Add-on injected in system app that calls bluetooth API. > Previously in September it works well, > but when I update to latest build recently, > error pops out from this line: > https://github.com/elin-moco/fxos-addon-beacon-scanner/blob/master/index.js#L496 > Error: Accessing TypedArray data over Xrays is slow, and forbidden in order > to encourage performant code. To copy TypedArrays across origin boundaries, > consider using Components.utils.cloneInto(). > > the scanRecord is an ArrayBuffer returned from bluetooth API, > I tried using > var view = new Uint8Array(scanRecord).wrappedJSObject; > but it fails to create the array, also > var view = new Uint8Array(scanRecord.wrappedJSObject).wrappedJSObject; > give me Error: Permission denied to access property "wrappedJSObject" > > Any ideas on how to deal with this problem? > > > > Thanks! > > Eddie > _______________________________________________ > dev-fxos mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-fxos _______________________________________________ dev-fxos mailing list [email protected] https://lists.mozilla.org/listinfo/dev-fxos

