[Bug] window.print() fails on macOS: "webview.print not allowed" (missing core:webview:allow-print permission)
Search before asking
- I searched in the issues and found nothing similar.
Pake version
Search before asking
- I searched in the issues and found nothing similar.
Pake version
<3.17.2>
Rust version
rustc 1.98.1 (48a229cea 2026-09-01)
Package Manager
npm
System version
macOS <14.4.1> (Apple Silicon)
Node.js version
<v24.21.0>
Build Command
pake --config app.json --debugapp.json:
{
"url": "./dist",
"name": "MyApp",
"hideTitleBar": true
}Minimal reproduce step
- Create a local page
test/index.html:
<!doctype html>
<html>
<body>
<button onclick="window.print()">Print</button>
</body>
</html>- Package it:
pake ./test --name PakeTest --debug - Open the app and click the Print button.
What did you expect to see?
The native macOS print dialog opens.
What did you see instead?
Nothing happens. The DevTools console shows:
Unhandled Promise Rejection: webview.print not allowed. Permissions associated with this command: core:webview:allow-printAnything else?
Adding "core:webview:allow-print" to the permissions array in src-tauri/capabilities/default.json of the installed pake-cli and rebuilding fixes it: the print dialog opens and printing works.
Could this permission be included by default? Many web apps rely on window.print() (invoices, reports, tickets).
Possibly related: in the same build, window.alert(), window.confirm() and window.prompt() also do not show any dialog on macOS. I can open a separate issue for that if you prefer.
Are you willing to submit a PR?
- I'm willing to submit a PR!
Rust version
rustc 1.98.1 (48a229cea 2026-09-01)
Package Manager
npm
System version
macOS <14.x> (Apple Silicon)
Node.js version
<v24.21.0>
Build Command
pake --config app.json --debugapp.json:
{
"url": "./dist",
"name": "MyApp",
"hideTitleBar": true
}Minimal reproduce step
- Create a local page
test/index.html:
<!doctype html>
<html>
<body>
<button onclick="window.print()">Print</button>
</body>
</html>- Package it:
pake ./test --name PakeTest --debug - Open the app and click the Print button.
What did you expect to see?
The native macOS print dialog opens.
What did you see instead?
Nothing happens. The DevTools console shows:
Unhandled Promise Rejection: webview.print not allowed. Permissions associated with this command: core:webview:allow-printAnything else?
Adding "core:webview:allow-print" to the permissions array in src-tauri/capabilities/default.json of the installed pake-cli and rebuilding fixes it: the print dialog opens and printing works.
Could this permission be included by default? Many web apps rely on window.print() (invoices, reports, tickets).
Possibly related: in the same build, window.alert(), window.confirm() and window.prompt() also do not show any dialog on macOS. I can open a separate issue for that if you prefer.
Are you willing to submit a PR?
- I'm willing to submit a PR!
Source: tw93/Pake