Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMatthieu Aubry <matt@piwik.org>2015-04-23 02:09:08 +0300
committerMatthieu Aubry <matt@piwik.org>2015-04-23 02:09:08 +0300
commit245e5d13fbfbf5e05bba544f9346dcdde047554e (patch)
treecd100ace925d02943114171e38ae6765e410989c /js
parente5f6e8b2df718b56b39a2edc3cbee056159e7656 (diff)
parentd9fd1c3f80271bb735c5e6afda68d99ec2f94fad (diff)
Merge pull request #7703 from piwik/7663_download_attribute
Use HTML 5 download attribute to detect download links (#7663)
Diffstat (limited to 'js')
-rw-r--r--js/piwik.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/piwik.js b/js/piwik.js
index cb78dee865..50d589969e 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -3224,7 +3224,7 @@ if (typeof Piwik !== 'object') {
/*
* Link or Download?
*/
- function getLinkType(className, href, isInLink) {
+ function getLinkType(className, href, isInLink, hasDownloadAttribute) {
if (startsUrlWithTrackerUrl(href)) {
return 0;
}
@@ -3240,7 +3240,7 @@ if (typeof Piwik !== 'object') {
return 'link';
}
- if (downloadPattern.test(className) || downloadExtensionsPattern.test(href)) {
+ if (hasDownloadAttribute || downloadPattern.test(className) || downloadExtensionsPattern.test(href)) {
return 'download';
}
@@ -3298,7 +3298,7 @@ if (typeof Piwik !== 'object') {
if (!scriptProtocol.test(sourceHref)) {
// track outlinks and all downloads
- var linkType = getLinkType(sourceElement.className, sourceHref, isSiteHostName(sourceHostName));
+ var linkType = getLinkType(sourceElement.className, sourceHref, isSiteHostName(sourceHostName), query.hasNodeAttribute(sourceElement, 'download'));
if (linkType) {
return {