Coder Social home page Coder Social logo

zhanshrd / wechat-redirect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 3lang3/wxopen

0.0 0.0 0.0 905 KB

📨微信跳转-微信浏览器中直接唤起本地浏览器和App

Home Page: http://wxredirect.jslab.fun

License: MIT License

JavaScript 76.21% HTML 9.77% CSS 13.08% Dockerfile 0.95%

wechat-redirect's Introduction

🍿 WHY

来自产品需求,在微信中希望用户点击我们的推广链接直接去下载App, 一通搜索之后发现全是国内商家提供的收费服务,xxx一个月的api服务费,x万卖源码(不信可以搜一下相关关键字)。 这么个小功能收费?!不可能(qiong~...)。 搜索引擎翻了大概几十页结果都没具体方案,大概满足需求的情况下,最后把代码推上来,方便交流取阅🙌。

🌰新增微信浏览器唤起APP例子 微信预览:http://wxredirect.jslab.fun/call-app

🌰**查看完整demo**

🎨 应用场景

APK微信自动下载

  • andorid微信里面,直接下载应用
  • 在IOS里面,提示跳转到IOS应用市场

绕过微信浏览器跳出限制

  • 在andorid微信浏览器中直接打开用户自带浏览器
  • ios正常遮罩提示(demo是纯文本提示,可以配合前端页面一起食用)

📌 CORE CODE

/*
* 通过设置状态码**206**和伪装头部Content-disposition 
* 绝大部分文章都没有提到206这一点
* 导致实现不了效果
*/
res.setHeader('Content-disposition', 'attachment;filename=open.apk');
res.setHeader('Content-type', 'text/plain; charset=utf-8');
res.removeHeader('If-None-Match')
res.removeHeader('If-Modified-Since')
res.statusCode = 206

✍️ Develop Or Contributor

docker用户:

npm run docker
# http://localhost:3000 dev地址

非docker用户:

  • redis
  • nodejs
  • npm(yarn)

开启redis服务,安装和文档移步redis page

# demo使用默认配置
redis-server

开启api服务,nodejs安装和文档nodejs page

# 安装依赖
npm install
# 开启服务
npm start

编译前端模版(create-react-app, 基于react的脚手架) 相关文档: react, create-react-app

# 进入目录
cd example/front
# 安装依赖
npm install
# 编译
npm run build

📖TODO

下面功能查询了相关资料,都没有找到满意都答案,大都是通过hack ticket进行伪装,如果你有好的实现或想法,欢迎交流~

  • app直接打开wechat浏览器
  • wechat浏览器直接打开app(跳出wx,之后再通过本地浏览器进行app唤起,依赖callapp-lib实现)

UI方面

  • IOS微信浏览器提示页

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.