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

doc: Remove 'dnt_helper.js' #22595

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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