diff --git a/package.json b/package.json index 61b2a27acc..ad7de2941c 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/utils/exportUtils/HtmlExport.ts b/src/utils/exportUtils/HtmlExport.ts index 894e8571ef..755792079a 100644 --- a/src/utils/exportUtils/HtmlExport.ts +++ b/src/utils/exportUtils/HtmlExport.ts @@ -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(); diff --git a/yarn.lock b/yarn.lock index 982b9e607b..d2c1a8f71d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"