feat(common): add APIs to read component pieces of URL (#30055)
Without this change, the framework doesn't surface URL parts such as hostname, protocol, and port. This makes it difficult to rebuild a complete URL. This change provides new APIs to read these values. PR Close #30055
This commit is contained in:
@ -74,7 +74,11 @@ export class WebWorkerPlatformLocation extends PlatformLocation {
|
||||
|
||||
onHashChange(fn: LocationChangeListener): void { this._hashChangeListeners.push(fn); }
|
||||
|
||||
get pathname(): string { return this._location ? this._location.pathname ! : '<unknown>'; }
|
||||
get hostname(): string { return this._location ? this._location.host ! : '<unknown>'; }
|
||||
|
||||
get port(): string { return this._location ? this._location.port ! : '<unknown>'; }
|
||||
|
||||
get protocol(): string { return this._location ? this._location.protocol ! : '<unknown>'; }
|
||||
|
||||
get search(): string { return this._location ? this._location.search : '<unknown>'; }
|
||||
|
||||
|
Reference in New Issue
Block a user