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

piwik.js modernization #8515

Open
robocoder opened this issue Aug 8, 2015 · 1 comment
Open

piwik.js modernization #8515

robocoder opened this issue Aug 8, 2015 · 1 comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.

Comments

@robocoder
Copy link
Contributor

I'm AFK so I can't test this and submit a PR, but overall is fairly trivial...

The now variable here isn't being used in logPageView(), so it can be removed:

now = new Date(),

I suggest getting rid of this workaround:

Date.prototype.getTimeAlias = Date.prototype.getTime;

and change the many occurrences of something = new Date() ... something.getTime() to +new Date (the '+' casts the object to an integer, thus yielding the time in milliseconds).

It's been 4 years, I recommend removing the JSON polyfill as native browser support has improved (and this line means it can no longer polyfill broken JSON implementations):

JSON2 = window.JSON || {};

Wrap utf8_encode and sha1 into a polyfill for crypto.subtle.digest.

@mattab
Copy link
Member

mattab commented Sep 19, 2015

Thanks for suggestions @robocoder. I think @dhoko also suggested some of these before. pull request(s) are most welcome :-)

@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Sep 19, 2015
@mattab mattab added this to the Short term milestone Sep 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

2 participants