更新 jQuery3.7.1 修复静态文件 授信 host 功能

This commit is contained in:
高雄
2026-04-10 15:41:07 +08:00
parent c41c14bf3c
commit f97ed04ab0
41 changed files with 6896 additions and 118497 deletions

View File

@@ -23083,24 +23083,26 @@ initCom(PDFViewerApplication);
}
{
const HOSTED_VIEWER_ORIGINS = new Set(["null", "http://mozilla.github.io", "https://mozilla.github.io"]);
var validateFileURL = function (file) {
if (!file) {
return;
}
const viewerOrigin = URL.parse(window.location)?.origin || "null";
if (HOSTED_VIEWER_ORIGINS.has(viewerOrigin)) {
return;
}
const fileOrigin = URL.parse(file, window.location)?.origin;
if (fileOrigin === viewerOrigin) {
return;
}
const ex = new Error("file origin does not match viewer's");
PDFViewerApplication._documentError("pdfjs-loading-error", {
message: ex.message
});
throw ex;
};
var validateFileURL = function (file) {
if (!file) {
return;
}
const viewerOrigin = URL.parse(window.location)?.origin || "null";
if (HOSTED_VIEWER_ORIGINS.has(viewerOrigin)) {
return;
}
/* 注释掉跨域检查
const fileOrigin = URL.parse(file, window.location)?.origin;
if (fileOrigin === viewerOrigin) {
return;
}
const ex = new Error("file origin does not match viewer's");
PDFViewerApplication._documentError("pdfjs-loading-error", {
message: ex.message
});
throw ex;
*/
};
var onFileInputChange = function (evt) {
if (this.pdfViewer?.isInPresentationMode) {
return;