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

attached-windows

v1.0.4

Published

Using Chrome extension API attach multiple normal and/or popup windows together that behave like a single window.

Downloads

7

Readme

attached-windows NPM Version Publish Size Downloads License: MIT

Use attached-windows module in your Chrome extension to attach multiple normal and/or popup windows together that behave like a single window.

Table of Contents

Features

  • Attaches multiple windows to each other.
  • Keeps track of the state, position, and size of each window.
  • Supports normal and popup window types.
  • Automatically updates the position and size of attached windows when one of them is resized or closed.

Install

npm i attached-windows

Usage

A minimal example of attaching 3 windows:

import AttachedWindows from 'attached-windows'
import { AttachedWindowsConfiguration } from 'attached-windows'

const configuration: AttachedWindowsConfiguration = {
    container: {
        top: 0,
        left: 0,
        width: 1300,
        height: 600,
        state: 'normal'
    },
    windows: [
        {
            id: (await chrome.windows.create({ type: 'normal', url: 'https://twitter.com/' })).id as number,
            widthFraction: 0.5,
            isPrimary: true,
            isHidden: false,
            type: 'normal'
        },
        {
            id: (await chrome.windows.create({ type: 'normal', url: 'https://www.google.com/' })).id as number,
            widthFraction: 0.225,
            isPrimary: false,
            type: 'popup'
        },
        {
            id: (await chrome.windows.create({ type: 'normal', url: 'https://www.github.com/' })).id as number,
            widthFraction: 0.25,
            isPrimary: false,
            type: 'popup'
        }
    ]
}

AttachedWindows.initialize(configuration)

Terminates the AttachedWindows instance and close attached windows:

AttachedWindows.terminate({ closeWindows: true, closePrimary: false })

You can specify the options closeWindows and closePrimary to control if all windows or just the primary window should be closed.

API Reference

Interfaces

AttachedWindowsContainer - An interface that represents the configuration of the attached windows container. Properties:

  • top: number
  • left: number
  • width: number
  • height: number
  • state: 'normal' | 'minimized'

AttachedWindowsWindow - An interface that represents the configuration of a single window within the container. Properties:

  • id: number
  • name: any (optional)
  • widthFraction: number
  • isPrimary: boolean (optional)
  • isHidden: boolean (optional)
  • type: 'normal' | 'popup'
  • bounds: AttachedWindowsContainer

AttachedWindowsConfiguration - An interface that represents the configuration for the AttachedWindows class. Properties:

  • container: AttachedWindowsContainer
  • windows: AttachedWindowsWindow[]

Classes

AttachedWindows - The main class for managing attached windows.

Properties:

  • onRemoveAttachedWindow: Function (optional)

Methods:

  • initialize: A method that initializes and attaches multiple windows. The input parameter configuration is an object of type AttachedWindowsConfiguration that includes the information required to initialize the attached windows.
  • terminate: A method that terminates the AttachedWindows instance and closes the attached windows. You can specify the options closeWindows and closePrimary to control if all windows or just the primary window should be closed.

Contributing

You are welcome to contribute! If you are adding a feature or fixing a bug, please contribute to the GitHub repository.

License

attached-windows is licensed under the MIT license.

Author

|@SheikhAminul| |:---:| |@SheikhAminul|