Browse Source

reorder action steps, add comments

master
yggverse 2 months ago
parent
commit
68764ab024
  1. 20
      src/browser/main/tab/page.rs

20
src/browser/main/tab/page.rs

@ -84,26 +84,28 @@ impl Page {
action_page_open.connect_activate({ action_page_open.connect_activate({
let navigation = navigation.clone(); let navigation = navigation.clone();
move |_, request| { move |_, request| {
let uri = request // Convert to GString
let request = GString::from(
request
.expect("Parameter required for `page.open` action") .expect("Parameter required for `page.open` action")
.get::<String>() .get::<String>()
.expect("Parameter does not match `String`"); .expect("Parameter does not match `String`"),
let request = GString::from(uri);
navigation.set_request_text(
&request, true, // activate (page reload)
); );
// Add new history record on request change // Add new history record on request change
match navigation.history_current() { match navigation.history_current() {
Some(current) => { Some(current) => {
if current != request { if current != request {
navigation.history_add(request); navigation.history_add(request.clone());
} }
} }
None => navigation.history_add(request), None => navigation.history_add(request.clone()),
} }
// Update
navigation.set_request_text(
&request, true, // activate (page reload)
);
} }
}); });

Loading…
Cancel
Save