This is a script that will iterate over the document.styleSheets object and determine what was actually used from the linked stylesheets.
In order to help in planning decisions, it can be useful to know which feature or bug fix will make the biggest impact. Up until this point we knew what CSS was declared but not necessarily what was actually used by the browser.
There are pros and cons to any approach you take to gather telemetry. This is not the only approach we will take and think it is a good starting point to providing our telemetry externally for partners, other UAs, standards bodies, and web developers.
We highly recommend any advancements that you can make to the script. We expect it to only get better with the community providing pull requests. To get started you'll need to install node and git then do the following:
- Fork the repo (see this page for help)
- Clone your repo
- Change directories into the root of your cloned directory
- Then type
npm install
- Finally build the application
grunt
- Make the change
- Write a unit test under
\tests\unit-tests\test.js
for your change if it is necessary - Run the tests in Chrome/Firefox/Edge and ensure that they still pass
- Submit a pull request
You will need to complete a Contributor License Agreement (CLA) before your pull request can be accepted. This agreement testifies that you are granting us permission to use the source code you are submitting, and that this work is being submitted under appropriate license that we can use it. The process is very simple as it just hooks into your Github account. Once we have received the signed CLA, we'll review the request. You will only need to do this once.
Usefulness
One very important question to ask yourself before you write any code is
Will anyone actually use this?
There are many reasons for this:
- We want this data to be useful to many different demographics (Standards Bodies, Browser Vendors, Web Developers, etc)
- We don't want to provide too much data that the site becomes unusable
- There is overhead on Microsoft to add the new data to the site in a meaningful and intutive way so every change will have to answer this question (so be prepared to defend it)
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.