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

dot-store-iframe

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-store-iframe

Iframe controller integration for dot-store

  • 2.6.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

dot-store-iframe

Iframe controller integration for dot-store.

ads

Install

npm install --save dot-store-iframe

Usage

Create the store

import DotStore from "dot-store"
import withIframe from "dot-store-iframe"

const store = new DotStore()
export default withIframe(store)

Build an ad slot

import iframeStore from "./iframeStore"

iframeStore.set("dfp.viewportMaps", [
  [1200, 800],
  [1024, 768],
  [768, 1024],
  [732, 412],
  [568, 320],
  [360, 640],
  [320, 568],
  [0, 0],
])

iframeStore.set("dfp.units.top1", {
  sizes: [[300, 50], [300, 100], [728, 90]],
  viewportSizes: [
    [[300, 100], [728, 90]],
    [[300, 100], [728, 90]],
    [[300, 100], [728, 90]],
    [[300, 50], [300, 100], [728, 90]],
    [[300, 50], [300, 100]],
    [[300, 50], [300, 100]],
    [[300, 50], [300, 100]],
    [[300, 50], [300, 100]],
  ],
})

iframeStore.set("iframes.div1", {
  active: true,
  divId: "div1",
  dfp: {
    oop: false,
    path: "/01234567/unit/path",
    unitId: "top1",
  },
})

Monitor changes

iframeStore.on("dfp.loaded", options => {
  // dfp loaded
})

iframeStore.on("iframes.div1.slot", options => {
  // slot created
})

iframeStore.on("iframes.div1.loaded", options => {
  // slot loaded
})

iframeStore.on("iframes.div1.rendered", options => {
  // slot rendered
})

Keywords

FAQs

Package last updated on 12 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