Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix(PdfMobileViewer): compatible with old browsers #2119

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Masa.Blazor.JS/rollup.config.pdfjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import typescript from "@rollup/plugin-typescript";
export default defineConfig({
input: [
"./src/proxies/pdf.js/mobile-viewer.ts",
"pdfjs-dist/build/pdf.worker.min.mjs",
"./src/proxies/pdf.js/pdf.worker.js",
],
output: [
{
Expand All @@ -21,11 +21,11 @@ export default defineConfig({
],
plugins: [
typescript(),
resolve(),
commonjs(),
getBabelOutputPlugin({
presets: ["@babel/preset-env"],
}),
resolve(),
commonjs(),
terser(),
],
watch: {
Expand Down
2 changes: 1 addition & 1 deletion src/Masa.Blazor.JS/src/proxies/pdf.js/mobile-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function init(
);

GlobalWorkerOptions.workerSrc = new URL(
"./pdf.worker.min.js",
"./pdf.worker.js",
import.meta.url
).toString();
pdfViewerApp.initUI();
Expand Down
7 changes: 7 additions & 0 deletions src/Masa.Blazor.JS/src/proxies/pdf.js/pdf.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import "core-js/modules/es.array.at.js";
import "core-js/modules/es.string.replace-all";
import "core-js/modules/web.structured-clone.js";
import "core-js/proposals/promise-with-resolvers";

import * as pdfworker from "pdfjs-dist/build/pdf.worker.mjs";
export default pdfworker;

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions src/Masa.Blazor/wwwroot/js/proxies/pdf-mobile-viewer/pdf.worker.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Loading