openOutboundLink

This commit is contained in:
huanqing.shao
2019-11-29 20:07:05 +08:00
parent 5a127fc9ca
commit a880a2dd17

View File

@ -61,8 +61,15 @@ export default ({
}
}
// Vue.prototype.
let sharing = true
if (typeof window !== 'undefined') {
window.$sendGaEvent = Vue.prototype.$sendGaEvent
window.openOutboundLink = function (a) {
let url = new URL(a.href)
window.$sendGaEvent('OutboundLink: ' + url.hostname, 'OutboundLink: ' + a.innerText, 'OL:' + a.href)
}
if (location.search && (location.search.indexOf('sharing') >=0 || location.search.indexOf('from=timeline') >= 0)) {
sharing = true
window.kuboardSharing = true