JavaScript inserted using HTML macro cannot be executed

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

Some JavaScript (specifically those with functions) inserted using the HTML macro cannot be executed upon saving a Confluence page. When previewing the page (using the Editor), the JS can successfully be executed.

診断

This issue only occurs in Chrome. After saving the page, going to Developer Tool > Console will produce the following error:

Refused to execute a JavaScript script. Source code of script found within request.

原因

The error is thrown when the page is saved via a POST and then retrieved via a GET. This is actually a security measure put in place by the Chrome browser in order to prevent XSS (cross-site scripting) attacks.

For more information regarding this, please refer to the following links:

ソリューション

Refreshing the page will resolve this issue. The JS can actually be executed upon refresh or upon normal viewing.

最終更新日: 2016 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.