mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-24 23:17:23 +00:00
docs: document the COOP false-resolve limitation of showFeedbackDialog
Under COOP the popup's opener link is severed, so the SDK deliberately
resolves false while the popup stays open and the user can still submit
(a feedback submission has no server read-back the way a permission
grant does). The documented contract ('resolves to true if the user
submitted feedback') was silently wrong on cross-origin-isolated pages —
state the limitation in the doc and the SDK jsdoc: false means 'not
confirmed', not 'not sent'.
This commit is contained in:
@@ -27,6 +27,8 @@ None.
|
||||
## Return value
|
||||
A `Promise` that resolves to `true` if the user submitted feedback, and `false` if the dialog was dismissed or feedback is unavailable. It never rejects.
|
||||
|
||||
On a website that is cross-origin isolated (COOP severs the popup's connection to your page), the promise resolves `false` even though the popup stays open and the user may still submit their feedback there. Treat `false` as "not confirmed", not "not sent".
|
||||
|
||||
## Examples
|
||||
|
||||
```html;ui-show-feedback-dialog
|
||||
|
||||
@@ -1684,7 +1684,10 @@ class UI extends EventListener {
|
||||
*
|
||||
* @returns {Promise<boolean>} `true` when the user submitted feedback,
|
||||
* `false` when the dialog was dismissed or feedback is unavailable.
|
||||
* Never rejects.
|
||||
* Never rejects. On a cross-origin-isolated page COOP severs the
|
||||
* popup's link to the opener, so the promise resolves `false` while
|
||||
* the popup stays open and the user may still submit — `false` means
|
||||
* "not confirmed", not "not sent".
|
||||
*/
|
||||
async showFeedbackDialog () {
|
||||
if ( this.env === 'app' ) {
|
||||
|
||||
Reference in New Issue
Block a user