mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
fix(web): report the pathname as the screen when there is no hash route
This commit is contained in:
1 parent
871a56d148
commit
f839f23af9
2 files changed
+51
-1
No files matched your search
@@ -381,7 +381,11 @@ func (d *Driver) Hierarchy(ctx context.Context) (string, error) {
|
||||
defer cancel()
|
||||
script := `
|
||||
(function() {
|
||||
const route = window.location.hash.replace(/^#/, '').split('?')[0] || '/';
|
||||
// Hash first (a HashRouter names the screen there), then the pathname, which
|
||||
// is where a path-routed SPA keeps it. Reporting '/' for every step of a
|
||||
// BrowserRouter app made every screen look like the same screen.
|
||||
const route = window.location.hash.replace(/^#/, '').split('?')[0] ||
|
||||
window.location.pathname || '/';
|
||||
// clickable and editable are resolved through the SAME selector sets
|
||||
// pkg/spec/src/web-runtime.ts uses, so the goja host (which reads this dump)
|
||||
// and the V8 host (which reads the DOM directly) cannot mean different things
|
||||
|
||||
Reference in new issue
Block a user