Open ktecho opened 1 month ago
Also, the documentation is not updated, because if I copy the base.json
from here https://beta.tauri.app/plugin/http-client/ or here https://v2.tauri.app/reference/javascript/http/, it will complain that "identifier" is not found. That's why I put "identifier" twice in my "base.json".
Also, the documentation is not updated, because if I copy the
base.json
from here beta.tauri.app/plugin/http-client or here v2.tauri.app/reference/javascript/http, it will complain that "identifier" is not found. That's why I put "identifier" twice in my "base.json".
the first identifier is the identifier of the capability file, not the permission to be used
Also, the documentation is not updated, because if I copy the
base.json
from here beta.tauri.app/plugin/http-client or here v2.tauri.app/reference/javascript/http, it will complain that "identifier" is not found. That's why I put "identifier" twice in my "base.json".the first identifier is the identifier of the capability file, not the permission to be used
What would be the identifier for the base.json
file? I tried with base
, but it doesn't work.
I changed base.json to this:
{
"identifier": "http.phoenix",
"permissions": [
{
"identifier": "http:default",
"local": true,
"windows": ["*"],
"allow": [
{
"url": "http://localhost:9740/*"
},
{
"url": "http://**/"
}
]
}
]
}
and added this to tauri.conf.json:
"security": {
"csp": null,
"capabilities": ["http.phoenix"]
}
}
and now I get this:
Unhandled Promise Rejection: http.fetch not allowed on window main, webview main, allowed windows: , allowed webviews: , referenced by capability: http.phoenix, permission: default
I've tried with "windows": ["*"],
and "windows": ["main"],
, but it doesn't work.
I recommend using this steps to create your app so your http plugin is configured and working in v2: https://github.com/tauri-apps/plugins-workspace/issues/1484#issuecomment-2222169301
I get this when using latest version of "HTTP client" plugin. I also tested the git version of both parts (rust and js), with the same result:
+page.svelte
Cargo.toml
package.json
base.json
Full tauri info output