Commit b359eb2
authored
Replace window.location.href with window.location.pathname (#983)
In the use cases of navigators with multiple top-level root, we want to
make sure that queries don't interfere with the election of the
top-level root node when extracting the root node.
Before we were reading the window.location.href, which includes queries.
Now, by using the window.location.pathname, we ignore the queries, which
makes possible to compare with the node.path value to find which it's
the correct top-level root.
Example: URL: 'http://localhost:8080/documentation/foo?language=objc'
Navigator path: '/documentation/foo'
By using `window.location.pathname` we ignore `?language=objc` and we
can compare `/documentation/foo` with `/documentation/foo`1 parent c781d37 commit b359eb2
File tree
2 files changed
+3
-3
lines changed- src/utils
- tests/unit/utils
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
| 412 | + | |
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| |||
0 commit comments