当前位置:网站首页>如何远程调试对方的H5页面
如何远程调试对方的H5页面
2022-08-10 07:29:00 【紫微前端】
首先要先在页面中进行埋点:
try {
var localStorageFunction = localStorage.getItem("localStorageFunction");
if (localStorageFunction) {
setTimeout(function() {
eval(localStorage.getItem("localStorageFunction"))
}, 5000)
}
} catch (e) {
console.log(e)
}
根据localstorage的特性,在同一域名下都可以互相调用。
我们准备一个特殊的页面:
<script>
var fnStr = 'document.getElementsByTagName("body")[0].style.transform="rotate(90deg)"'
localStorage.setItem("localStorageFunction", fnStr)
</script>
用这个页面来专门往localstorage里面插入函数的字符串。
当用户有特殊需求时,我们把需要的函数字符串命令,通过这个页面,让用户访问,访问时,函数就会插入到同域名下面的localstorage里。
下一步打开我们之前埋好点的页面,当页面发现localStorageFunction不是空的时候,就会通过eval函数来执行字符串函数。这样就会及时解决用户的痛点。
边栏推荐
- 软件测试面试题避雷(HR面试题)最常见的面试问题和技巧性答复
- Text-to-Image最新论文、代码汇总
- initramfs与initrd的区别
- 【无标题】
- Excuse me.Oracle CDC connector supports LogMiner and XStream API two ways to capture
- 【电商业务】外行为何难区别 商品属性与商品规格
- delta method 介绍
- DGIOT supports industrial equipment rental and remote control
- 941 · 滑动拼图
- WooCommerce installation and rest api usage
猜你喜欢
随机推荐
90.(cesium之家)cesium高度监听事件
杭州公积金修改手机号信息
Chapter 11 Database Design Specifications [2. Index and Tuning] [MySQL Advanced]
第2章 变量和基本类型读书笔记
【转】探秘钉钉的即时消息服务DTIM
ctfshow SSTI 知识点总结
软件测试面试题避雷(HR面试题)最常见的面试问题和技巧性答复
ATH10传感器读取温湿度
每日一题,数组字符串的匹配问题
941 · Sliding Puzzles
placeholder 1
搭建 risc-v 编译环境
mysql数据库月增长量问题
PLSQL学习第三天
进程管理(动态的)
May I ask why sqlserver cdc will report this error one day after the task is started, obviously cdc has been opened.
Big guy, when Oracle single-table incremental synchronization, the source database server takes up nearly 2g of memory. This is not normal, right?
图像处理用什么神经网络,神经网络提取图片特征
【Event Preview on August 9】Prometheus Summit
如何设计神经网络结构,神经网络设计与实现