refactor(tauri): drop the certifier-only WebView debug port (P1.3d)
The Windows installer certifier opened a WebView2 CDP port through WAGGLE_CERTIFIER_WEBVIEW_DEBUG_PORT. The certifier leaves with the commercial release pipeline, so the main window is built straight from its configuration and the shipped app never opens a debugging port.
This commit is contained in:
@@ -55,9 +55,8 @@ pub fn run() {
|
|||||||
commands::onboarding::reset_first_launch,
|
commands::onboarding::reset_first_launch,
|
||||||
])
|
])
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
// Create the configured window here so the Windows certifier can
|
// The main window is configured with `create: false` and built
|
||||||
// opt into a loopback-only WebView CDP port without shipping
|
// here, before the tray, the shortcut and the sidecar start.
|
||||||
// remote debugging enabled for normal launches.
|
|
||||||
let main_window_config = app
|
let main_window_config = app
|
||||||
.config()
|
.config()
|
||||||
.app
|
.app
|
||||||
@@ -71,35 +70,7 @@ pub fn run() {
|
|||||||
"configured main window is missing",
|
"configured main window is missing",
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
let mut main_window = tauri::WebviewWindowBuilder::from_config(
|
tauri::WebviewWindowBuilder::from_config(app.handle(), &main_window_config)?.build()?;
|
||||||
app.handle(),
|
|
||||||
&main_window_config,
|
|
||||||
)?;
|
|
||||||
#[cfg(windows)]
|
|
||||||
if let Some(raw_port) = std::env::var_os("WAGGLE_CERTIFIER_WEBVIEW_DEBUG_PORT") {
|
|
||||||
let raw_port = raw_port.to_string_lossy();
|
|
||||||
let port = raw_port.parse::<u16>().map_err(|_| {
|
|
||||||
std::io::Error::new(
|
|
||||||
std::io::ErrorKind::InvalidInput,
|
|
||||||
"WAGGLE_CERTIFIER_WEBVIEW_DEBUG_PORT must be an integer",
|
|
||||||
)
|
|
||||||
})?;
|
|
||||||
if port < 1024 {
|
|
||||||
return Err(std::io::Error::new(
|
|
||||||
std::io::ErrorKind::InvalidInput,
|
|
||||||
"WAGGLE_CERTIFIER_WEBVIEW_DEBUG_PORT must be >= 1024",
|
|
||||||
)
|
|
||||||
.into());
|
|
||||||
}
|
|
||||||
let browser_args = format!(
|
|
||||||
"--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection --remote-debugging-port={port}"
|
|
||||||
);
|
|
||||||
main_window = main_window.additional_browser_args(&browser_args);
|
|
||||||
eprintln!(
|
|
||||||
"[waggle] WebView certifier debug endpoint enabled on 127.0.0.1:{port}"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
main_window.build()?;
|
|
||||||
|
|
||||||
tray::setup_tray(app.handle())?;
|
tray::setup_tray(app.handle())?;
|
||||||
|
|
||||||
|
|||||||
@@ -227,9 +227,10 @@ describe('Tauri Production Configuration', () => {
|
|||||||
expect(win.minHeight).toBe(600);
|
expect(win.minHeight).toBe(600);
|
||||||
expect(win.resizable).toBe(true);
|
expect(win.resizable).toBe(true);
|
||||||
|
|
||||||
|
// The shipped app never opens a WebView debugging port.
|
||||||
const lib = fs.readFileSync(path.join(TAURI_DIR, 'src', 'lib.rs'), 'utf-8');
|
const lib = fs.readFileSync(path.join(TAURI_DIR, 'src', 'lib.rs'), 'utf-8');
|
||||||
expect(lib).toContain('WAGGLE_CERTIFIER_WEBVIEW_DEBUG_PORT');
|
expect(lib).toContain('WebviewWindowBuilder::from_config');
|
||||||
expect(lib).toContain('additional_browser_args');
|
expect(lib).not.toContain('remote-debugging-port');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('tauri.conf.json has the auto-updater intentionally disabled for v1', () => {
|
it('tauri.conf.json has the auto-updater intentionally disabled for v1', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user