Home

Awesome

<p align="center"> <img align="center" src="logo.jpg" width="150px" height="150"/> </p>

Bifrost-CORS

A cross-domain communication solution to share data and many more functionalities with simple as just calling a method.

Get Started

NPM Install

npm install bifrost-cors

CDN Link (6.39KB)

https://cdn.jsdelivr.net/gh/spurushottam13/bifrost-cors/index.min.js

GZIP version of File (1.7KB)

https://cdn.jsdelivr.net/gh/spurushottam13/bifrost-cors/index.min.gz

Functionalities can be performed on CROS Domain


All above methods are wrapped in a promise.


Initialize Bifrost-CORS You have to Initialize Bifrost-CORS in both domain
var bifrostCors = new bifrostCors(address, iframeBoolean,iframeId)	
ParameterRequiredValue
addressYESExact Address of the other domain
iframeBooleanNo<b>true</b> :- If you already rendering the other domain in iframe <br> <b>false</b> If you are not rendering the other domain in iframe <br> Default <b>false</b>
iframeIdNoif iframeBoolean is set to true then you need to pass the ID for your Iframe in which you loading the other domain

Implementation of methods and how to handle promise
var bifrostCors = new bifrostCors("http://example.com/",false)

//Calling Methods without promise
var result = bifrostCors.getLocalStorage(key)

//Hanlde Promise

//1. Using .then()
bifrostCors.getLocalStorage(key).then((data) => {
	console.log(data)
 })

//2. Using async function
async function grabLocalStorage(){
	let result = await  bifrostCors.getLocalStorage(key)
}

Functionalities