Browse Source

reorder action steps, add comments

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

24
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
.expect("Parameter required for `page.open` action") let request = GString::from(
.get::<String>() request
.expect("Parameter does not match `String`"); .expect("Parameter required for `page.open` action")
.get::<String>()
let request = GString::from(uri); .expect("Parameter does not match `String`"),
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