We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 941fd24 commit b8696a8Copy full SHA for b8696a8
src/main.rs
@@ -29,7 +29,14 @@ pub fn main() {
29
30
pub async fn track_previous_url() {
31
let previous_domain = if document().referrer() == "" {
32
- "Undefined".to_owned()
+ let mut res = "Undefined".to_owned();
33
+ if let Some(from) = document().location() {
34
+ if let Ok(url) = Url::new(&from.href().unwrap_or_default()) {
35
+ let search_params = url.search_params();
36
+ res = search_params.get("from").unwrap_or("Undefined".to_string());
37
+ }
38
39
+ res
40
} else {
41
let address = document().referrer();
42
let url = Url::new(&address).unwrap();
0 commit comments