Socket
Socket
Sign inDemoInstall

popup-window

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    popup-window

Open popup windows


Version published
Weekly downloads
90
increased by210.34%
Maintainers
1
Install size
6.18 kB
Created
Weekly downloads
 

Readme

Source

Popup

NPM

Example usage

let win = new Popup(
  'http://webdeveric.com/',
  {
    name: 'window name goes here', // Optional
    width: 600,
    height: 400
  }
);

win.opened( ( win ) => {
  console.log('Popup has been opened');
}).blocked( ( win ) => {
  console.log('Popup has been blocked');
}).closed( ( win ) => {
  console.log('Popup has been closed');
});

win.open();

Window features

The window will have these features by default. You can pass in an object with some or all of these settings to the constructor, as shown above. If the width or height is null, it will be calculated to be half the screen width/height. If the left or top is null, it will be calculated so that the window is in the center of the screen.

{
  width: null,
  height: null,
  left: null,
  top: null,
  menubar: 0,
  toolbar: 0,
  location: 1,
  status: 1,
  resizable: 1,
  scrollbars: 1
}

Methods

  • open - open the window.
  • close - close the window.
  • opened - accepts a callback - the callback is called when the window is opened.
  • closed - accepts a callback - the callback is called when the window is closed.
  • blocked - accepts a callback - the callback is called when the window is blocked from opening.

The opened, closed, and blocked callbacks receive the Popup instance as the only argument.

Keywords

FAQs

Last updated on 21 Jul 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc