mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
fix external links handler on middle click
This commit is contained in:
parent
c67e2315e5
commit
2a9564bec6
1 changed files with 19 additions and 2 deletions
|
|
@ -264,7 +264,7 @@ impl Reader {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
};
|
}; // @TODO common handler?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -285,7 +285,24 @@ impl Reader {
|
||||||
for tag in iter.tags() {
|
for tag in iter.tags() {
|
||||||
// Tag is link
|
// Tag is link
|
||||||
if let Some(uri) = _links_.get(&tag) {
|
if let Some(uri) = _links_.get(&tag) {
|
||||||
return action_tab_open.activate(Some(&uri.to_string().to_variant()));
|
// Select link handler by scheme
|
||||||
|
return match uri.scheme().as_str() {
|
||||||
|
"gemini" => {
|
||||||
|
// Open new page in browser
|
||||||
|
action_tab_open.activate(Some(&uri.to_string().to_variant()));
|
||||||
|
}
|
||||||
|
// Scheme not supported, delegate
|
||||||
|
_ => UriLauncher::new(&uri.to_str()).launch(
|
||||||
|
None::<&Window>,
|
||||||
|
None::<&Cancellable>,
|
||||||
|
|result| {
|
||||||
|
if let Err(error) = result {
|
||||||
|
// @TODO
|
||||||
|
println!("Could not delegate launch action: {error}")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}; // @TODO common handler?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue