Skip to content

Firefox logs CSP warning on items containing TableOfContents macro #1976

@RogerHaase

Description

@RogerHaase

No other browsers (tested Firefox, Edge, Chrome, Opera on Windows 10) logged a similar CSP warning.

Firefox log shows warning similar to:

2025-08-10 13:31:32,030 WARNING moin.apps.frontend.views:305 127.0.0.1 application/csp-report: 
{
'blocked-uri': 'inline',
'column-number': 1, 
'disposition': 'report', 
'document-uri': 'http://127.0.0.1:5000/Home', 
'effective-directive': 'script-src-attr', 
'original-policy': "
    default-src 'self'; 
    script-src 'self'; 
    style-src 'self'; 
    img-src 'self'; 
    report-uri http://127.0.0.1:5000/+cspreport/log
", 
'referrer': 'http://127.0.0.1:5000/Home', 
'source-file': 'http://127.0.0.1:5000/Home', 
'status-code': 200, 
'violated-directive': 'script-src-attr'
}

The warning is generated by html_out.py near line 754:

            headtogglelink = html.a(
                attrib={
                    html.class_: "moin-showhide",
                    html.href_: "#",
                    html.onclick_: "$('.moin-table-of-contents ol').toggle();return false;",
                },
                children=["[+]"],
            )

and near line 793:

                togglelink = html.a(
                    attrib={
                        html.href_: "#",
                        html.onclick_: f"$('#li{id} ol').toggle();return false;",
                        html.class_: "moin-showhide",
                    },
                    children=["[+]"],
                )

Firefox objects to use of html.onclick.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions