New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@seibert/frame-bridge

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seibert/frame-bridge

A lightweight JavaScript library for seamless communication between a website and embedded iframes. frame-bridge simplifies the integration process by providing a secure and efficient way to exchange messages using the PostMessage API.

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Frame Bridge

Usage top level frame

Start host listener

startHostListener: (navigation: NavigationFn) => void

Initialize host listener with navigation function. The navigation function is called when a navigation event is triggered. It must be of type NavigationFn.

export type NavigateFn = ({ contentId, spaceKey }: { contentId: string; spaceKey?: string }) => Promise<boolean>;
import { startHostListener } from "@seibert/frame-bridge";
startHostListener(onNavigate)

Usage embedded frame

Validate if top level frame started host listener

isHostListening: () => Promise<boolean>

Call function isHostListening, which returns true if host is listening

import { isHostListening } from "@seibert/frame-bridge";
(async () => {
    const isListening = await isHostListening();
    console.log("Is host listening?", isListening);
})()

Check if top level frame handled navigation

onNavigationToConfluenceContent: ({ contentId, spaceKey }: { contentId: string; spaceKey?: string }) => Promise<{ isResponsible: boolean }>

Call function onNavigationToConfluenceContent with contentId and spaceKey of the space to navigate to. It returns { isResponsible: true } if top level frame handled navigation.

import { onNavigationToConfluenceContent } from "@seibert/frame-bridge";
onNavigationToConfluenceContent({
        contentId: "1933581",
        spaceKey: "Duck",
    }).then((res) => console.log("RESULT NAV: ", res.isResponsible));

FAQs

Package last updated on 16 May 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc