-
Notifications
You must be signed in to change notification settings - Fork 6
测试微信中网页跳转是否有提示 #57
Copy link
Copy link
Closed
Labels
Back-endWhere data really come and goWhere data really come and goFront-endEverything you see and experienceEverything you see and experienceJSJavascriptJavascriptWechatThe popular social appThe popular social app
Description
问题描述
如果用微信扫描一个二维码,这个二维码对应的网址是用来跳转到其它页面的。那么这个跳转过程是否在微信中有提示?
在 QQ 邮箱里,用户点击邮件里的链接,QQ 邮箱就会先提示用户将要跳转到其它网页。
应用过程
记录应用入选方案的过程中所踩的坑,以及其它值得记录的内容。
研究过程
网页跳转的话,其实有两种方式,一种是利用 IIS、Nginx 这样的 Web Server 直接在系统层面跳转过去,另一种是写一个实际的网页,然后在网页里通过 JS 实现页面的跳转。
在阿里云的 IIS 服务器上,先是写了一个 URL 重写规则,匹配正则表达式 ^1.html(.*)$ 的 URL 都跳转到百度上去。
然后又写了一个实际的页面,title 设置为空,页面内容只有一行 JS:window.location.href = 'https://www.baidu.com'。
在微信中扫码测试,确认了两种方式都不会有任何的提示,扫码之后就是一个空白页面,然后很快就跳转到百度首页了。
只不过第一种方式:在 IIS 中写一个 URL 重写规则的方式,也许是因为用的是正则表达式,感觉速度明显要比第二种方式慢一些。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Back-endWhere data really come and goWhere data really come and goFront-endEverything you see and experienceEverything you see and experienceJSJavascriptJavascriptWechatThe popular social appThe popular social app