analytics icon indicating copy to clipboard operation
analytics copied to clipboard

Rework outbound links and file downloads

Open RobertJoonas opened this issue 2 years ago • 1 comments

Changes

  • Refactoring
    • Handlebars helper function to inject code for multiple script extensions at the same time
    • Extracted several functions and improved readability
  • Made the script not prevent default if it has been prevented by an external script (fixes https://github.com/plausible/analytics/issues/1941)
  • Used callbacks instead of waiting 150ms for the event request to be sent
  • Disallowed sending two events at the same time by only having one click handler
    • If using script.file-downloads.outbound-links.js and clicking an outbound download link, only outbound link click event is sent

Tests

  • [x] Automated tests have been added

Changelog

  • [x] Entry has been added to changelog

Documentation

  • [ ] Docs have been updated

Dark mode

  • [x] This PR does not change the UI

RobertJoonas avatar Sep 12 '22 10:09 RobertJoonas

BundleMon

Unchanged files (7)
Status Path Size Limits
:white_check_mark: static/css/app.css
515.19KB -
:white_check_mark: static/js/dashboard.js
295.62KB -
:white_check_mark: static/js/app.js
12.13KB -
:white_check_mark: static/js/embed.host.js
5.58KB -
:white_check_mark: static/js/embed.content.js
5.06KB -
:white_check_mark: tracker/js/plausible.js
748B -
:white_check_mark: static/js/applyTheme.js
314B -

No change in files bundle size

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history | Target branch size history

bundlemon[bot] avatar Sep 12 '22 10:09 bundlemon[bot]