mirror of
https://github.com/rilaxik/fivem-rpc.git
synced 2026-09-28 01:29:13 +00:00
chore(rpc): add explanation comments
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user