Update the browser, editor, settings, and installer
This commit is contained in:
+15
-11
@@ -30,6 +30,10 @@ const COMMANDS: &[&str] = &[
|
||||
"resize",
|
||||
"visible",
|
||||
"input",
|
||||
"insertText",
|
||||
"edit",
|
||||
"contextAction",
|
||||
"frameAck",
|
||||
"createProfile",
|
||||
"renameProfile",
|
||||
"duplicateProfile",
|
||||
@@ -109,15 +113,6 @@ fn executable(app: &AppHandle) -> Result<PathBuf> {
|
||||
} else {
|
||||
"RuneStone-Browser"
|
||||
};
|
||||
let packaged = app
|
||||
.path()
|
||||
.resource_dir()
|
||||
.map_err(fail)?
|
||||
.join("browser-engine")
|
||||
.join(name);
|
||||
if packaged.is_file() {
|
||||
return Ok(packaged);
|
||||
}
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
let development = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
@@ -127,6 +122,15 @@ fn executable(app: &AppHandle) -> Result<PathBuf> {
|
||||
return Ok(development);
|
||||
}
|
||||
}
|
||||
let packaged = app
|
||||
.path()
|
||||
.resource_dir()
|
||||
.map_err(fail)?
|
||||
.join("browser-engine")
|
||||
.join(name);
|
||||
if packaged.is_file() {
|
||||
return Ok(packaged);
|
||||
}
|
||||
Err("The browser runtime is missing. Build RuneStone with its browser runtime.".into())
|
||||
}
|
||||
|
||||
@@ -224,7 +228,7 @@ impl Worker {
|
||||
}
|
||||
}
|
||||
}
|
||||
Some("state") | Some("error") => {
|
||||
Some("state") | Some("error") | Some("context-menu") | Some("open-link") => {
|
||||
if let Ok(routes) = routes.lock() {
|
||||
for target in &routes.windows {
|
||||
if let Some(id) = value["tabId"].as_str() {
|
||||
@@ -410,7 +414,7 @@ impl BrowserState {
|
||||
let _ = app.emit_to(&source, "browser-tab-moved", json!({ "tabId": id }));
|
||||
return Ok(worker.routing.lock().map_err(fail)?.snapshot(result, owner));
|
||||
}
|
||||
if ["closeTab", "navigate", "back", "forward", "reload", "stop", "find", "stopFind", "openExternal", "moveToWindow", "resize", "visible", "input", "bookmark", "agentSnapshot"].contains(&command) {
|
||||
if ["closeTab", "navigate", "back", "forward", "reload", "stop", "find", "stopFind", "openExternal", "moveToWindow", "resize", "visible", "input", "insertText", "edit", "contextAction", "frameAck", "bookmark", "agentSnapshot"].contains(&command) {
|
||||
let id = args["tabId"].as_str().ok_or("Invalid browser tab.")?;
|
||||
match worker.routing.lock().map_err(fail)?.owners.get(id) {
|
||||
Some(window) if window == owner => {},
|
||||
|
||||
Reference in New Issue
Block a user