Skip to content

Communication layer between parent and child frames (`<iframes>`). Gateway supports cross and same origin communication between frames in a single browser window.

Notifications You must be signed in to change notification settings

nsftx/seven-gravity-gateway

Repository files navigation

Seven Gravity Gateway

This component serves as communication layer between parent and child frames. Gateway supports cross and same origin communication between frames on same page.

Installation

Our packages are published to GitHub Packages. You need to add the entry to global or project based .npmrc file so that all requests to install our packages will go through GitHub Packages.

@nsftx:registry=https://npm.pkg.github.com

After that, install package

npm install @nsftx/seven-gravity-gateway --save

Usage

GG consists of 2 modules: Master and Slave module. Master module is intended for frames which will integrate 3rd party product via iframe. Slave module is intended for applications which will be integrated in some 3rd party frame.

Modules are exposed as UMD modules which we can be required as CommonJS or AMD modules, or simply injecting the script in HTML and using the global reference.

Master gateway:

var Gateway = window.gravity.gateway.master;

or

import Gateway from '@nsftx/seven-gravity-gateway/master';

Slave gateway:

var Gateway = window.gravity.gateway.slave;

or

import Gateway from '@nsftx/seven-gravity-gateway/slave';

To load both modules:

import Gateway from '@nsftx/seven-gravity-gateway';

For a detailed explanation about how GG works, check Wiki.

Test

npm run test or npm run test:watch

Contributing

Any contributions you make are greatly appreciated.

  1. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  2. Commit your Changes (git commit -m 'Add some AmazingFeature')
  3. Push to the Branch (git push origin feature/AmazingFeature)
  4. Open a Pull Request against next
  5. Once approved, Open a new Pull Request against master

Release procedure

In order to release next version of the library pull request is required. Use following steps for release.

About

Communication layer between parent and child frames (`<iframes>`). Gateway supports cross and same origin communication between frames in a single browser window.

Topics

Resources

Stars

Watchers

Forks

Packages