Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pa11y

Package Overview
Dependencies
Maintainers
7
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pa11y - npm Package Compare versions

Comparing version 6.2.1 to 6.2.2

37

lib/pa11y.js

@@ -146,2 +146,3 @@ 'use strict';

* @private
* @param {Object} url - The URL to test against
* @param {Object} [options] - Options to change the way tests run.

@@ -164,21 +165,25 @@ * @param {Object} state - The current pa11y internal state, fields will be mutated by

state.consoleCallback = message => {
const location = message.location();
const parsedUrl = new URL(location.url ? location.url : url);
if (message.type() === 'log') {
const location = message.location();
const parsedUrl = new URL(location.url ? location.url : url);
// Try to follow devtool conventions when displaying the document name
if (parsedUrl.pathname === '/') {
// If the document is root, replace it with the hostname instead
// e.g. '/' becomes 'www.pa11y.org'
location.url = parsedUrl.hostname;
// Try to follow devtool conventions when displaying the document name
if (parsedUrl.pathname === '/') {
// If the document is root, replace it with the hostname instead
// e.g. '/' becomes 'www.pa11y.org'
location.url = parsedUrl.hostname;
} else {
// The path is longer than '/' so we:
// * remove the last character if it's a forward slash with replace
// * split the path in different elements
// * retrieve the last element of the path
// e.g. '/foo/bar/baz/' becomes 'baz'
location.url = parsedUrl.pathname.replace(/\/$/, '').split('/').pop();
}
const locationString = `${location.url}:${location.lineNumber}:${location.columnNumber}`;
options.log.debug(`Browser Console: ${locationString} ${message.text()}`);
} else {
// The path is longer than '/' so we:
// * remove the last character if it's a forward slash with replace
// * split the path in different elements
// * retrieve the last element of the path
// e.g. '/foo/bar/baz/' becomes 'baz'
location.url = parsedUrl.pathname.replace(/\/$/, '').split('/').pop();
options.log.debug(`Browser Console: ${message.text()}`);
}
const locationString = `${location.url}:${location.lineNumber}:${location.columnNumber}`;
options.log.debug(`Browser Console: ${locationString} ${message.text()}`);
};

@@ -185,0 +190,0 @@

{
"name": "pa11y",
"version": "6.2.1",
"version": "6.2.2",
"description": "Pa11y is your automated accessibility testing pal",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc