Gathering detailed insights and metrics for @hint/connector-puppeteer
Gathering detailed insights and metrics for @hint/connector-puppeteer
Gathering detailed insights and metrics for @hint/connector-puppeteer
Gathering detailed insights and metrics for @hint/connector-puppeteer
npm install @hint/connector-puppeteer
Typescript
Module System
Node Version
NPM Version
Dist files
Updated on Oct 01, 2019
configuration-development-v6.1.1
Updated on Mar 07, 2019
hint-sri-v3.0.5
Updated on Mar 07, 2019
hint-no-vulnerable-javascript-libraries-v2.7.0
Updated on Mar 07, 2019
hint-css-prefix-order-v1.0.2
Updated on Mar 07, 2019
hint-amp-validator-v2.7.0
Updated on Mar 07, 2019
TypeScript (91.49%)
JavaScript (4.96%)
CSS (2.22%)
Handlebars (0.76%)
EJS (0.5%)
HTML (0.06%)
Batchfile (0.01%)
Shell (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
3,653 Stars
6,372 Commits
743 Forks
75 Watchers
157 Branches
105 Contributors
Updated on Jul 11, 2025
Latest Version
2.5.25
Package Id
@hint/connector-puppeteer@2.5.25
Unpacked Size
76.73 kB
Size
19.88 kB
File Count
36
NPM Version
10.5.0
Node Version
18.19.1
Published on
Aug 29, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
10
1
24
@hint/connector-puppeteer
)A connector that uses puppeteer
to communicate with the browsers in webhint
.
This package is installed automatically when adding webhint to your project so running the following is enough:
1npm install hint --save-dev
To use it, activate it via the .hintrc
configuration file:
1{ 2 "connector": { 3 "name": "puppeteer" 4 }, 5 ... 6}
The set of settings supported by the Puppeteer connector are:
1{ 2 "connector": { 3 "name": "puppeteer", 4 "options": { 5 "auth": AuthObject, 6 "browser": "Chrome|Chromium|Edge", 7 "headless": true|false, 8 "ignoreHTTPSErrors": true|false, 9 "puppeteerOptions": "object", 10 "waitUntil": "dom|loaded|networkidle0|networkidle2" 11 } 12 }, 13 ... 14}
All properties of options
are optional.
auth
: The credentials and elements to authenticate on a website.
See next section for further details.browser (Chrome|Chromium|Edge)
: Tells the preferred browser to
use. If unspecified webhint will look for a puppeteer
installation
before falling back to searching for an installed browser and fail
if it does not find one. Keep in mind that not all browsers are
available on all platforms and that you need to manually install
either puppeteer or a browser for this connector to work.headless (boolean)
: Indicates if the browser should run in headless
mode or not. It is true
by default when running on CI or
in WSL, false
otherwise.ignoreHTTPSError (boolean)
: Indicates if errors with certificates
should be ignored. Use this when checking self-signed certificates.
It is false
by default.puppeteerOptions (object)
: A set of launch options to pass to
puppeteer. See the puppeteer launch options for more information.waitUntil (dom|loaded|networkidle0|networkidle2)
: Is the waiting
strategy to decide when a page is considered loaded. See the
puppeteer goto options to know more.To use this connector when running WSL
you will have to install a chromium
browser on your distro (e.g.: sudo apt-get install chromium-browser
).
Because by default WSL
does not support graphics, the headless
mode will
be enabled by default. If you have an X Server working you will have to
manually disable this option via the connector's options. E.g.:
1{ 2 "connector": { 3 "name": "puppeteer", 4 "options": { 5 "headless": false 6 } 7 }, 8 ... 9}
The puppeteer
connector allows to authenticate on a website that
supports Basic HTTP Authentication or:
For Basic Authentication the auth
object properties are:
user
: a string
with the user name to usepassword
: a string
with the password to useE.g.:
1{ 2 "user": "userName", 3 "password": "Passw0rd" 4}
Otherwise, auth
properties are:
user
: the information needed to identify the input
element via
a query selector
(e.g.: #login
) to type the value
for the
username in (e.g.: username1
).password
: the information needed to identify the input
element via
a query selector
(e.g.: #password
) to type the value
for the
password in (e.g.: P@ssw0rd
).next
: the information needed to identify the input
(or button
)
element via a query selector
(e.g.: input[type="submit"]
) to click
to get to the next step of the authentication process. This is an
optional property as not all services prompt first for the user name
before asking for the password in the following screen. An example of
such a service would be Azure Pipelines.submit
: the information needed to identify the input
(or button
)
element via a query selector
(e.g.: input[type="submit"]
) to click
to submit the crendentials.E.g.:
1{ 2 "user": { 3 "selector": "string", 4 "value": "string" 5 }, 6 "password": { 7 "selector": "string", 8 "value": "string" 9 }, 10 "next": { 11 "selector": "string" 12 }, 13 "submit": { 14 "selector": "string" 15 } 16}
Sometimes you might need the browser to interact in some way with the content before starting the analysis. For example, in the case of a SPA you might want to click in certain elements to get to the right state.
Sometimes, this actions need to be done before navigating to the page to analyze.
To achieve this, you can use "user actions". "User actions" are defined as follows:
1{ 2 "connector": { 3 "name": "puppeteer", 4 "options": { 5 "actions": [ 6 { 7 "file": "pathToUserAction1.js", 8 "on": "beforeTargetNavigation|afterTargetNavigation" 9 }, 10 { 11 "file": "pathToUserAction2.js", 12 "on": "beforeTargetNavigation|afterTargetNavigation" 13 }, 14 ... 15 ], 16 "actionsOptions": { }, 17 ... 18 } 19 }, 20 ... 21}
There's a property actions
in the connector configuration that's an array
of Action
. You can define as many actions as you want.
An Action
is an object with two properties:
file
: Absolute or relative path from the execution path to the file
containing the action to execute.on
: A string that indicates when the action needs to be executed:
beforeTargetNavigation
: The action will be executed before navigating
to the target. If you need to set up special headers you will have to
do it at this moment.afterTargetNavigation
: The action will be executed after the target
has been loaded. If the website is a SPA and you need to get to a certain
state, this is the moment to use.The file that contains the action needs to be written in JavaScript and export
an object with an action
property with the following signature:
1module.exports = { 2 action: async (page, options) => { 3 // your actions here 4 } 5};
The parameters the function receives are:
page
: The puppeteer Page
with the tab used to navigate
to the target. This gives you full control to do anything you need with the
page (click, type, navigate elsewhere, etc.).options
: The connector options. This allows you access to waitFor
values
and any other user configuration. If you need to pass anything specifically
to the actions you can use options.actionOptions
property to do so.The connector's authentication mechanisms rely on the user actions API. The following is the code for the Basic HTTP Auth (transpiled to JS):
1module.exports = { 2 action: async (page, config) => { 3 if (!config || !config.auth) { 4 return; 5 } 6 7 if (typeof config.auth.user !== 'string' || typeof config.auth.password !== 'string') { 8 return; 9 } 10 11 await page.authenticate({ 12 password: config.auth.password, 13 username: config.auth.user 14 }); 15 } 16};
Note: This user action uses options.auth
which is already
predefined. If your user action needs another type of user information you can
use options.actionsOptions
.
The following is an example of a user action that will click on an element
configured via options.actionsOptions
:
1{ 2 "connector": { 3 "name": "puppeteer", 4 "options": { 5 "actions": [ 6 { 7 "file": "clickElement.js", 8 "on": "afterTargetNavigation" 9 } 10 ], 11 "actionsOptions": { 12 "elementId": "#id" 13 } 14 } 15 }, 16 ... 17}
1module.exports = { 2 action: async (page, config) => { 3 const selector = config.actionsOptions.elementId; 4 5 await page.click(selector); 6 } 7};
Please look at the source code of connector-puppeteer
for other built-in
actions.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
Found 4/23 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
64 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More