diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2018-09-25 16:46:03 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-10-04 07:18:23 +0200 |
commit | df6a1306e8ed9fa50c8aa44bc037d2a34f61bfc8 (patch) | |
tree | d79a5905eb149f80d088e81134554578a96bb99d /tools | |
parent | 9577946bedbe610bbe16782783ab2fca407425c6 (diff) | |
download | android-node-v8-df6a1306e8ed9fa50c8aa44bc037d2a34f61bfc8.tar.gz android-node-v8-df6a1306e8ed9fa50c8aa44bc037d2a34f61bfc8.tar.bz2 android-node-v8-df6a1306e8ed9fa50c8aa44bc037d2a34f61bfc8.zip |
doc: remove GA tracking
The Google Analytics tracking wasn't wholly uncontroversial and hasn't
been used in practice. Remove it.
PR-URL: https://github.com/nodejs/node/pull/23083
Fixes: https://github.com/nodejs/node/issues/22652
Refs: https://github.com/nodejs/node/pull/6601
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/doc/generate.js | 5 | ||||
-rw-r--r-- | tools/doc/html.js | 26 |
2 files changed, 2 insertions, 29 deletions
diff --git a/tools/doc/generate.js b/tools/doc/generate.js index 28e09d003f..7ca47e2ae0 100644 --- a/tools/doc/generate.js +++ b/tools/doc/generate.js @@ -38,7 +38,6 @@ const json = require('./json'); const args = process.argv.slice(2); let filename = null; let nodeVersion = null; -let analytics = null; let outputDir = null; let apilinks = {}; @@ -47,8 +46,6 @@ args.forEach(function(arg) { filename = arg; } else if (arg.startsWith('--node-version=')) { nodeVersion = arg.replace(/^--node-version=/, ''); - } else if (arg.startsWith('--analytics=')) { - analytics = arg.replace(/^--analytics=/, ''); } else if (arg.startsWith('--output-directory=')) { outputDir = arg.replace(/^--output-directory=/, ''); } else if (arg.startsWith('--apilinks=')) { @@ -85,7 +82,7 @@ fs.readFile(filename, 'utf8', (er, input) => { const basename = path.basename(filename, '.md'); html.toHTML( - { input, content, filename, nodeVersion, analytics }, + { input, content, filename, nodeVersion }, (err, html) => { const target = path.join(outputDir, `${basename}.html`); if (err) throw err; diff --git a/tools/doc/html.js b/tools/doc/html.js index c0a94b6534..fd74563dd7 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -62,7 +62,7 @@ const gtocHTML = unified() const templatePath = path.join(docPath, 'template.html'); const template = fs.readFileSync(templatePath, 'utf8'); -function toHTML({ input, content, filename, nodeVersion, analytics }, cb) { +function toHTML({ input, content, filename, nodeVersion }, cb) { filename = path.basename(filename, '.md'); const id = filename.replace(/\W+/g, '-'); @@ -77,30 +77,6 @@ function toHTML({ input, content, filename, nodeVersion, analytics }, cb) { .replace('__EDIT_ON_GITHUB__', editOnGitHub(filename)) .replace('__CONTENT__', content.toString()); - if (analytics) { - HTML = HTML.replace('<!-- __TRACKING__ -->', ` - <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]; - a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document, - 'script','//www.google-analytics.com/analytics.js','ga'); - ga('create', '${analytics}', 'auto'); - ga('send', 'pageview'); - } - </script>`); - } - const docCreated = input.match( /<!--\s*introduced_in\s*=\s*v([0-9]+)\.([0-9]+)\.[0-9]+\s*-->/); if (docCreated) { |