質問編集履歴
3
image.srcの値を入力していませんでした。
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,8 +18,9 @@
|
|
18
18
|
|
19
19
|
### 該当のソースコード
|
20
20
|
```javascript
|
21
|
+
|
21
22
|
var img = document.createElement("img");
|
22
|
-
img.src =
|
23
|
+
img.src = "https://onimai.jp/episode/img/03_06.jpg";
|
23
24
|
img.style.width = "100%";
|
24
25
|
img.style.position = "fixed";
|
25
26
|
img.style.top = "0";
|
2
エラーメッセージを確認できたため追加。
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,6 +13,8 @@
|
|
13
13
|
|
14
14
|
### 発生している問題・エラーメッセージ
|
15
15
|
Twitterで、Tampermonkeyにより実行されるJavascriptにより外部サイトから画像を取得しようとすると、失敗する。
|
16
|
+
|
17
|
+
Refused to load the image 'https://onimai.jp/episode/img/03_06.jpg' because it violates the following Content Security Policy directive: "img-src 'self' blob: data: https://.cdn.twitter.com https://ton.twitter.com https://.twimg.com https://analytics.twitter.com https://cm.g.doubleclick.net https://www.google-analytics.com https://maps.googleapis.com https://www.periscope.tv https://www.pscp.tv https://media.riffsy.com https://.giphy.com https://media.tenor.com https://c.tenor.com https://.pscp.tv https://.periscope.tv https://prod-periscope-profile.s3-us-west-2.amazonaws.com https://platform-lookaside.fbsbx.com https://scontent.xx.fbcdn.net https://scontent-sea1-1.xx.fbcdn.net https://.googleusercontent.com".
|
16
18
|
|
17
19
|
### 該当のソースコード
|
18
20
|
```javascript
|
1
2ヶ所修正しました。1、ソースコードをJavascriptに指定できていなかったこと。2、初投稿でありながら初心者アイコンが無効になっていたこと。
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
Twitterで、Tampermonkeyにより実行されるJavascriptにより外部サイトから画像を取得しようとすると、失敗する。
|
16
16
|
|
17
17
|
### 該当のソースコード
|
18
|
-
|
18
|
+
```javascript
|
19
19
|
var img = document.createElement("img");
|
20
20
|
img.src = url;
|
21
21
|
img.style.width = "100%";
|
@@ -24,7 +24,7 @@
|
|
24
24
|
img.style.left = "0";
|
25
25
|
img.style.zIndex = "-1";
|
26
26
|
document.body.appendChild(img);
|
27
|
-
|
27
|
+
```
|
28
28
|
### 試したこと
|
29
29
|
|
30
30
|
画像を別の外部サイトのものに変えましたが、直りません。
|