Skip to content

Blob in ie10 throw error: InvalidStateError #1238

Open
@caijf

Description

@caijf

What started as a problem of Uint8Array is Blob. #1014

The following is the test code, please help to answer it:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Test</title>
</head>
<body>
  <!-- No error is reported if it is not imported -->
  <script src="https://www.unpkg.com/[email protected]/minified.js"></script>

  <script>
    var str = 'hello world';
    var n = str.length;
    var uiArr = new Uint8Array(n);
    for (var i = 0; i < n; i++) {
      uiArr[i] = str.charCodeAt(i);
    }
    console.log(uiArr);
    console.log(new Blob([uiArr])); // in ie10 throw error: InvalidStateError
  </script>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions