问题
Is it possible to have a link work in a Safari popover? I've done just about everything I can think of, but it appears that the adding links to popovers only changes the appearance, and doesn't result in anything clickable, either with href or onclick.
回答1:
You can add onclick listener on href or div
.onclick = safari.application.activeBrowserWindow.openTab().url = "http://www.yourdomain.com/";
回答2:
var link = document.querySelector('#~~~');
link.addEventListener("click", function(event) {
safari.application.activeBrowserWindow.openTab().url = "http://~~"
})
来源:https://stackoverflow.com/questions/10182952/safari-extension-popover-links