npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

webview-query

v1.0.1

Published

Utility node.js library for Chrome webview traversal and manipulation

Readme

webview-query

Utility node.js library for Chrome Webview traversal and manipulation.

no dependencies

Install

npm install webview-query --save

Example

For example, you have NW.js app with webview tag within.

html:

<webview id="view1"></webview>

js:

const { Webview } = require('webview-query');
const webview = new Webview(view1);

// inside async function:

await webview.location('https://github.com');
console.log(await webview.title());
// -> "The world's leading software development platform · GitHub"

console.log(await webview.text('.jumbotron h1'));
// -> "Built for developers"

webview.val('form.home-hero-signup input[id="user[login]"]', 'Hello GitHub!');

Classes

External

Webview

Kind: global class

new Webview(webview)

Webview is a class for Chrome webview promise-based traversal and manipulation.

| Param | Type | Description | | --- | --- | --- | | webview | webview | Chrome webview element. |

webview.webview : webview

Kind: instance property of Webview

webview.runJs(code) ⇒ Promise

Run arbitrary javascript code inside webview context.

Kind: instance method of Webview
Returns: Promise - Promise object represents the result of the script.

| Param | Type | Description | | --- | --- | --- | | code | string | Javascript code. |

webview.title(value) ⇒ Promise

Set webview document new title.

Kind: instance method of Webview

| Param | Type | Description | | --- | --- | --- | | value | string | New document title. |

webview.location(value) ⇒ Promise

Set webview new location.

Kind: instance method of Webview

| Param | Type | Description | | --- | --- | --- | | value | string | URL or path to local file. |

webview.exists(selector) ⇒ Promise.<boolean>

Check the existence of an element(s).

Kind: instance method of Webview
Returns: Promise.<boolean> - Promise object represents the element(s) existence.

| Param | Type | Description | | --- | --- | --- | | selector | string | CSS selector. |

webview.length(selector) ⇒ Promise.<number>

Return number of elements matched by selector.

Kind: instance method of Webview
Returns: Promise.<number> - Promise object represents the number of elements currently matched..

| Param | Type | Description | | --- | --- | --- | | selector | string | CSS selector. |

webview.val(selector, value) ⇒ Promise

Set the value of every matched element.

Kind: instance method of Webview

| Param | Type | Description | | --- | --- | --- | | selector | string | CSS selector. | | value | string | Value to set. |

webview.attr(selector, attribute, value) ⇒ Promise

Set an attribute for every matched element.

Kind: instance method of Webview

| Param | Type | Description | | --- | --- | --- | | selector | string | CSS selector. | | attribute | string | The name of the attribute to set. | | value | string | A value to set for the attribute.. |

webview.text(selector, value) ⇒ Promise

Set the text contents of the matched elements.

Kind: instance method of Webview

| Param | Type | Description | | --- | --- | --- | | selector | string | CSS selector. | | value | string | The text to set as the content of each matched element. |

webview.html(selector, value, [options]) ⇒ Promise

Set the HTML contents of every matched element.

Kind: instance method of Webview

| Param | Type | Description | | --- | --- | --- | | selector | string | CSS selector. | | value | string | A string of HTML to set as the content of each matched element. | | [options] | object | Options. | | [options.outer] | boolean | If true the result will be outer HTML, inner HTML otherwise. |

webview.click(selector) ⇒ Promise

Execute click action for the matched element(s).

Kind: instance method of Webview

| Param | Type | Description | | --- | --- | --- | | selector | string | CSS selector. |

webview

Chrome webview element

Kind: global external
See: https://developer.chrome.com/apps/tags/webview