Skip to content

Commit

Permalink
Configure some default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
MaeIsBad committed Sep 24, 2024
1 parent 3a5de58 commit af2bda2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ pub struct WebviewConfig {

impl WebviewConfig {
pub async fn run(self, window: &ApplicationWindow) -> Result<WebView> {
let webview = WebView::new();
let settings = webkit6::Settings::builder()
// TODO: make these customizeable
.allow_file_access_from_file_urls(false)
.allow_universal_access_from_file_urls(false)
.enable_javascript(false)
.build();
let webview = WebView::builder().settings(&settings).build();
webview.load_uri(&self.uri);

window.set_child(Some(&webview));
Expand Down

0 comments on commit af2bda2

Please sign in to comment.