dev-test: expose location in the browser environment

The browser environment copied window, document, navigator and localStorage
onto the global, but not location. Code that reads the bare global, such as
the apps URL type decoder, threw "location is not defined" while an
ApiPromise was being created, so the api never became ready. location is now
exposed with the other window objects.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-10-11 07:22:37 +04:00
1 parent 13a6acf80d
commit 4e6a40ad14
2 files changed
+2

No files matched your search

+1
View File
@@ -21,6 +21,7 @@ describe('browser', () => {
it('contains the top-level objects', () => {
expect(all.document).toBeDefined();
expect(all.navigator).toBeDefined();
expect(location.href).toBe('http://localhost/');
});
it('contains HTML*Element', () => {
+1
View File
@@ -181,6 +181,7 @@ export function browser () {
crypto: window.crypto,
document: window.document,
localStorage: window.localStorage,
location: window.location,
navigator: window.navigator,
// window...
window