GithubHelp home page GithubHelp logo

oiworld / carbonfootprint Goto Github PK

View Code? Open in Web Editor NEW
34.0 10.0 32.0 68.86 MB

A Google Chrome browser extension that displays carbon footprint information in Google Maps.

JavaScript 75.24% CSS 6.29% HTML 18.47%

carbonfootprint's Introduction

Carbon Footprint for Google Maps

A browser extension that displays carbon footprint information in multiple map services.

Downloading and Using the Latest Stable Version

To download and install the extension to your favorite browser, visit Carbon Footprint's page in your browser's extension/add-on gallery/store:

Building and Using Beta Versions

  • clone this repository

  • run npm install

  • run gulp group or gulp groupFirefox or gulp groupChrome or gulp groupSafari or gulp groupWebext

  • add flag --debug to keep all debug statements and comments.

  • for chrome, load the unpacked extension from the Build/Chrome folder

  • for firefox, run jpm runFirefox and use the -b flag to point to a non extension verifying version of Firefox like the Developer Edition

  • for WebExtension, run web-ext run -f firefoxdeveloperedition to use this extension in Firefox(Developer Edition).

  • for safari, load folder with extension .safariextension into Extension Builder Develop -> Show Extension Builder. To show Develop menu go to Safari -> Preferences -> Advanced. Change extension metadata as required from the Extension Builder. To package the extension for distribution, get an extension certificate from Apple.

Licenses

  • GNU-GPL-3.0

  • CC-By-NC-ND License

Contributions

If you would like to contribute to the development of this extension, please contact the developers.

  • Google Summer of Code grants are available every year. If you would like to apply, it is never too early to contact us.

carbonfootprint's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carbonfootprint's Issues

No Download links in the README

we should re add all available download links to the README or a link to the github.io page so people know they don't need to do a local build just to use the extension.

CarbonFootPrint as a mobile app

CarbonFootPrint as a mobile app would help people to get awareness how much amount of Carbon they are emitting while travelling.

The Carbon emission values shown on map are not synced with options page

Hi,
I pulled the latest code and loaded the extension.But the carbon emission values are not changing with changes in the options page.
s1
s2
s3
s4

I changed the value from 100 to 200 but map showed the same content.
The reason which I found was
var carbonEmission = 217; -> GoogleMapsCarbonFootprint.js file

the variable was set to constant and not taking the values from option page.

pulling precise time from maps

The issue we are facing presently is that we are pulling the total time of journey from maps. This however isn't the best way to get accurate emissions for public transport since:

  1. The total time includes the time taken to actually walk to the Bus stop or a transit station.
  2. It also includes the time idled in waiting for the next connection. Sometimes this waiting time can be very long owing to the operating times of the public transport.

screen shot 2016-08-22 at 1 12 02 am

Note in the above picture that time spent in walking is more than 25% of the total time of the journey. Therefore, this directly offsets the calculated emissions by 25% from the true value.

An extreme example of the time spent in idling can be seen below.

screen shot 2016-08-20 at 19 11 45

Firefox add-on URL is unavailable

I tried following the instructions in README.md for installing the Firefox addon. However, the link to the Firefox add-on, https://addons.mozilla.org/en-US/firefox/addon/carbon-footprint/, is unavailable. See the detailed error message below.

Oops! We can’t find that page

If you’ve followed a link from another site for an extension or theme, that item is no longer available. This could be because:

  • The developer removed it. Developers commonly do this because they no longer support the extension or theme, or have replaced it.
  • Mozilla removed it. This can happen when issues are found during the review of the extension or theme, or the extension or theme has been abusing the terms and conditions for addons.mozilla.org. The developer has the opportunity to resolve the issues and make the add-on available again.

Try visiting the page later, as the theme or extension may become available again. Alternatively, you may be able to find what you’re looking for in one of the available extensions or themes, or by asking for help on our community forums.

Take speed into account

The CO2 emissions (and fuel consumption) of a car depend significantly on its speed. For example, a car driving at 150km/h on a highway consumes more and emits more CO2 per kilometer than a car driving at a low speed in a city without traffic jams.

