🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

nw-app-snail

Package Overview
Dependencies
Maintainers
12
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nw-app-snail

蜗牛wap页打开app功能支持模块

latest
npmnpm
Version
2.9.24
Version published
Weekly downloads
22
-4.35%
Maintainers
12
Weekly downloads
 
Created
Source

nw-app-snail

功能

在H5中尝试打开网易蜗牛读书App的特定页面,如果没有安装或者没有成功打开,则跳转App下载页

使用

npm: 通过npm安装nw-app-snail,再通过模块引用方式引入即可调用openAppSnail()完成跳转

import openAppSnail from 'nw-app-snail'
//import * as open from 'nw-app-snail'
openAppSnail({
    path: 'bookreview',
    query: {
        bookReviewId: 286436
    }
})

直接引用:下载/dist/bundle.js到工程中即可调用NWAppSnail.openAppSnail()方法完成跳转

<script src="bundle.js"></script>
<script>
    NWAppSnail.openAppSnail({
        path: 'bookreview',
        query: {
            bookReviewId: 286436
        }
    })
</script>

开发

es module 打包

根目录下执行npm run build即可

umd module 打包

本目录下执行npm run build即可

参数

参数为Object类型,参数各字段定义如下:

参数属性类型描述
pathStringh5跳转应用内页面类型
queryObjecth5跳转应用内页面参数
replaceboolean是否使用location.replace代理location.href进行跳转,默认为false

参数示例:

{
    path: 'bookreview',
    query: {
        bookReviewId: 286436
    }
}

具体可用path和query参数如下:

此列表不定时更新,完整列表可查看(蜗牛读书客户端SchemeUrl wiki),此文档展示了所有可供调用的scheme,第一列即为path,第二列即为query所需参数

pathquery描述
bookdetailbookId:书籍id书籍详情
bookcontentbookId:书籍id articleId:章节id 非必传书籍正文页
booklistbookListId:书单id书单页(书单功能已弃用)
webviewurl:打开的连接地址 inside:boolean变量,是否用内嵌浏览器打开,默认为false(即外部浏览器打开)通过浏览器或者webview打开url
userinfouuid:用户uuid用户个人主页
privatemsguseruuid:用户uuid用户私信对话界面
bookrankmoduleId:模块id entryId:排行榜id title:榜单名称 type:榜单类型(read:在读榜,new:新书榜)书籍排行榜
bookreviewbookReviewId:书评id书评详情页
newbookreview写书评
questionquestionId: 问题id问题回答页
questionlistbookId: 书籍id书籍的问题列表
bookstore书城(目前的分类页)
messagenotify消息列表通知选项卡
messagecomment消息列表评论选项卡
messageanswer消息列表回答选项卡
messagelist我的消息列表
feedback用户反馈
followlisttype:follow表示关注列表,fans表示粉丝列表 uuid:用户uuid,如果不传表示当前登录用户用户反馈
setting设置
subjectmoduleId:模块id entryId:专题id(如果不传表示获取专题列表)专题页
bookexchangetype:exchanged表示已兑换页面,book表示兑换页面书籍兑换页面
...更多可控调用的scheme请查看(蜗牛读书客户端SchemeUrl)如无权限可联系hzliushichuan

Keywords

snailReader

FAQs

Package last updated on 08 Jun 2026

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