由于网校学习课程中的 PPT 总页数只能通过 iframe 中的数据才能获取到,所以只能处理 iframe。
tampermonkey 读取 iframe 中数据的操作要点
- iframe src 路径加入 tampermonkey match
- iframe 的 html 也不一定是即时加载的,所以有必要定时或者 set timeout 读取数据
iframe 与主页面的数据共享
GM_set GM_get 来实现数据共享。
由于网校学习课程中的 PPT 总页数只能通过 iframe 中的数据才能获取到,所以只能处理 iframe。
GM_set GM_get 来实现数据共享。