Android Question Webview Obtaining Final Url After Redirect

DawningTruth

Active Member
Licensed User
Many banner add networks redirect visitors to another website.

In my app I need to create a history manually for various technical reasons.

These redirects are ending up in my history. How can I detect the final Url that a page redirects to and then just put that Url in my history.

One option would be to wait for the page to load first before adding it to history, but these days there are so many 3rd party scripts on pages that some of them are not finished loading before the visitor has moved on to the next page. So I think this needs to be done in the _OverrideUrl event.

Any suggestions?
 

DawningTruth

Active Member
Licensed User
Thx Erel. Here is a detailed URL log which includes your Log code.

Note: My logs are in reverse chronological order (Newest at the top, oldest at the bottom)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Toyota Argo Banner Add Example:
- Toyota Redirect

==============================================
>> myWebview_OverrideUrl
==============================================
History
http://www.toyota.co.za/ranges/yari...v24AIVUzrgCh2qWQTnEAEYASAAEgK5ovD_BwE#finance
==============================================
>> myWebview_OverrideUrl
==============================================
History
http://www.toyota.co.za/mobi/vehicl...v24aivuzrgch2qwqtneaeyasaaegk5ovd_bwe#finance
http://www.toyota.co.za/ranges/yari...v24AIVUzrgCh2qWQTnEAEYASAAEgK5ovD_BwE#finance
==============================================
>> myWebview_PageFinished
==============================================
History
http://www.toyota.co.za/mobi/vehicl...v24aivuzrgch2qwqtneaeyasaaegk5ovd_bwe#finance
http://www.toyota.co.za/ranges/yari...v24AIVUzrgCh2qWQTnEAEYASAAEgK5ovD_BwE#finance

======== Erel Log ============
08:38:07: [IsInitialized=true, UrlID=5, UrlValue=[URL]https://ewn.co.za[/URL]
]
======== END Erel Log ============

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Direct Debit Banner Add Example:
- Google Lead Services Redirect

==============================================
>> myWebview_OverrideUrl
==============================================
History
https://googleads.g.doubleclick.net...MIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
==============================================
>> myWebview_OverrideUrl
==============================================
History
https://www.googleadservices.com/pa...MIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://googleads.g.doubleclick.net...MIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
==============================================
>> myWebview_OverrideUrl
==============================================
History
https://www.directdebit.co.za/?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://www.googleadservices.com/pa...MIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://googleads.g.doubleclick.net...MIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
==============================================
>> myWebview_PageFinished
==============================================
History
https://www.directdebit.co.za/?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://www.googleadservices.com/pa...MIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://googleads.g.doubleclick.net...MIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE

======== Erel Log ============
08:45:33: [IsInitialized=true, UrlID=5, UrlValue=[URL]https://ewn.co.za[/URL]
]
======== END Erel Log ============

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
Upvote 0

DawningTruth

Active Member
Licensed User
Thx Erel. Here is a detailed URL log which includes your Log code.

Note: My logs are in reverse chronological order (Newest at the top, oldest at the bottom)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Toyota Argo Banner Add Example:
- Toyota Redirect

==============================================
>> myWebview_OverrideUrl
==============================================
History
http://www.toyota.co.za/ranges/yari...v24AIVUzrgCh2qWQTnEAEYASAAEgK5ovD_BwE#finance
==============================================
>> myWebview_OverrideUrl
==============================================
History
http://www.toyota.co.za/mobi/vehicl...v24aivuzrgch2qwqtneaeyasaaegk5ovd_bwe#finance
http://www.toyota.co.za/ranges/yari...v24AIVUzrgCh2qWQTnEAEYASAAEgK5ovD_BwE#finance
==============================================
>> myWebview_PageFinished
==============================================
History
http://www.toyota.co.za/mobi/vehicl...v24aivuzrgch2qwqtneaeyasaaegk5ovd_bwe#finance
http://www.toyota.co.za/ranges/yari...v24AIVUzrgCh2qWQTnEAEYASAAEgK5ovD_BwE#finance

======== Erel Log ============
08:38:07: [IsInitialized=true, UrlID=5, UrlValue=[URL]https://ewn.co.za[/URL]
]
======== END Erel Log ============

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Direct Debit Banner Add Example:
- Google Lead Services Redirect

==============================================
>> myWebview_OverrideUrl
==============================================
History
https://googleads.g.doubleclick.net/aclk?sa=l&ai=Clp3pbrKEXLeXG4rYgAf6yp-4CYCjo65Vsv2Cz7AFz8yP5cwIEAEgppj6HGDH3f-NhCagAZHQqcwDyAEDqQJQDbeWR5dyPuACAKgDAcgDCKoEgAJP0E6CHghpzKSQ2iTOaV20p61EIAw7hLbSOxM5nNVWq3b2BJTRjQdrUoH9ADJazmkwN6E0korknamtV_NEzy7CVUN0DFCau3HeKBqh1gjzPNtfLswJV8ugTazdSzklMGXo6zhfJp9EcY-SHQnlvCM3vsd_8uaoNBwcVQJzt4Jm7pdJoS9xDgochq6DMyPmmVWqrv4ki1XV4qUsu-yhzG_HgZHXs5gn1xT-CRFkEAsKAVssXo2KLDFh8E3VDb0Bgufh95XZz65cHQLiU5PwMUq0rEmZbiawbDSM_AHMokfVQV4CxY0oUZbGw2sJCIOvxCSoSMkB7EzRoNTa6CfZ7ncdwATGyuLtmAHgBAGIBY68x4UDoAYD2AYCgAfXr9YzqAeOzhuoB9XJG6gHqAaoB9nLG6gHz8wbqAemvhvYBwGgCLrkPrAIAtIIBwiAYRABGAHyCBthZHgtc3Vic3luLTY0NzQyMjMxNjE3NTQ1NTWxCWKHW6i62j7JgAoD2BMCghQLGglld24uY28uemE&ae=1&num=1&sig=AOD64_0mvIgVxlBzrUrhfMU6dzZNfXEP8Q&client=ca-pub-2117324400584663&nx=172&ny=78&nb=2&adurl=https://www.directdebit.co.za?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
==============================================
>> myWebview_OverrideUrl
==============================================
History
https://www.googleadservices.com/pagead/aclk?sa=L&ai=Clp3pbrKEXLeXG4rYgAf6yp-4CYCjo65Vsv2Cz7AFz8yP5cwIEAEgppj6HGDH3f-NhCagAZHQqcwDyAEDqQJQDbeWR5dyPuACAKgDAcgDCKoEgAJP0E6CHghpzKSQ2iTOaV20p61EIAw7hLbSOxM5nNVWq3b2BJTRjQdrUoH9ADJazmkwN6E0korknamtV_NEzy7CVUN0DFCau3HeKBqh1gjzPNtfLswJV8ugTazdSzklMGXo6zhfJp9EcY-SHQnlvCM3vsd_8uaoNBwcVQJzt4Jm7pdJoS9xDgochq6DMyPmmVWqrv4ki1XV4qUsu-yhzG_HgZHXs5gn1xT-CRFkEAsKAVssXo2KLDFh8E3VDb0Bgufh95XZz65cHQLiU5PwMUq0rEmZbiawbDSM_AHMokfVQV4CxY0oUZbGw2sJCIOvxCSoSMkB7EzRoNTa6CfZ7ncdwATGyuLtmAHgBAGIBY68x4UDoAYD2AYCgAfXr9YzqAeOzhuoB9XJG6gHqAaoB9nLG6gHz8wbqAemvhvYBwGgCLrkPrAIAtIIBwiAYRABGAHyCBthZHgtc3Vic3luLTY0NzQyMjMxNjE3NTQ1NTWxCWKHW6i62j7JgAoD2BMCghQLGglld24uY28uemE&ae=1&num=1&client=ca-pub-2117324400584663&nx=172&ny=78&nb=2&dblrd=1&val=ChAyMjNiZDY5YjFmYTQwMDcyEPvckOQFGgh227NpaKHj5iABKAE&sig=AOD64_3vYySgLx3BrPj08jZ_nzzq3JUXUw&adurl=https://www.directdebit.co.za?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://googleads.g.doubleclick.net/aclk?sa=l&ai=Clp3pbrKEXLeXG4rYgAf6yp-4CYCjo65Vsv2Cz7AFz8yP5cwIEAEgppj6HGDH3f-NhCagAZHQqcwDyAEDqQJQDbeWR5dyPuACAKgDAcgDCKoEgAJP0E6CHghpzKSQ2iTOaV20p61EIAw7hLbSOxM5nNVWq3b2BJTRjQdrUoH9ADJazmkwN6E0korknamtV_NEzy7CVUN0DFCau3HeKBqh1gjzPNtfLswJV8ugTazdSzklMGXo6zhfJp9EcY-SHQnlvCM3vsd_8uaoNBwcVQJzt4Jm7pdJoS9xDgochq6DMyPmmVWqrv4ki1XV4qUsu-yhzG_HgZHXs5gn1xT-CRFkEAsKAVssXo2KLDFh8E3VDb0Bgufh95XZz65cHQLiU5PwMUq0rEmZbiawbDSM_AHMokfVQV4CxY0oUZbGw2sJCIOvxCSoSMkB7EzRoNTa6CfZ7ncdwATGyuLtmAHgBAGIBY68x4UDoAYD2AYCgAfXr9YzqAeOzhuoB9XJG6gHqAaoB9nLG6gHz8wbqAemvhvYBwGgCLrkPrAIAtIIBwiAYRABGAHyCBthZHgtc3Vic3luLTY0NzQyMjMxNjE3NTQ1NTWxCWKHW6i62j7JgAoD2BMCghQLGglld24uY28uemE&ae=1&num=1&sig=AOD64_0mvIgVxlBzrUrhfMU6dzZNfXEP8Q&client=ca-pub-2117324400584663&nx=172&ny=78&nb=2&adurl=https://www.directdebit.co.za?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
==============================================
>> myWebview_OverrideUrl
==============================================
History
https://www.directdebit.co.za/?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://www.googleadservices.com/pagead/aclk?sa=L&ai=Clp3pbrKEXLeXG4rYgAf6yp-4CYCjo65Vsv2Cz7AFz8yP5cwIEAEgppj6HGDH3f-NhCagAZHQqcwDyAEDqQJQDbeWR5dyPuACAKgDAcgDCKoEgAJP0E6CHghpzKSQ2iTOaV20p61EIAw7hLbSOxM5nNVWq3b2BJTRjQdrUoH9ADJazmkwN6E0korknamtV_NEzy7CVUN0DFCau3HeKBqh1gjzPNtfLswJV8ugTazdSzklMGXo6zhfJp9EcY-SHQnlvCM3vsd_8uaoNBwcVQJzt4Jm7pdJoS9xDgochq6DMyPmmVWqrv4ki1XV4qUsu-yhzG_HgZHXs5gn1xT-CRFkEAsKAVssXo2KLDFh8E3VDb0Bgufh95XZz65cHQLiU5PwMUq0rEmZbiawbDSM_AHMokfVQV4CxY0oUZbGw2sJCIOvxCSoSMkB7EzRoNTa6CfZ7ncdwATGyuLtmAHgBAGIBY68x4UDoAYD2AYCgAfXr9YzqAeOzhuoB9XJG6gHqAaoB9nLG6gHz8wbqAemvhvYBwGgCLrkPrAIAtIIBwiAYRABGAHyCBthZHgtc3Vic3luLTY0NzQyMjMxNjE3NTQ1NTWxCWKHW6i62j7JgAoD2BMCghQLGglld24uY28uemE&ae=1&num=1&client=ca-pub-2117324400584663&nx=172&ny=78&nb=2&dblrd=1&val=ChAyMjNiZDY5YjFmYTQwMDcyEPvckOQFGgh227NpaKHj5iABKAE&sig=AOD64_3vYySgLx3BrPj08jZ_nzzq3JUXUw&adurl=https://www.directdebit.co.za?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://googleads.g.doubleclick.net/aclk?sa=l&ai=Clp3pbrKEXLeXG4rYgAf6yp-4CYCjo65Vsv2Cz7AFz8yP5cwIEAEgppj6HGDH3f-NhCagAZHQqcwDyAEDqQJQDbeWR5dyPuACAKgDAcgDCKoEgAJP0E6CHghpzKSQ2iTOaV20p61EIAw7hLbSOxM5nNVWq3b2BJTRjQdrUoH9ADJazmkwN6E0korknamtV_NEzy7CVUN0DFCau3HeKBqh1gjzPNtfLswJV8ugTazdSzklMGXo6zhfJp9EcY-SHQnlvCM3vsd_8uaoNBwcVQJzt4Jm7pdJoS9xDgochq6DMyPmmVWqrv4ki1XV4qUsu-yhzG_HgZHXs5gn1xT-CRFkEAsKAVssXo2KLDFh8E3VDb0Bgufh95XZz65cHQLiU5PwMUq0rEmZbiawbDSM_AHMokfVQV4CxY0oUZbGw2sJCIOvxCSoSMkB7EzRoNTa6CfZ7ncdwATGyuLtmAHgBAGIBY68x4UDoAYD2AYCgAfXr9YzqAeOzhuoB9XJG6gHqAaoB9nLG6gHz8wbqAemvhvYBwGgCLrkPrAIAtIIBwiAYRABGAHyCBthZHgtc3Vic3luLTY0NzQyMjMxNjE3NTQ1NTWxCWKHW6i62j7JgAoD2BMCghQLGglld24uY28uemE&ae=1&num=1&sig=AOD64_0mvIgVxlBzrUrhfMU6dzZNfXEP8Q&client=ca-pub-2117324400584663&nx=172&ny=78&nb=2&adurl=https://www.directdebit.co.za?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
==============================================
>> myWebview_PageFinished
==============================================
History
https://www.directdebit.co.za/?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://www.googleadservices.com/pagead/aclk?sa=L&ai=Clp3pbrKEXLeXG4rYgAf6yp-4CYCjo65Vsv2Cz7AFz8yP5cwIEAEgppj6HGDH3f-NhCagAZHQqcwDyAEDqQJQDbeWR5dyPuACAKgDAcgDCKoEgAJP0E6CHghpzKSQ2iTOaV20p61EIAw7hLbSOxM5nNVWq3b2BJTRjQdrUoH9ADJazmkwN6E0korknamtV_NEzy7CVUN0DFCau3HeKBqh1gjzPNtfLswJV8ugTazdSzklMGXo6zhfJp9EcY-SHQnlvCM3vsd_8uaoNBwcVQJzt4Jm7pdJoS9xDgochq6DMyPmmVWqrv4ki1XV4qUsu-yhzG_HgZHXs5gn1xT-CRFkEAsKAVssXo2KLDFh8E3VDb0Bgufh95XZz65cHQLiU5PwMUq0rEmZbiawbDSM_AHMokfVQV4CxY0oUZbGw2sJCIOvxCSoSMkB7EzRoNTa6CfZ7ncdwATGyuLtmAHgBAGIBY68x4UDoAYD2AYCgAfXr9YzqAeOzhuoB9XJG6gHqAaoB9nLG6gHz8wbqAemvhvYBwGgCLrkPrAIAtIIBwiAYRABGAHyCBthZHgtc3Vic3luLTY0NzQyMjMxNjE3NTQ1NTWxCWKHW6i62j7JgAoD2BMCghQLGglld24uY28uemE&ae=1&num=1&client=ca-pub-2117324400584663&nx=172&ny=78&nb=2&dblrd=1&val=ChAyMjNiZDY5YjFmYTQwMDcyEPvckOQFGgh227NpaKHj5iABKAE&sig=AOD64_3vYySgLx3BrPj08jZ_nzzq3JUXUw&adurl=https://www.directdebit.co.za?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE
https://googleads.g.doubleclick.net/aclk?sa=l&ai=Clp3pbrKEXLeXG4rYgAf6yp-4CYCjo65Vsv2Cz7AFz8yP5cwIEAEgppj6HGDH3f-NhCagAZHQqcwDyAEDqQJQDbeWR5dyPuACAKgDAcgDCKoEgAJP0E6CHghpzKSQ2iTOaV20p61EIAw7hLbSOxM5nNVWq3b2BJTRjQdrUoH9ADJazmkwN6E0korknamtV_NEzy7CVUN0DFCau3HeKBqh1gjzPNtfLswJV8ugTazdSzklMGXo6zhfJp9EcY-SHQnlvCM3vsd_8uaoNBwcVQJzt4Jm7pdJoS9xDgochq6DMyPmmVWqrv4ki1XV4qUsu-yhzG_HgZHXs5gn1xT-CRFkEAsKAVssXo2KLDFh8E3VDb0Bgufh95XZz65cHQLiU5PwMUq0rEmZbiawbDSM_AHMokfVQV4CxY0oUZbGw2sJCIOvxCSoSMkB7EzRoNTa6CfZ7ncdwATGyuLtmAHgBAGIBY68x4UDoAYD2AYCgAfXr9YzqAeOzhuoB9XJG6gHqAaoB9nLG6gHz8wbqAemvhvYBwGgCLrkPrAIAtIIBwiAYRABGAHyCBthZHgtc3Vic3luLTY0NzQyMjMxNjE3NTQ1NTWxCWKHW6i62j7JgAoD2BMCghQLGglld24uY28uemE&ae=1&num=1&sig=AOD64_0mvIgVxlBzrUrhfMU6dzZNfXEP8Q&client=ca-pub-2117324400584663&nx=172&ny=78&nb=2&adurl=https://www.directdebit.co.za?gclid=EAIaIQobChMIt4aX3fz24AIVCizgCh165QeXEAEYASAAEgLQifD_BwE

======== Erel Log ============
08:45:33: [IsInitialized=true, UrlID=5, UrlValue=[URL]https://ewn.co.za[/URL]
]
======== END Erel Log ============

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Hi Erel,

Apologies, those are my logs which show how the pages are loading. Your requested code is in there as well.

Here it is:

======== Erel Log ============
08:45:33: [IsInitialized=true, UrlID=5, UrlValue=[URL]https://ewn.co.za[/URL]
]
======== END Erel Log ============
 
Last edited:
Upvote 0

DawningTruth

Active Member
Licensed User
I've decided to abandon this course of action. The reason being that some of my test websites such as ewn.co.za expect a certain behaviour from the browser and to make my browser compatible will necessitate very complex coding. I will find another way to obtain my objectives and stick to the standard webview.back and webview.forward methods.
 
Upvote 0
Top