Open muwoo opened 1 month ago
I highly doubt the security team would be okay with writable: true, but i guess i could extend https://github.com/tauri-apps/tauri/pull/10300 into the other injected scripts (if that PR is actually ok to be merged). Then it should match macos/linux.
@FabianLars Thank you for your feedback. Your idea is right. If the tauri api cannot be used in the iframe, it should not be injected.
But in addition to window.__TAURI_API__
, there are two other places that need to be adjusted:
https://github.com/tauri-apps/tauri/blob/1.x/core/tauri/scripts/core.js#L11
https://github.com/tauri-apps/tauri/blob/1.x/core/tauri/src/manager.rs#L470
But in addition to window.__TAURI_API__, there are two other places that need to be adjusted:
Exactly, that's what i meant with extending the PR :)
Describe the bug
The steps to trigger this error are as follows:
iframe
subpages embedded in my main page__TAURI_IPC__
window.__TAURI_IPC__
in the sub-iframe to point to the parent window:However, this code runs normally on macos, but an error will be reported on windows:
So, can we allow the modification of the
__TAURI_IPC__
variable in the source code?Source code location: https://github.com/tauri-apps/tauri/blob/1.x/core/tauri/scripts/ipc.js#L93
Change to this:
If possible, I will submit a PR to fix this issue, looking forward to your reply
Reproduction
No response
Expected behavior
No response
Full
tauri info
outputStack trace
No response
Additional context
No response