New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

xfb-sdk

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xfb-sdk - npm Package Compare versions

Comparing version

to
0.0.24

110

dist/bundle.js

@@ -262,5 +262,113 @@ (function (global, factory) {

/**
* 打开原生页面
*/
function bridgeToNativePage(agrs) {
const { ios_url, android_url, miniProgram_url, jump_url } = agrs || {};
if (platform.isIOS) {
if (window.webkit && window.webkit.messageHandlers) {
window.webkit.messageHandlers.iOSOpenNativePageEvent.postMessage(ios_url);
}
return
}
if (platform.isAndroid) {
uni.postMessage({
data: {
action: 'openNativePage',
data: {
url: android_url,
},
},
});
}
if (platform.isMiniprogram) {
wx.miniProgram.navigateTo({
url: miniProgram_url,
});
}
if (jump_url) {
location.href = jump_url;
}
}
/**
* 打开广告位跳转
*/
function bridgeToAdvertPage(data) {
const { ios_url, android_url, mini_type, mini_program_page, jump_type, jump_url } = data;
if (platform.isIOS) {
if (window.webkit && window.webkit.messageHandlers) {
window.webkit.messageHandlers.iOSJumpNativePageEvent.postMessage({ ...data });
}
return
}
if (platform.isAndroid) {
uni.postMessage({
data: {
action: 'jumpAd',
data,
},
});
return
}
if (platform.isMiniprogram) {
wx.miniProgram.redirectTo({
url: mini_type === 1 ? mini_program_page : android_url,
});
return
}
location.href = jump_url;
}
/**
* 分享
*/
function bridgeToShare(data) {
if (platform.isIOS) {
if (window.webkit && window.webkit.messageHandlers) {
window.webkit.messageHandlers.iOSShareWeChatFriendOrCircle.postMessage({
title: data.title,
content: data.desc,
link: data.link,
image: data.imgUrl,
type: data.type,
});
}
return
}
if (platform.isAndroid) {
uni.postMessage({
data: {
action: 'toShare',
data: {
title: data.title,
content: data.desc,
link: data.link,
image: data.imgUrl,
type: data.type,
},
},
});
}
if (platform.isWechat) {
console.log(this);
}
}
var jbridge = /*#__PURE__*/Object.freeze({
__proto__: null,
bridgeToLogin: bridgeToLogin
bridgeToAdvertPage: bridgeToAdvertPage,
bridgeToLogin: bridgeToLogin,
bridgeToNativePage: bridgeToNativePage,
bridgeToShare: bridgeToShare
});

@@ -267,0 +375,0 @@

2

package.json
{
"name": "xfb-sdk",
"version": "0.0.23",
"version": "0.0.24",
"author": "wangfei",

@@ -5,0 +5,0 @@ "description": "",