// Add the mouse listeners for the above functions
function linkHover() {
	window.onmouseover = function(event) {
		if (event.target.matches('a')) {
			window.webkit.messageHandlers.mouseDidEnter.postMessage(event.target.href);
		}
	}
	window.onmouseout = function(event) {
		if (event.target.matches('a')) {
			window.webkit.messageHandlers.mouseDidExit.postMessage(event.target.href);
		}
	}
}

function postRenderProcessing() {
	linkHover()
}

// Add the mouse listeners for the above functions
function linkHover() {
	window.onmouseover = function(event) {
		var closestAnchor = event.target.closest('a')
		if (closestAnchor) {
			window.webkit.messageHandlers.mouseDidEnter.postMessage(closestAnchor.href);
		}
	}
	window.onmouseout = function(event) {
		var closestAnchor = event.target.closest('a')
		if (closestAnchor) {
			window.webkit.messageHandlers.mouseDidExit.postMessage(closestAnchor.href);
		}
	}
}

function postRenderProcessing() {
	linkHover()
}

Make mouseover/mouseout work with anchors that nest
Make mouseover/mouseout work with anchors that nest
