Add support for firefox

This commit is contained in:
Jaiwanth 2021-05-25 17:48:08 +05:30
parent 7cd3f51c56
commit 0ee290648a
3 changed files with 9 additions and 0 deletions

View File

@ -104,6 +104,7 @@
"tar-js": "^0.3.0",
"text-encoding-utf-8": "^1.0.2",
"url": "^0.11.0",
"web-streams-polyfill": "^3.0.3",
"what-input": "^5.2.10",
"zxcvbn": "^4.4.2"
},

View File

@ -7,6 +7,7 @@ import { Room } from "matrix-js-sdk/src/models/room";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { getUserNameColorClass } from "../FormattingUtils";
import { Exporter } from "./Exporter";
import * as ponyfill from 'web-streams-polyfill/ponyfill'
const css = `
body {
@ -485,6 +486,8 @@ export default class HTMLExporter extends Exporter {
//Generate the zip file asynchronously
const blob = await this.zip.generateAsync({ type: "blob" });
//Support for firefox browser
streamSaver.WritableStream = ponyfill.WritableStream
//Create a writable stream to the directory
const fileStream = streamSaver.createWriteStream(filename, { size: blob.size });
const writer = fileStream.getWriter();

View File

@ -8337,6 +8337,11 @@ walker@^1.0.7, walker@~1.0.5:
dependencies:
makeerror "1.0.x"
web-streams-polyfill@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.0.3.tgz#f49e487eedeca47a207c1aee41ee5578f884b42f"
integrity sha512-d2H/t0eqRNM4w2WvmTdoeIvzAUSpK7JmATB8Nr2lb7nQ9BTIJVjbQ/TRFVEh2gUH1HwclPdoPtfMoFfetXaZnA==
webcrypto-core@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.1.8.tgz#91720c07f4f2edd181111b436647ea5a282af0a9"