Created
January 29, 2024 15:02
-
-
Save thewh1teagle/57800b7b093f4373ecffe548d7f529b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy | |
// SPDX-License-Identifier: Apache-2.0 | |
// SPDX-License-Identifier: MIT | |
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] | |
use std::str::FromStr; | |
use tauri::Manager; | |
use url::Url; | |
fn main() { | |
tauri::Builder::default() | |
.setup(|app| { | |
let window = tauri::WebviewWindowBuilder::new(app, "main", tauri::WebviewUrl::External(Url::from_str("https://twitter.com/").unwrap())) | |
.initialization_script(r#" | |
document.addEventListener('DOMContentLoaded', () => { | |
window.TAURI.core.invoke('test'); | |
}); | |
"#) | |
.build() | |
.expect("failed to create window"); | |
Ok(()) | |
}) | |
.run(tauri::generate_context!( | |
"../../examples/helloworld/tauri.conf.json" | |
)) | |
.expect("error while running tauri application"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment