Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
#jsbridge
JSBridge for jsvascript
protocol://host:port/url[params]
jsbridge://kjc/{"type":"action","name":"share","callback":"callback_1466131023000"}
jsbridge://kjc/action/share?callback=callback_1466131023000&title=title
protocol
:
http
https
ftp
etc.host
& port
& url
host
and port
can be emptyparams
This is a very-base realization of JSBridge.
It is mainly for pages embedded in native app to communicate with their host by breaking webview
;
The package provides two methods, invoke
for javascript and callback
for native app.
The Communication only could be called up in javascript,and then native app can reply sth. with callback.
(Calling up in native app would support in the next version);
// node environment (webpack or es6)
const JSBridge = require('jsbridge').init('jsbridge','localhost');
JSBridge.invoke('action',{key: value},(params) => { console.log(params) });
// original javascript
// <script src='node_modules/jsbridge/dist/index.js'></script>
JSBridge.invoke('action',{key: value},(params) => { console.log(params) });
isjson
is true, all params would padding by json-object instead of key-value
invoke
FAQs
JSBridge for jsvascript by yeliex
The npm package jsbridge receives a total of 4 weekly downloads. As such, jsbridge popularity was classified as not popular.
We found that jsbridge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.