Skip to content

Commit

Permalink
doc: Remove 'dnt_helper.js'
Browse files Browse the repository at this point in the history
This file is totally useless, because it's an inner-used helper that is
for publishment of doc files.

PR-URL: #22595
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
MaleDong authored and addaleax committed Sep 2, 2018
1 parent 59e5a39 commit ec75ba6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 52 deletions.
49 changes: 0 additions & 49 deletions doc/api_assets/dnt_helper.js

This file was deleted.

14 changes: 11 additions & 3 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,17 @@ function toHTML({ input, content, filename, nodeVersion, analytics }, cb) {

if (analytics) {
HTML = HTML.replace('<!-- __TRACKING__ -->', `
<script src="assets/dnt_helper.js"></script>
<script>
if (!_dntEnabled()) {
<script type="text/javascript">
// In all the browsers we'll get '1' or 'yes' (FF 32 or above) as a string
// value when enabling 'DO NOT TRACK'.
// For more:
// https://developer.mozilla.org/en-US/docs/Web/API/navigator/doNotTrack
function isDoNotTrack() {
var isDoNotTrackEnabled = navigator.doNotTrack || window.doNotTrack ||
navigator.msDoNotTrack;
return isDoNotTrackEnabled === '1' || isDoNotTrackEnabled === 'yes';
}
if (!isDoNotTrack()) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;
i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},
i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];
Expand Down

1 comment on commit ec75ba6

@tniessen
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Commit message title should be lowercase.

Please sign in to comment.