Skip to content

Commit 3cec988

Browse files
MaleDongtargos
MaleDong
authored andcommitted
doc: Remove 'dnt_helper.js'
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 <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 9914677 commit 3cec988

File tree

2 files changed

+11
-52
lines changed

2 files changed

+11
-52
lines changed

doc/api_assets/dnt_helper.js

-49
This file was deleted.

tools/doc/html.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,17 @@ function toHTML({ input, content, filename, nodeVersion, analytics }, cb) {
7979

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

0 commit comments

Comments
 (0)