deepresearch-flow 0.4.1__py3-none-any.whl → 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,11 +29,63 @@ See https://github.com/adobe-type-tools/cmap-resources
29
29
 
30
30
  <!-- This snippet is used in production (included from viewer.html) -->
31
31
  <link rel="resource" type="application/l10n" href="locale/locale.properties">
32
- <script src="../build/pdf.js"></script>
33
-
34
- <link rel="stylesheet" href="viewer.css">
35
-
36
- <script src="viewer.js"></script>
32
+ <script>
33
+ (function() {
34
+ var params = new URLSearchParams(window.location.search);
35
+ var cdnBase = params.get('cdn');
36
+ if (cdnBase) {
37
+ cdnBase = cdnBase.replace(/\/+$/, '');
38
+ }
39
+
40
+ function loadStyle(url, fallbackUrl) {
41
+ var link = document.createElement('link');
42
+ link.rel = 'stylesheet';
43
+ link.href = url;
44
+ if (fallbackUrl) {
45
+ link.onerror = function() {
46
+ if (link.dataset.fallbackLoaded) return;
47
+ link.dataset.fallbackLoaded = '1';
48
+ link.href = fallbackUrl;
49
+ };
50
+ }
51
+ document.head.appendChild(link);
52
+ }
53
+
54
+ function loadScript(url, fallbackUrl, onload) {
55
+ var script = document.createElement('script');
56
+ script.src = url;
57
+ script.defer = true;
58
+ script.onload = function() {
59
+ if (onload) onload();
60
+ };
61
+ script.onerror = function() {
62
+ if (!fallbackUrl) return;
63
+ var fallback = document.createElement('script');
64
+ fallback.src = fallbackUrl;
65
+ fallback.defer = true;
66
+ fallback.onload = function() {
67
+ if (onload) onload();
68
+ };
69
+ document.head.appendChild(fallback);
70
+ };
71
+ document.head.appendChild(script);
72
+ }
73
+
74
+ var viewerCss = cdnBase ? cdnBase + '/web/viewer.css' : 'viewer.css';
75
+ loadStyle(viewerCss, 'viewer.css');
76
+
77
+ var pdfjsUrl = cdnBase ? cdnBase + '/build/pdf.js' : '../build/pdf.js';
78
+ loadScript(pdfjsUrl, '../build/pdf.js', function() {
79
+ var workerUrl = cdnBase ? cdnBase + '/build/pdf.worker.js' : '../build/pdf.worker.js';
80
+ if (window.pdfjsLib) {
81
+ window.pdfjsLib.GlobalWorkerOptions.workerSrc = workerUrl;
82
+ }
83
+ var viewerJs = 'viewer.js';
84
+ var viewerFallback = cdnBase ? cdnBase + '/web/viewer.js' : null;
85
+ loadScript(viewerJs, viewerFallback);
86
+ });
87
+ })();
88
+ </script>
37
89
  </head>
38
90
 
39
91
  <body tabindex="1">
@@ -1637,6 +1637,10 @@ exports.PDFViewerApplication = PDFViewerApplication;
1637
1637
  return;
1638
1638
  }
1639
1639
  try {
1640
+ const params = new URLSearchParams(window.location.search);
1641
+ if (params.get("allow_origin") === "1" || params.get("disable_origin_check") === "1") {
1642
+ return;
1643
+ }
1640
1644
  const viewerOrigin = new URL(window.location.href).origin || "null";
1641
1645
  if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) {
1642
1646
  return;
@@ -14096,4 +14100,4 @@ if (document.readyState === "interactive" || document.readyState === "complete")
14096
14100
 
14097
14101
  /******/ })()
14098
14102
  ;
14099
- //# sourceMappingURL=viewer.js.map
14103
+ //# sourceMappingURL=viewer.js.map