gcarq / inox-patchset

Inox patchset tries to provide a minimal Chromium based browser with focus on privacy by disabling data transmission to Google.
BSD 2-Clause "Simplified" License
364 stars 25 forks source link

Disable metrics collection #80

Closed xsmile closed 7 years ago

xsmile commented 7 years ago

Inox apparently does not report any metrics to Google but they are collected nevertheless. This is the default behavior of chromium and it cannot be changed without altering the source.

For example calls to the UMAHISTOGRAM* macros or UserMetricsAction are all over the place and allow tracking of a wide variety of internal or user initiated processes.

The results can be visualized at chrome://histograms and chrome://user-actions.

Disabling the collections of metrics should increase privacy. In case the browser decides to send metrics back to Google, they will be empty. Besides, I can only imagine that it would result in an improved resource usage.

As for the implementation part of such a patch, it should be possible to modify the macros/functions to skip the metric generation. I will try it myself when I find the time.

EDIT: Disabling the user metrics seems easy by returning instantly in RecordComputedAction and eventually in AddActionCallback at base/metrics/user_metrics.cc. chrome://user-actions stays empty that way.

Disabling the histograms on the other hand seems rather complicated. The UMAHISTOGRAM* macros in base/metrics/histogram_macros.h are just a small subset of all calls. Replacing them with empty macros results in a lower histogram utilization but the rest is still active. Apart from that histograms are referenced in many different ways which makes it difficult to disable them as a whole. They seem to have one thing in common though: base/metrics/histogram{,_base}.cc. It should be possible to modify these files in such a way that histograms become useless.

EDIT2: Reduced the histogram amount to just a dozen by redirecting them to a single dummy histogram. The remaining ones must use a non-standed way of creation. Now it should be possible to prevent them/it from being updated over time.

xsmile commented 7 years ago

Closing in favor of #82.

Sorry for the issue spam, I didn't think I can find the solution that quickly.