Fossil SCM

Added a nonce attribute to the <script> tag for the inline JavaScript backing the WYSIWYG wiki editor feature. Without this, modern browsers throw a CSP violation.

wyoung 2018-10-09 16:06 trunk
Commit 12a90ff44477f056fe30494ba081979eb757f82f8a2c8a63771217cb128837ab
1 file changed +1 -1
+1 -1
--- src/wysiwyg.c
+++ src/wysiwyg.c
@@ -226,11 +226,11 @@
226226
227227
@ </div>
228228
@ <div id="wysiwygBox"
229229
@ style="resize:both; overflow:auto; width: %d(w)em; height: %d(h)em;"
230230
@ contenteditable="true">%s(zContent)</div>
231
- @ <script>
231
+ @ <script nonce="%h(style_nonce())">
232232
@ var oDoc;
233233
@
234234
@ /* Initialize the document editor */
235235
@ function initDoc() {
236236
@ oDoc = document.getElementById("wysiwygBox");
237237
--- src/wysiwyg.c
+++ src/wysiwyg.c
@@ -226,11 +226,11 @@
226
227 @ </div>
228 @ <div id="wysiwygBox"
229 @ style="resize:both; overflow:auto; width: %d(w)em; height: %d(h)em;"
230 @ contenteditable="true">%s(zContent)</div>
231 @ <script>
232 @ var oDoc;
233 @
234 @ /* Initialize the document editor */
235 @ function initDoc() {
236 @ oDoc = document.getElementById("wysiwygBox");
237
--- src/wysiwyg.c
+++ src/wysiwyg.c
@@ -226,11 +226,11 @@
226
227 @ </div>
228 @ <div id="wysiwygBox"
229 @ style="resize:both; overflow:auto; width: %d(w)em; height: %d(h)em;"
230 @ contenteditable="true">%s(zContent)</div>
231 @ <script nonce="%h(style_nonce())">
232 @ var oDoc;
233 @
234 @ /* Initialize the document editor */
235 @ function initDoc() {
236 @ oDoc = document.getElementById("wysiwygBox");
237

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button