Safari Extension Popover Links

谁说我不能喝 提交于 2019-12-07 04:26:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!