Library for managing external content in iframes
npm install gardr
|12||downloads in the last day|
|35||downloads in the last week|
|95||downloads in the last month|
|Version||0.5.17-SNAPSHOT last updated 3 months ago|
|Dependencies||get-style-property, cookies-js, browserify, query-params, util-extend|
garðr - the safe way to add third party content to your site
Garðr is a library for embedding content from external sources such as advertisements or similar third party content.
Removes the need for friendly iframes support in delivery systems and supports both HTML, Image and Flash based adverts.
$ npm install gardr
Building a distribution
$ npm install $ grunt --force
Easiest way is through npm.
$ npm test
When working with the code you can use karma and grunt to get continuous feedback on your tests.
$ grunt karam:watch or $ karma start
We put bower modules inside node_modules folder so it just works. It's not optimal, but works for now.
Debugging can be done by configuring logging to either the browser console or as an overlay inside the iframes rendered by garðr.
You can turn on logging by adding an url-fragment with log level: #loglevel=4 By default it will display an overlay inside each banner with the log output. If the banner isn't visible, you can output to console by using: #loglevel=4&logto=console
NB! If the banner injects another iframe we have no good way of catching errors :(
Polyfills required for older IE support
Releasing new versions
This task releases a new version to the Maven repository.
# Trigger the Maven release plugin $ grunt release # Make sure you push the commits made by the release plugin $ git push # Push the tags for the release $ git push --tags
Demos and samples
There are some examples on how to use garðr located in the samples folder.
Run the following commands to install the samples applciation
$ cd samples/ $ npm install $ node app.js
Open browser http://localhost:9966/example.html
Samples in the wild
- All of the display adverst on m.finn.no is using paties-js to safely embed responsive adverts written in HTML, CSS and JS.