(pageE, title, url)
| 2302 | } |
| 2303 | // 添加历史记录 |
| 2304 | function addHistory(pageE, title, url) { |
| 2305 | if (!curSite.pageUrl) return |
| 2306 | // 对于自带类似功能 或者 覆盖了 history 原生函数的网站,则跳过不再添加历史记录 |
| 2307 | if (window.top.history.toString() !== '[object History]') return |
| 2308 | title = title || ((pageE.querySelector('title')) ? pageE.querySelector('title').textContent : window.top.document.title); |
| 2309 | url = url || curSite.pageUrl; |
| 2310 | window.top.document.Autopage_nowUrl = curSite.pageUrl; |
| 2311 | // 对于下一页 URL 和当前网页 URL 的协议不同时,以当前网页 URL 协议为准 |
| 2312 | if (url.indexOf(window.top.location.protocol) === -1) url = url.replace(/^https?:/,window.top.location.protocol) |
| 2313 | window.top.history.pushState('Autopage_history', title, url); |
| 2314 | window.top.document.title = title; |
| 2315 | } |
| 2316 | // 插入 <Script> |
| 2317 | function insScript(selector, contextNode = document, toE = document.body) { |
| 2318 | let scriptElems = contextNode; |
no outgoing calls
no test coverage detected