Skip to content

Commit 8246dff

Browse files
committed
[ISSUE-19208] If scaladocs on file protocol don't do SPA routing.
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.
1 parent 64411b6 commit 8246dff

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 5 additions & 0 deletions
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)