Track start and end web request at iFrame

Hello, I am using an iFrame to load external URL.
It works good for everything except I donno how to track where the user click.

It could be only tracked when the iframe finish loading.
But I can’t even add a loading spinner when another request was sent.

I put more detail on SO.

I hope someone could help.
Thanks

for But I can’t even add a loading spinner when another request was sent.

if you are using ionic you can call $ionicLoading.show() on the load function before making the url call in iframeOnload() function.
and $ionicLoading.hide() on the iframeLoadedCallBack() function

I added an onClick function for the whole document in the iframe and trace every click event in it

inside the iframeLoadedCallback()

var webFrame = angular.element(document.getElementById(‘webFrame’));
webFrame[0].contentDocument.onclick = $scope.clickOnIframe;

Hope it helps someone has similar question.