Marshalling Array Buffers From Extension Background Page <=> Popup Page Doesn't Work

Won’t fix Issue #18386569

Details

Author
Kyle S.
Created
Jul 25, 2018
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

Simple test reproduction (see attached example):

background.js

window.myBuffer = new Uint8Array([1,2,3]).buffer;
window.printBuffer = function(buffer) {
    console.log(buffer);
    const arr = new Uint8Array(buffer);
    console.log(arr.length);
    console.log(arr);
};

popup.js

const bgBuffer = browser.extension.getBackgroundPage().myBuffer;
console.log(bgBuffer);
const arr = new Uint8Array(bgBuffer);
console.log(arr.length);
console.log(arr);
browser.extension.getBackgroundPage().printBuffer(new Uint8Array([4,5,6]).buffer);

Open the popup and consoles read:

Background page

[object ArrayBuffer]: {0: <Object doesn't support property or method 'Symbol.iterator'>}
 0
[object Uint8Array]: []

Popup page

 [object ArrayBuffer]
 0

Possibly related? https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12227553/

Attachments

Comments and activity

  • If you convert the Array Buffers to UInt8Arrays, it seems to work.

  • Microsoft Edge Team

    Changed Assigned To to “Sanchit A.”

    Changed Status to “Confirmed”

    Changed Assigned To from “Sanchit A.” to “Scott S.”

    Changed Status from “Confirmed”

    Changed Status to “Won’t fix”

You need to sign in to your Microsoft account to add a comment.

Sign in