discordチャット上で特定のコメントを検出するプログラムです
chromeのconsoleで下記のコードを含んだプログラムを実行すると、
Refused to load the script 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js?d=1537198714769'
because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline'
https://cdn.discordapp.com/animations/
https://www.gstatic.com/recaptcha/
https://www.google.com/recaptcha/
https://js.stripe.com
https://js.braintreegateway.com https://assets.braintreegateway.com
https://www.paypalobjects.com
https://checkout.paypal.com
'nonce-MTkwLDczLDE4NCwyMTMsMTg2LDE2OCwyNDYsMTE1'".
というエラーが出ました。どうやらgoogleさんの定めるルールに違反してるっぽいのは分かったのですが、何を書き加えていいのかわかりません。対処法を教えていただけないでしょうか?
※表示を反映の部分は片方しか実行せずもう片方はコメントアウトしていました
javascript
1//-------------------------検出動作の見た目部分--------------------------------// 2jqload = function() { 3 msgtxt = $(".message-text").last().text(); 4 try { 5 $("#detect").remove(); 6 } catch (ex) {} 7 $("body").append('<div id="detect">Wait Message<span>...</span></div>'); 8 $("#detect").css({ 9 "position": "absolute", 10 "bottom": 0, 11 "right": 0, 12 "padding": 10, 13 "background": "#fff", 14 "color": "#000" 15 }); 16 waitmsg(); 17} 18//オブジェクトを生成 19s = document.createElement("script"); 20//要素を追加 21s.setAttribute("onload", "jqload()"); 22s.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js?d=" + (new Date()).getTime(); 23//表示を反映-1 24document.head.appendChild(s); 25//表示を反映-2 26var stag = document.getElementsByTagName( 'script' )[ 0 ]; 27stag.parentNode.insertBefore( s, stag );
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/18 15:31