w3c/third-party-resources-checker

Name: third-party-resources-checker

Owner: World Wide Web Consortium

Description: A tool to detect non-w3.org and non-whitelisted resources in a Web page

Created: 2014-11-03 14:25:54.0

Updated: 2017-10-03 22:41:36.0

Pushed: 2017-05-17 13:51:57.0

Homepage:

Size: 48

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

npm version License Build Status Coverage Status Dependency Status devDependency Status

Third Party Resources Checker

This PhantomJS-based tool loads a given URL and logs on the standard output any URL (one per line) the page requests while loading that is not a www.w3.org nor a whitelisted URL (as defined in the whitelisted_domains variable).

It is a component of the W3C automated publication workflow, orchestrated by Echidna.

Installation

Install the dependencies by running npm install.

Usage
Standalone

The checker can be run standalone via the command line:

age: third-party-resources-checker [options] URI

tions:

-h, --help                  output usage information
-V, --version               output the version number
-w, --whitelist <filename>  optional JSON file containing URIs and domains that are deemed OK

amples:

$ third-party-resources-checker http://page.to.be/checked
$ third-party-resources-checker -w whitelist.json http://page.to.be/checked
As a module

The checker can also be run as a module. require('third-party-resources-checker') exposes a single check function:

k(uri, [whitelist]);

It returns a Promise of a tuple (as a JavaScript Array):

Whitelist format

When used standalone, the whitelist must be written in a JSON file. When used as a module, it must be given to the check() function as a JavaScript object literal. In both cases, its format is the following:


"domains": [
    "www.foobar.org"
],
"urls": [
    "http://example.org/image.jpg"
]


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.