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

incu-webview

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incu-webview

iNCU Webview 库,用于实现一些与原生端的交互操作。

  • 1.0.4
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

iNCU-Webview操作库

安装

npm i incu-webview --save

引用

ES6:

import Miracle from 'incu-webview'

浏览器:

<script src="node_modules/incu-webview/miracle.min.js"></script>
<script>
  console.log(window.Miracle)
</script>

API

isApp

Demo:

import Miracle from 'incu-webview'

const isApp = Miracle.isApp()
console.log(isApp)

onAppReady

用于监听App的加载,加载完成后会调用回调。
除 isApp 外,其他所有Api需在AppReady后才能调用

参数与类型

onAppReady: (callback?: Function) => void

Demo:

import Miracle from 'incu-webview'

const onAppReady = Miracle.onAppReady(() => {
  console.log(Miracle.getData())
})

getData

获取App端的数据,具体格式,看数据吧……,请灵活使用该方法 =。=

Demo:

import Miracle from 'incu-webview'

console.log(Miracle.getData())

call

安全起见,具体能调用的方法查看 iNCU 的文档

参数与类型:

call: (
  baseClass: string,
  method: string,
  params: any,
  success?: Function,
  fail?: Function
) => void

Demo:

import Miracle from 'incu-webview'

Miracle.call('router', 'refresh', {
  title: 'Hello World'
}, () => {
  console.log('set Title success')
}, () => {
  console.log('set Title failed')
})

FAQs

Package last updated on 29 Jul 2017

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