Coder Social home page Coder Social logo

kleopatra999 / third-party-resources-checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from w3c/third-party-resources-checker

0.0 3.0 0.0 49 KB

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

JavaScript 78.09% HTML 21.44% CSS 0.47%

third-party-resources-checker's Introduction

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:

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

  Options:

    -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

  Examples:

    $ 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:

check(uri, [whitelist]);

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

  • The first element is the exit code
  • The second element is an Array of String, each of them being an external resource

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"
    ]
}

third-party-resources-checker's People

Contributors

astorije avatar dontcallmedom avatar deniak avatar tripu avatar

Watchers

James Cloos avatar rosa maria palacios juncosa avatar  avatar

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.