Skip to content

Commit 75ddad2

Browse files
authored
[ISSUE-#19208] If scaladocs on file protocol don't do SPA routing. (#22013)
If we detect scaladocs are being served locally (i.e page on the "file" protocol) then we let the link click event go back to normal handling. Otherwise unless a user has allowed pages on the file protocol to access other files https://github.com/chromium/chromium/blob/b6c23ba2056e65081f8a5bcbf73b176baaa42645/content/public/common/content_switches.cc#L15 for example with the allow-file-access-from-files flag in chrome then SPA routing won't work. Fixes #19208.
1 parent 0afabd6 commit 75ddad2

File tree

1 file changed

+5
-0
lines changed
  • scaladoc/resources/dotty_res/scripts

1 file changed

+5
-0
lines changed

Diff for: scaladoc/resources/dotty_res/scripts/ux.js

+5
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ function attachAllListeners() {
167167
if (url.origin !== window.location.origin) {
168168
return;
169169
}
170+
// ISSUE-19208, treat as normal link when lacking HTTP server,
171+
// otherwise GET request blocked by CORS protections.
172+
if (window.location.protocol.startsWith("file")) {
173+
return;
174+
}
170175
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) {
171176
return;
172177
}

0 commit comments

Comments
 (0)