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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mmologin/browser-action

v0.0.4

Published

### **I. Navigation Actions:**

Downloads

4

Readme

Instruction

I. Navigation Actions:

1. Activate Tab:

method: activateTab
params:
  + options: {
    index: number;
  }

2. Close Browser:

method: closeBrowser

3. Close Tab:

method: closeTab
params:
  + options: {
    index?: number;
    current: boolean;
  }

4. Go Back:

method: goBack
params:
  + options?: {
    timeout?: number;
    waitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
  }

5. Go Forward:

method: goForward
params:
  + options?: {
    timeout?: number;
    waitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
  }

6. New Tab:

method: newTab
params:
  + options?: {
    url?: string;
    timeout?: number;
    waitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
  }

7. Open Url:

method: openUrl
params:
  + options: {
    url: string
    timeout?: number;
    waitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
  }

8. Reload Tab:

method: reloadTab
params:
  + options: {
    index?: number;
    current: boolean;
    timeout?: number;
    waitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
  }

II. Mouse Actions:

1. Click:

method: click
params:
  + options: {
    clickCount?: number
    delay?: number
    mouseButton?: 'left' | 'right'
    selectBy: {
      coordinates?: {
        x: number;
        y: number;
      };
      selector?: {
        type: 'xpath' | 'css' | 'text';
        value: string;
      }
    }
  }

2. Move Mouse:

method: moveMouse
params:
  + options: {
    coordinates: {
      x: number;
      y: number;
    }
  }

3. Scroll:

method: scroll
params:
  + options?: {
    timeoutSecs?: number;
    maxScrollHeight?: number;
    waitForSecs?: number;
    scrollDownAndUp?: boolean;
  }

III. Keyboard Actions:

1. Press Key:

method: pressKey
params:
  + options: {
    delay?: number;
    keys?: string[];
  }

2. Type Text:

method: typeText
params:
  + options: {
      selector: {
        type: 'xpath' | 'css' | 'text';
        value: string;
      };
      speed?: number;
      text: string;
      typeAsHuman?: boolean;
  }

IV. Data Actions:

1. Check Element Exists:

method: checkElementExists
params:
  + options: {
    selector: {
      type: 'xpath' | 'css' | 'text';
      value: string;
    };
    timeout?: number;
  }

2. Cookies:

method: cookies
params:
  + options: {
    type: 'import' | 'export' | 'clear';
    path?: string;
  }

3. Get Attribute:

method: getAttribute
params:
  + options: {
    attributeName: string;;
    selector: {
      type: 'xpath' | 'css' | 'text';
      value: string;
    };
    variable: string;
  }

4. Get Text:

method: getText
params:
  + options: {
    selector: {
      type: 'xpath' | 'css' | 'text';
      value: string;
    };
    variable: string;
  }

4. Get Url:

method: getUrl
params:
  + options: {
    variable: string;
  }

5. Save Asset:

method: saveAsset
params:
  + options: {
    fileName?: string
    outputDir: string
    saveAssetBy: {
      selector?: {
        type: 'xpath' | 'css' | 'text';
        value: string;
      }
      url?: string
    }
  }

6. Select Dropdown:

method: selectDropdown
params:
  + options: {
    selector: {
      type: 'xpath' | 'css' | 'text';
      value: string;
    };
    selectedValue: string;
  }

7. Set Variable:

method: setVariable
params:
  + options: {
    variable: string;
    operator: '=' | '+' | '-' | '*' | '/' | 'Concatenate';
    value: string;
  }

8. Upload File:

method: uploadFile
params:
  + options: {
    clickToUpload?: boolean;
    filePath: string;
    selector?: {
      type: 'xpath' | 'css' | 'text';
      value: string;
    };
  }

V. Other Actions:

1. Condition:

method: condition
params:
  + options: {
    leftOperand: string;
    operator: '<' | '>' | '=' | '!=' | '<=' | '>=';
    rightOperand: string;
  }

2. Emulate:

method: emulate
params:
  + options: {
    device: {
      userAgent: string;
      viewport: {
        width: number;
        height: number;
      };
    }
  }

3. Eval:

method: eval
params:
  + options: {
    script: string;
    variable: string;
  }

4. Loop:

method: loop
params:
  + options: {
    actions?: {
      type: string;
      options: any;
    }[]
    loopType: 'for' | 'while';

    // Use for loop type "For"
    forFromValue?: number | string;
    forToValue?: number | string;

    // Use for loop type "While"
    leftOperand?: string;
    operator?: '<' | '>' | '=' | '!=' | '<=' | '>=';
    rightOperand?: number | string;
  }

5. Screenshot:

method: screenshot
params:
  + options: {
    fileName: string;
    filePath: string;
  }

6. Sleep:

method: sleep
params:
  + options: {
    seconds: number;
    random?: {
      from: number;
      to: number;
    }
  }