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
6641 send beacon #6820
6641 send beacon #6820
Conversation
This reverts commit 1698805.
changes to fix broken getImage callback due to server responding 204
Implemented navigator.sendBeacon as alternative tracking method. Disabled by default as sendBeacon requests are POST requests (cross domain awareness). Enable with `_paq.push(["enableBeacon”]);`.
@@ -2421,8 +2423,7 @@ if (typeof Piwik !== 'object') { | |||
function getImage(request, callback) { | |||
var image = new Image(1, 1); | |||
|
|||
image.onload = function () { | |||
iterator = 0; // To avoid JSLint warning of empty block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing this line causes a JSLint warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, thank you. I did not notice any JSLint warning on that so I removed it. Maybe I ran it with wrong options. I'll put the line back in.
Thanks for the PR @fredli74 the tests will be executed after each of your commits visible on travis CI in the |
To avoid JSLint warning of empty block
Changed navigator to navigatorAlias Renamed uuid argument that sets visitorUUID in Tracker constructor to avoid collision inside getRequest
Maybe someone from the team would be interested to take a look at @fredli74 PR and maybe add tests or a review? |
Thank you for this proposed pull request. Because it was last updated more than one month ago, it is our policy to close pull requests opened for a long time without updates. If you would like to continue work on the pull request, please simply ping us to have it re-opened (after you have pushed a new commit). We hope you understand this and we look forward to seeing an update from you on this pull request or another one! Thanks. |
FYI we are implementing support for sendBeacon in #12538 |
Implemented navigator.sendBeacon as alternative tracking method. (#6641)
I choose to disabled beacon support by default as sendBeacon requests are POST requests (cross
domain awareness). It is easily enabled with
_paq.push(["enableBeacon”]);
.It uses the same format as bulk requests to avoid posting parameters as forms (resulting in a lot of overhead data).