Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

gardr-plugin-ext-postscribe

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

gardr-plugin-ext-postscribe

Gardr plugin for requesting replacement with Postscribe from inside of an iframe

latest
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

Gardr Postscribe Plugin (Ext)

Gardr plugin to enable content rendering with Postscribe from inside of an iframe. It sends message to parent window which sould be caught gardr-plugin-host-postscribe.

Install

npm install gardr-plugin-ext-postscribe --save

Bundle

In your ext bundle file:

    var gardrExt = require('gardr-ext');
    var postscribe = require('gardr-plugin-ext-postscribe');

    gardrExt.plugin(postscribe);

    module.exports = gardrExt;

Usage

Set global variable _gardrPostscribe to true anywhere in script pointed by options.url or declare a custom function:

_gardrRunPostscribe = function(getHTML) { 
    _gardrRunPostscribe.getHTML = getHTML
}```

In host window:
```javascript
var gardr = gardrHost(...);
gardr.queue('ad', {
    url: 'my-adserver.com/ad.js',
    ...
});

In my-adserver.com/ad.js:

window._gardrPostscribe = true;

or

window._gardrRunPostscribe(function() {
    return '<script src="http://www.url.to.ad"></script>';
});

Keywords

gardr

FAQs

Package last updated on 26 Nov 2014

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