Comments (1)
/**
* Created by du on 17/1/1.
*/
function getJsBridge() {
window._dsf=window._dsf||{};
return {
call: function (method, args, cb) {
var ret = '';
if (typeof args == 'function') {
cb = args;
args = {};
}
if (typeof cb == 'function') {
window.dscb = window.dscb || 0;
var cbName = 'dscb' + window.dscb++;
window[cbName] = cb;
args['_dscbstub'] = cbName;
}
args = JSON.stringify(args || {})
if (window._dswk) {
ret = prompt(window._dswk + method, args);
} else {
if (typeof _dsbridge == 'function') {
ret = _dsbridge(method, args);
} else {
ret = _dsbridge.call(method, args);
}
}
return ret;
},
register:function(name,fun){
if(typeof name=="object"){
Object.assign(window._dsf,name)
}else {
window._dsf[name] = fun;
}
}
}
};
dsBridge=getJsBridge();
from dsbridge-ios.
Related Issues (20)
- 原生异步函数如何支持重载?
- 获取网络数据后给前端传值不显示
- 崩溃ret=action(JavascriptInterfaceObject,sel,arg); HOT 2
- 使用dsBridge.call("name", "msg") msg 内容超过一定长度会被截断问题
- 使用 UIWindowSceneDelegate 的情况下,会导致奔溃(crash)
- addJavascriptObject方法添加的函数异步执行问题。 HOT 1
- 我已经重新设计了新的交互库,10分钟就能完成接入,也许可以帮助你. HOT 1
- I have redesigned new libraries, It only takes ten minutes to complete . Maybe can help you.
- 通过dsbridge.call调用,iOS端接收到的信息不正确
- 请问 dsuiDelegate 与 requestMediaCapturePermissionFor 代理实现 HOT 2
- oc 调用 js 只能传数组么?
- [ios]When webview video on full screen, js call native dsbridge will exit the fullscreen
- 新版xcode namespace命名与系统关键字冲突了
- 求助 swift js 调原生,异步有传参和回调,点击报错[__NSCFString count] HOT 1
- completionHandler
- 高频调用时会丢包 HOT 1
- 加载网页资源loadrequest,添加javascript无法响应 HOT 5
- 你好,希望添加对 Swift packages 的支持
- Xcode 15 打包,dsbridge失效 HOT 1
- 老铁们,DSBridge-HarmonyOS 版本来了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsbridge-ios.