Skip to content

Commit 76cbeef

Browse files
authored
fix: add proxy URL support to Webview at Rust-side. (#13278)
* fix: add proxy URL support to Webview * chore: add .changes file * Change file
1 parent 267368f commit 76cbeef

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changes/fix-webview-proxy-url.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': 'patch:bug'
3+
---
4+
5+
Fix JavaScript API `Webview.proxyUrl` had no effect when used in the `Webview` constructor

crates/tauri/src/webview/plugin.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ mod desktop_commands {
1515
use serde::{Deserialize, Serialize};
1616
use tauri_runtime::dpi::{Position, Size};
1717
use tauri_utils::config::{BackgroundThrottlingPolicy, WebviewUrl, WindowConfig};
18+
use url::Url;
1819

1920
use super::*;
2021
use crate::{
@@ -46,6 +47,8 @@ mod desktop_commands {
4647
window_effects: Option<WindowEffectsConfig>,
4748
#[serde(default)]
4849
incognito: bool,
50+
#[serde(alias = "proxy-url")]
51+
pub proxy_url: Option<Url>,
4952
#[serde(default)]
5053
zoom_hotkeys_enabled: bool,
5154
#[serde(default)]
@@ -70,6 +73,7 @@ mod desktop_commands {
7073
builder.webview_attributes.accept_first_mouse = config.accept_first_mouse;
7174
builder.webview_attributes.window_effects = config.window_effects;
7275
builder.webview_attributes.incognito = config.incognito;
76+
builder.webview_attributes.proxy_url = config.proxy_url;
7377
builder.webview_attributes.zoom_hotkeys_enabled = config.zoom_hotkeys_enabled;
7478
builder.webview_attributes.background_throttling = config.background_throttling;
7579
builder.webview_attributes.javascript_disabled = config.javascript_disabled;

0 commit comments

Comments
 (0)