Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@satumjs/async-override

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@satumjs/async-override

override async for sandbox

  • 0.1.5-beta.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@satumjs/async-override

NPM version NPM downloads LICENSE

override async for sandbox

Usage

// 用于行内代码,生成 fakeUrl 用于缓存等
getFileFakeUrl(fileName:string, appName?:string): string

// 改写 fetch 方法
satumMicroFetchFactory(
  data: IMicroApp | { system: IActorSystem, appName?: string },
  fetch?: typeof fetch,
): (req: string | RequestInfo, options?: RequestInit) => Promise<Response | undefined>

// 改写 ajax 类
satumMicroFetchFactory(
  data: IMicroApp | { system: IActorSystem, appName?: string },
  customAjaxClass?: typeof XMLHttpRequest,
): XMLHttpRequest

// 改写 document.createElement 方法
satumMicroCreateElementFactory(
  data: IMicroApp | { system: IActorSystem, appName?: string },
  createElement?: typeof document.createElement,
  fakeWinName?: string, // window 对象上 沙箱的 property
): (tagName: keyof HTMLElementTagNameMap, options?: ElementCreationOptions) => HTMLElement | null

// 改写 document.head.appendChild 方法
satumMicroHeadAppendChildFactory(
  fakeHead: HTMLElement,
  appendChild?: typeof document.head.appendChild,
  customProcess?: (el: HTMLElement, fakeHead: HTMLElement, embedStylesIntoTemplate?: boolean) => HTMLElement | boolean | undefined,
): appendChild(el: HTMLElement) => HTMLElement

FAQs

Package last updated on 25 Jun 2022

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