chore(rpc): add explanation comments

This commit is contained in:
2026-09-28 02:05:40 +01:00
parent 143bee3e4e
commit ed66e61de0
2 changed files with 10 additions and 1 deletions
+2
View File
@@ -164,6 +164,8 @@ export class RPCInstanceWebview extends RPCInstanceBase {
},
body: stringify(data),
}
// FiveM injects GetParentResourceName into NUI pages. Without it (page
// opened in a regular browser) the fetch fails and the call rejects.
const resourceName = window?.GetParentResourceName?.() ?? 'nui-frame-app'
return fetch(
`https://${resourceName}/${RPCEvents.LISTENER_WEB}`,