gardr-plugin-ext-postscribe

0.2.2 • Public • Published

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>';
});

Package Sidebar

Install

npm i gardr-plugin-ext-postscribe

Weekly Downloads

1

Version

0.2.2

License

MIT

Last publish

Collaborators

  • kjarmicki