mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
c4ea36cfde
refs https://github.com/TryGhost/Team/issues/1804 - Adds a script that is only injected when the member attribution alpha flag is enabled - This script builds a history and saves it in localStorage as `ghost-history` that contains something like this: ``` json [ { "time": 1660650730, "path": "/about/" }, { "time": 1660651730, "path": "/welcome/" } ] ``` - Keeps track of the time of every page visit, so we can correctly remove old items. I also considered saving the time separately and clearing the whole history when the saved time is older than 24h, but that would have the side effect that items older than 24h might leak into the history if you visit every 12 hours (to give an example). Plus, having objects in the history might make it easier to add other attributes to the items if we ever want to do that in the future. We also have access to the time between visits. - Added `.eslintrc` configuration for this new frontend script. This makes it easier to spot errors when developing, and follow the same syntax rules as other scripts. In the future it can allow us to require an older ECMA version in the browser script. If we like this pattern, we could also use it for other frontend scripts.
5 lines
142 B
Plaintext
5 lines
142 B
Plaintext
core/frontend/src/**/*.js
|
|
!core/frontend/src/member-attribution/*.js
|
|
core/frontend/public/**/*.js
|
|
core/server/lib/members/static/auth/**/*.js
|