fix: define window.name (#20804)

Closes https://github.com/denoland/deno/issues/20750

This matches what browsers do:
https://developer.mozilla.org/en-US/docs/Web/API/Window/name

In the future we might want to change the behavior to actually update
the process name, but that needs a bit of discussion regarding if
it needs a permission flag (that would make polyfiling `process.title`
setter really easy too).
This commit is contained in:
Bartek Iwańczuk 2023-10-09 00:12:59 +02:00 committed by GitHub
parent d41d3b8e2f
commit dfc254cd57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 1 deletions

View file

@ -37,6 +37,7 @@ declare interface Window extends EventTarget {
localStorage: Storage;
sessionStorage: Storage;
caches: CacheStorage;
name: string;
addEventListener<K extends keyof WindowEventMap>(
type: K,
@ -292,3 +293,6 @@ declare var Location: {
// The types there must first be split into window, worker and global types.
/** @category Web APIs */
declare var location: Location;
/** @category Web APIs */
declare var name: string;