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 targos committed Sep 3, 2018
1 parent 9914677 commit 3cec988
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
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

0 comments on commit 3cec988

Please sign in to comment.