Skip to content

Commit

Permalink
perf: 优化匹配规则,减少计算量
Browse files Browse the repository at this point in the history
  • Loading branch information
yujinpan committed Mar 30, 2020
1 parent a6bc117 commit 919c5f5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/super-image-reptile.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,17 @@
* @param {Function} callback 参数为 url 值
*/
function imagesReptile(callback) {
const elements = Array.from(document.querySelectorAll('*'));
const elements = Array.from(document.querySelectorAll(`
*
:not(head)
:not(script)
:not(textarea)
:not(input)
:not(meta)
:not(title)
:not(style)
:not(link)
`));
const elem = document.querySelector('.SIR-download-program');
elem.classList.add('active');
elem.innerHTML = getProgramHTML(0, elements.length);
Expand Down

0 comments on commit 919c5f5

Please sign in to comment.