Twitter Web Intent的内容安全策略问题

Urc*_*rco 6 javascript webintents twitter-bootstrap-3

我有一个生成随机引号的网页,我有一个按钮,当点击它时,应该重定向到Twitter网页意图页面,以便允许观众发送已经预先填充了引用文本的推文.

按钮的代码:

<a class="btn btn-info btn-lg" href="#" data-size="large" 
id="tweet-button"><i class="fa fa-twitter"></i>Tweet the current quote!</a>
Run Code Online (Sandbox Code Playgroud)

单击按钮时的jQuery将修改按钮的"href"属性,以便将预先填充的文本添加到URL中以显示它.

$("#tweet-button").click(function (){
    $(this).attr("href", "https://twitter.com/intent/tweet?text=" + encodeURIComponent($("#quote").text()) );
}); 
Run Code Online (Sandbox Code Playgroud)

当我单击按钮时出现此错误:

Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src
https://connect.facebook.net https://cm.g.doubleclick.net 
https://ssl.google-analytics.com https://graph.facebook.com  
https://twitter.com https://*.userzoom.com 'unsafe-eval' 
https://*.twimg.com https://api.twitter.com https://analytics.twitter.com 
'nonce-6B1Ck//9/fE6OIatYBYe4A==' https://ton.twitter.com  
https://syndication.twitter.com https://www.google.com 
https://t.tellapart.com https://platform.twitter.com https://www.google-
analytics.com 'self'". Either the 'unsafe-inline' keyword, a hash 
('sha256-<sha256-hash'), or a nonce ('nonce-...') is required to enable 
inline execution
Run Code Online (Sandbox Code Playgroud)

如果我在URL中包含静态文本而不是$("#quote").text()正常加载,但无法弄清楚原因.在这两种情况下,我都应该得到CSP错误.