Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amp-iframe-resize-child

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amp-iframe-resize-child

A teeny tiny (0.37 kb before gzip) resize handler for child iframes, that supports the [AMP-style resize event messages](https://ampbyexample.com/components/amp-iframe/#resizable-iframes).

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
233
increased by17.09%
Maintainers
1
Weekly downloads
 
Created
Source

AMP iframe resize emitter

A teeny tiny (0.37 kb before gzip) resize handler for child iframes, that supports the AMP-style resize event messages.

Use this module if you're creating content that will be consumed in AMP articles that needs the parent frame to be resized to fit.

This script binds a mutation observer to the body & listener to the resize event so it will check for changes to dimensions whenever your content does, or if the window resizes.

Usage

Install the package from NPM (npm i amp-iframe-resize);

Then add the listeners like so:

const resizeHandler = require('amp-iframe-resize');
resizeHandler();

You might like…

If you liked this module, you might also like the amp-iframe-parent-resize module which lets your non-AMP parent page handle resize events from AMP articles such as this.

FAQs

Package last updated on 11 Jun 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc