I am using a template blogger with an 'ad virus'.
The virus redirect users to others pages like bet365.com.
The virus is scrambled and I can not think of a quick way to unscramble.
As I can not find the 'href' for 'ad links' in 'dom' or 'http links' for 'windows.location.href' in the javascript code since it is scrambled.
I thought about getting the final output link using some listener for redirect event JavaScript like OnHashChange and then cancel the redirect if it was an 'ad link'.
https://developer.mozilla.org/pt-BR/docs/Web/API/WindowEventHandlers/onhashchange
Where OnHashCahnge return the new URL and old URL, but only for hash urls.
So I try beforeunload
https://developer.mozilla.org/pt-BR/docs/Web/Events/beforeunload
But although I can use a function before leaving the page, it does not return the new URL