As written this seems to be implied by the idea that the Promise is resolved "with this's associated ScreenDetails object" but I don't see any specification text which defines how this object is initialized. I recommend extending the Window interface with an internal slot which holds the Promise returned by this function. Future invocations of getScreenDetails() can return this same Promise which may have already resolved.
This raises a related question about what happens when the "window-placement" permission is revoked. This should probably clear this internal slot (so that the permission check has to be rerun) as well as preventing new events for advanced observable properties from firing.
As written this seems to be implied by the idea that the
Promiseis resolved "with this's associated ScreenDetails object" but I don't see any specification text which defines how this object is initialized. I recommend extending theWindowinterface with an internal slot which holds thePromisereturned by this function. Future invocations ofgetScreenDetails()can return this samePromisewhich may have already resolved.This raises a related question about what happens when the
"window-placement"permission is revoked. This should probably clear this internal slot (so that the permission check has to be rerun) as well as preventing new events for advanced observable properties from firing.