carbonalyser / Carbonalyser

The add-on "Carbonalyser" allows to visualize the electricity consumption and greenhouse gases (GHG) emissions that your Internet browsing leads to.
https://theshiftproject.org/en/carbonalyser-browser-extension/
MIT License
149 stars 37 forks source link

Ignore data from localhost #9

Open tidusia opened 5 years ago

tidusia commented 5 years ago

Hi !

Thanks for your very nice plugin.

By developing a React project, I've seen that the http://localhost:8080 is included in the analysis.

Maybe the plugin should ignore such cases because there is no internet bandwith usage associated with localhost project (exept API resquests or network images for example).

supertanuki commented 5 years ago

Hi Thibaud. The addon is for a large public, not only developers. We, developers do not use only localhost url, but also something.localhost, something.dev, etc Feel free to contribute to the code by adding a condition on the domain here: https://github.com/supertanuki/Carbonalyser/blob/master/script.js#L26

AAABBBCCCAAAA commented 2 years ago

This issue has been fixed here https://github.com/AAABBBCCCAAAA/Carbonalyser/blob/master/lib/carbonalyser/libStats.js#L2 with care of special urls from the browser (chrome:// and moz-ext)