質問編集履歴

3

エラーメッセージ

2021/03/01 00:10

投稿

Ito_Kazuki_
Ito_Kazuki_

スコア124

test CHANGED
File without changes
test CHANGED
@@ -29,3 +29,115 @@
29
29
  ### 補足
30
30
 
31
31
  検索の過程で出てきた[PDF.js](https://github.com/mozilla/pdf.js)を活用したいと考えています。また、[このブログ](https://www.linkcom.com/blog/2019/12/howtouse-pdfjs.html)でPDF.jsについて説明されており、[具体例](https://mozilla.github.io/pdf.js/web/viewer.html)が紹介されているので、同じものにしたいのですが、ソースコードを見て真似してもなぜか上手くいきません。
32
+
33
+
34
+
35
+ ###エラーについて
36
+
37
+ ```
38
+
39
+ Access to XMLHttpRequest at '~/mozilla.github.io/web/locale/locale.properties' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
40
+
41
+ getL10nData @ viewer.js:14134
42
+
43
+ viewer.js:13755 ~/mozilla.github.io/web/locale/locale.properties not found.
44
+
45
+ (anonymous) @ viewer.js:13755
46
+
47
+ viewer.js:13756 "ja-jp" resource not found
48
+
49
+ (anonymous) @ viewer.js:13756
50
+
51
+ locale/locale.properties:1 Failed to load resource: net::ERR_FAILED
52
+
53
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-viewThumbnail.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
54
+
55
+ toolbarButton-viewThumbnail.svg:1 Failed to load resource: net::ERR_FAILED
56
+
57
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-viewOutline.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
58
+
59
+ toolbarButton-viewOutline.svg:1 Failed to load resource: net::ERR_FAILED
60
+
61
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-viewAttachments.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
62
+
63
+ toolbarButton-viewAttachments.svg:1 Failed to load resource: net::ERR_FAILED
64
+
65
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-viewLayers.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
66
+
67
+ toolbarButton-viewLayers.svg:1 Failed to load resource: net::ERR_FAILED
68
+
69
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-sidebarToggle.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
70
+
71
+ toolbarButton-sidebarToggle.svg:1 Failed to load resource: net::ERR_FAILED
72
+
73
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-search.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
74
+
75
+ toolbarButton-search.svg:1 Failed to load resource: net::ERR_FAILED
76
+
77
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-pageUp.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
78
+
79
+ toolbarButton-pageUp.svg:1 Failed to load resource: net::ERR_FAILED
80
+
81
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-pageDown.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
82
+
83
+ toolbarButton-pageDown.svg:1 Failed to load resource: net::ERR_FAILED
84
+
85
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-presentationMode.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
86
+
87
+ toolbarButton-presentationMode.svg:1 Failed to load resource: net::ERR_FAILED
88
+
89
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-openFile.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
90
+
91
+ toolbarButton-openFile.svg:1 Failed to load resource: net::ERR_FAILED
92
+
93
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-print.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
94
+
95
+ toolbarButton-print.svg:1 Failed to load resource: net::ERR_FAILED
96
+
97
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-download.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
98
+
99
+ toolbarButton-download.svg:1 Failed to load resource: net::ERR_FAILED
100
+
101
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-bookmark.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
102
+
103
+ toolbarButton-bookmark.svg:1 Failed to load resource: net::ERR_FAILED
104
+
105
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-secondaryToolbarToggle.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
106
+
107
+ toolbarButton-secondaryToolbarToggle.svg:1 Failed to load resource: net::ERR_FAILED
108
+
109
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-zoomOut.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
110
+
111
+ toolbarButton-zoomOut.svg:1 Failed to load resource: net::ERR_FAILED
112
+
113
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-zoomIn.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
114
+
115
+ toolbarButton-zoomIn.svg:1 Failed to load resource: net::ERR_FAILED
116
+
117
+ viewer.html:1 Access to image at '~/mozilla.github.io/web/images/toolbarButton-menuArrow.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
118
+
119
+ toolbarButton-menuArrow.svg:1 Failed to load resource: net::ERR_FAILED
120
+
121
+ pdf.worker.js:16 Uncaught SyntaxError: Cannot use import statement outside a module
122
+
123
+ viewer.js:14134 #loading_error is undefined.
124
+
125
+ getL10nData @ viewer.js:14134
126
+
127
+ viewer.js:14134 #error_version_info is undefined.
128
+
129
+ getL10nData @ viewer.js:14134
130
+
131
+ viewer.js:14134 #error_message is undefined.
132
+
133
+ getL10nData @ viewer.js:14134
134
+
135
+ pdf.js:2865 Uncaught (in promise) Error: Setting up fake worker failed: "Cannot read property 'WorkerMessageHandler' of undefined".
136
+
137
+ at pdf.js:2865
138
+
139
+ DevTools failed to load SourceMap: Could not load content for ~/mozilla.github.io/build/pdf.js.map: System error: net::ERR_FILE_NOT_FOUND
140
+
141
+ DevTools failed to load SourceMap: Could not load content for ~/mozilla.github.io/web/viewer.js.map: System error: net::ERR_FILE_NOT_FOUND
142
+
143
+ ```

2

追加しました

2021/03/01 00:09

投稿

Ito_Kazuki_
Ito_Kazuki_

スコア124

test CHANGED
File without changes
test CHANGED
@@ -28,4 +28,4 @@
28
28
 
29
29
  ### 補足
30
30
 
31
- 検索の過程で出てきた[PDF.js](https://github.com/mozilla/pdf.js)を活用したいと考えています。
31
+ 検索の過程で出てきた[PDF.js](https://github.com/mozilla/pdf.js)を活用したいと考えています。また、[このブログ](https://www.linkcom.com/blog/2019/12/howtouse-pdfjs.html)でPDF.jsについて説明されており、[具体例](https://mozilla.github.io/pdf.js/web/viewer.html)が紹介されているので、同じものにしたいのですが、ソースコードを見て真似してもなぜか上手くいきません。

1

初心者アイコンを追加

2021/02/28 23:55

投稿

Ito_Kazuki_
Ito_Kazuki_

スコア124

test CHANGED
File without changes
test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
 
24
24
 
25
- 正直、今までにこういったことをしてきていないので何の言語を使用したらいいかなどもわかりません。ただし、いろいろ検索した結果、CSSを使用するとでき得るということが分かったため、また、今までに使用してきたHTMLやJavaScriptを使用してできないかと思っています。
25
+ 正直、今までにこういったことをしてきていないので何の言語を使用したらいいかなどもわかりません。いろいろ検索した結果、CSSを使用するとでき得るということが分かったため、また、今までに使用してきたHTMLやJavaScriptを使用してできないかと思っています。
26
26
 
27
27
 
28
28