The options page should allow the user to specify the emissions or fuel consumptions for 2 or 3 different speeds. The actual average speed of a route suggested by Google Maps can be calculated by dividing the route's distance by its time. Based on the average speed and on the emissions/consumptions for the speeds provided by the user, we can calculate more accurate estimations.

Calculator of CO2 emission by airplanes is not working.

Calculator of CO2 emission by airplanes is not working properly .It need improvements for the User Interface . Further , list lags while loading the airports . Further , Carbon emission can be added for flight option in google maps search rather than particularly calculating it on page.

Migrating Safari port to a Safari App Extension

Apple has come up with new platform called Safari App Extension. It's a native macOS app that can work as an extension to Safari and could also interact with the macOS itself. The benefit of this would be that we could list our app directly on the macOS app store instead of the Safari Extension Gallery. This could help in reaching out to more users. Also, some extra features (such as a menu bar preference pane) can be added since it would a native macOS app.

The official guide to build a Safari App Extension can be found here

Estimate travel cost

It would be easy to generalize this extension to estimate not only the CO2 emissions of a route but also the fuel costs (in money). This is interesting information, since a high cost is another incentive for the user not to use his car.

The options page should allow the user to specify the price of fuel per litre (or gallon) and choose whether he wants the travel cost to be displayed together with the CO2 emissions.

Support public transport, biking and walking

Right now, the extension always assumes that Google Maps suggested routes are for cars. Therefore, it gives wrong estimations when the user has actually asked for biking, walking or public transport directions. This should be fixed. At least, no estimation should be shown for these other modes of transportation (or it should be made clear that the estimation refers to prevented emissions in the case of walking or biking). Ideally, we should also provide good estimations for public transportation. However, the CO2 emissions per passenger may vary greatly depending on the city, on the average number of passengers, on the time of the day, on the type of public transportation (bus, electric bus, tram, metro,...) and so on... Therefore, such parameters should be configurable by the user in the options page. Nevertheless, we should provide good default values for the parameters. For that, we need good sources of information about emissions from busses, trams, metro, train. Some cities (e.g. Helsinki) seem to have public data available about this. We could use the same data (possibly an average of the available data from many cities) for all cities, to simplify the estimation.

Port this extension to Safari

The port should be done in a way that both versions (Chrome and Safari) share as much code as possible, in order to facilitate maintenance.

Port this extension to Firefox

The port should be done in a way that both versions (Chrome and Firefox) share as much code as possible, in order to facilitate maintenance.

CO2 Emissions not showing

@rohankatyal29 noticed the following issue:

I am not being able to run the extension on chrome. It gets installed perfectly fine, but I don't see the carbon emissions next to the total distance. This happens even if I install the extension from chrome store. Any particular why this might be happening?

Thank you for noticing this!

The extension performs the following major steps:

  1. it finds the route's distance in Google Maps webpage
  2. it calculates the emissions
  3. and, finally, it inserts the emissions back into the webpage.

For steps 1 and 3, the extension needs to navigate the DOM of the webpage. The problem is that, from time to time, Google restructures the DOM, and this breaks the functionality of Carbon Footprint.

It seems that, unfortunately, this has just happened again. It has happened twice before in the last 4 years.

To fix this issue, one needs to look at all lines in the code where we are traversing the page's DOM elements and inserting new DOM elements to the page. These are lines containing "document.getElementsBy...", for instance. It is also necessary to look at the new source code of Google Maps's page, to see which tags, ids and structures they are using now, in order to know how to traverse the new DOM correctly.

This is an excellent puzzle for GSoC. Solving it definitely shows mastery in the necessary skills to work in this project.

Chrome extension should ask for the necessary permissions only

When I click "Add to Chrome" in the Chrome Web Store, I get the following request for permissions:

Add "Carbon Footprint for Google Maps™ and Others"?

It can:
Access the page debugger backend
Read and change all your data on the websites that you visit
Display notifications
Detect your physical location

My understanding is that the extension really only needs to access some of the websites, not all of them. I know that the access can be restricted in the extension settings of the user's browser, but it would be better if only the necessary permissions were asked for in the first place.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.