Commit c2c78a3
fix: apps loaded from Windows file shares not mapped to network drives (#2774)
When loading an application from a Windows file share (not mapped to a network letter), Chrome will throw an error ("cannot be created in a document with origin 'null'") when `replaceState` is called. This happens because while `protocol` is `file:` and `host` is `vboxsvr` the `origin` is `file://` as opposed to `file://vboxsvr`. This means the absolute path is not created correctly.
Only Windows shares that are not mapped to a drive letter are affected. If a drive letter is mapped then while origin will still be `file://`, pathname will include the information instead (e.g. `/Z:/dist/index.html`)
This code removes the reliance on the origin attribute and calculates the absolute path from `protocol` and `host`.1 parent ffcc518 commit c2c78a3
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
0 commit comments