Skip to content

Fix CSP violation caused by toastr source map fetch#12

Open
JS55CT wants to merge 2 commits intoWazeDev:masterfrom
JS55CT:master
Open

Fix CSP violation caused by toastr source map fetch#12
JS55CT wants to merge 2 commits intoWazeDev:masterfrom
JS55CT:master

Conversation

@JS55CT
Copy link
Copy Markdown
Contributor

@JS55CT JS55CT commented Mar 16, 2026

Removes the //# sourceMappingURL=toastr.js.map directive from the bottom of toastr.js.

When browsers load toastr.js with DevTools open, they automatically attempt to fetch the referenced .map file. This fetch goes through the page's connect-src Content Security Policy, which does not include wazedev.github.io — causing the request to be blocked and a CSP violation error to be logged in the console.

Removing the sourceMappingURL comment prevents the browser from attempting the source map fetch. There is no runtime impact; source maps are a development-only debugging aid.

Error resolved:

Connecting to 'https://wazedev.github.io/WazeWrap/toastr.js.map' violates the following Content Security Policy directive: "connect-src ..."

JS55CT and others added 2 commits March 16, 2026 14:15
Removes the //# sourceMappingURL=toastr.js.map directive from the bottom of toastr.js.

When browsers load toastr.js with DevTools open, they automatically attempt to fetch the referenced .map file. This fetch goes through the page's connect-src Content Security Policy, which does not include wazedev.github.io — causing the request to be blocked and a CSP violation error to be logged in the console.

Removing the sourceMappingURL comment prevents the browser from attempting the source map fetch. There is no runtime impact; source maps are a development-only debugging aid.

Error resolved:

Connecting to 'https://wazedev.github.io/WazeWrap/toastr.js.map' violates the following Content Security Policy directive: "connect-src ..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant