[Error] Unhandled Promise Rejection: Not allowed by the scope
(anonymous function) (user-script:8:546:35590)
asyncFunctionResume
(anonymous function)
promiseReactionJobWithoutPromise
promiseReactionJob
Reproduction
invoke tauri command from the main index.html , works as expect
window.document
.getElementById("finance_yahoo_website")
.addEventListener("click", () => {
console.log("you just clicked [finance_yahoo_website]")
window.__TAURI__.invoke("plugin:myplugin|open_link", { "url": "open from /examples/basic-app/dist/index.html" });
window.__TAURI__.invoke("plugin:myplugin|create_window");
});
inject js file into newly created webview by plugin_builder.js_init_script(include_str!("../dist/inject.min.js"), the newly created webview will load external page like http://finance.yahoo.com
in the inject.min.js file invoke a tauri command
// Wait for the window to load
async function handleLoaded() {
console.log("done created floatDiv when window.load and invoke(open_link) for url", window.location.href)
await invoke("plugin:myplugin|open_link", { "url": "open from /plugins/myplugin/js/inject.ts" });
};
from dev-tools console found error
[Error] Unhandled Promise Rejection: Not allowed by the scope
(anonymous function) (user-script:8:546:35590)
asyncFunctionResume
(anonymous function)
promiseReactionJobWithoutPromise
promiseReactionJob
Describe the bug
[Error] Unhandled Promise Rejection: Not allowed by the scope (anonymous function) (user-script:8:546:35590) asyncFunctionResume (anonymous function) promiseReactionJobWithoutPromise promiseReactionJob
Reproduction
invoke tauri command from the main index.html , works as expect
inject js file into newly created webview by plugin_builder.js_init_script(include_str!("../dist/inject.min.js"), the newly created webview will load external page like http://finance.yahoo.com
in the inject.min.js file invoke a tauri command
from dev-tools console found error
tauri.config.json
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response