Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTML 5 download attribute to detect download links (#7663) #7703

Merged
merged 3 commits into from Apr 22, 2015

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Apr 18, 2015

This PR aims to fix #7663

@sgiehl sgiehl added Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Apr 18, 2015
// links containing a download attribute are always downloads
equal( tracker.hook.test._getLinkType('test', 'index.html', false, true), 'download', 'download attribute' );
equal( tracker.hook.test._getLinkType('piwik_link', 'index.html', true, true), 'link', messagePrefix + ' download attribute, but link class' );
equal( tracker.hook.test._getLinkType('piwik_download', 'test.pdf', true, true), 'download', messagePrefix + ' download attribute' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure here but maybe the test returns download because the href is a file name - so maybe change test.pdf to not-a-known-file.xyz or so

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't make a difference. download extensions are overwritten a few lines above, so pdf shouldn't be recognized as download

@mattab
Copy link
Member

mattab commented Apr 20, 2015

Nice feature! left a comment otherwise looks good to me!

@mattab mattab added this to the Piwik 2.14.0 milestone Apr 22, 2015
mattab pushed a commit that referenced this pull request Apr 22, 2015
Use HTML 5 download attribute to detect download links (#7663)
@mattab mattab merged commit 245e5d1 into master Apr 22, 2015
@mattab mattab modified the milestones: Piwik 2.13.0, Piwik 2.14.0 Apr 22, 2015
@sgiehl sgiehl deleted the 7663_download_attribute branch April 26, 2015 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants