-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing proxy setter for WebContext #81
Comments
It seems like it was ignored in the |
Is there anything blocking this being included? Would you like me to open a PR to remove the ignore in Gir.toml and rerun |
@sciguy16: I don't know. You can try regenerating the bindings without the ignore to see if it works! |
Generating the bindings seemed to work, it generated these changes: diff --git a/Gir.toml b/Gir.toml
index 8f04cd1..95ff067 100644
--- a/Gir.toml
+++ b/Gir.toml
@@ -255,9 +255,6 @@ module_name = "uri_response"
name = "WebKit2.WebContext"
status = "generate"
generate_builder = true
- [[object.function]]
- name = "set_network_proxy_settings"
- ignore = true
[[object]]
name = "WebKit2.WebsiteDataManager"
diff --git a/src/auto/web_context.rs b/src/auto/web_context.rs
index a425476..f4eb54f 100644
--- a/src/auto/web_context.rs
+++ b/src/auto/web_context.rs
@@ -12,6 +12,12 @@ use crate::FaviconDatabase;
#[cfg(any(feature = "v2_26", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_26")))]
use crate::GeolocationManager;
+#[cfg(any(feature = "v2_16", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_16")))]
+use crate::NetworkProxyMode;
+#[cfg(any(feature = "v2_16", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_16")))]
+use crate::NetworkProxySettings;
use crate::Plugin;
#[cfg(any(feature = "v2_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_4")))]
@@ -325,6 +331,15 @@ pub trait WebContextExt: 'static {
#[doc(alias = "webkit_web_context_set_favicon_database_directory")]
fn set_favicon_database_directory(&self, path: Option<&str>);
+ #[cfg(any(feature = "v2_16", feature = "dox"))]
+ #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_16")))]
+ #[doc(alias = "webkit_web_context_set_network_proxy_settings")]
+ fn set_network_proxy_settings(
+ &self,
+ proxy_mode: NetworkProxyMode,
+ proxy_settings: Option<&mut NetworkProxySettings>,
+ );
+
#[doc(alias = "webkit_web_context_set_preferred_languages")]
fn set_preferred_languages(&self, languages: &[&str]);
@@ -767,6 +782,22 @@ impl<O: IsA<WebContext>> WebContextExt for O {
}
}
+ #[cfg(any(feature = "v2_16", feature = "dox"))]
+ #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_16")))]
+ fn set_network_proxy_settings(
+ &self,
+ proxy_mode: NetworkProxyMode,
+ proxy_settings: Option<&mut NetworkProxySettings>,
+ ) {
+ unsafe {
+ ffi::webkit_web_context_set_network_proxy_settings(
+ self.as_ref().to_glib_none().0,
+ proxy_mode.to_glib(),
+ proxy_settings.to_glib_none_mut().0,
+ );
+ }
+ }
+
fn set_preferred_languages(&self, languages: &[&str]) {
unsafe {
ffi::webkit_web_context_set_preferred_languages( But a |
I have encountered the dependency problem when tried the master branch, That is a nightmare. Everything failed to compile. So I have to added the feature my self ttys3@0d78fb0 And this works good for now (in production). |
@sciguy16 : Can you please open a PR with this patch? |
done, please review |
Fixed with |
set_network_proxy_settings
in theWebContextExt
trait as well as theNetworkProxyMode
enum seem to be missing.NetworkProxySettings
however exist.The text was updated successfully, but these errors were encountered: