You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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
Package was removed
Sorry, it seems this package was removed from the registry

@satumjs/async-override

override async for sandbox

0.1.5
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
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