你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/4255-linkify-plus-plus/discussions/9469,源站連結 點此以跳轉。
Based on Linkify Plus. Turn plain text URLs into links.
Seems like a bug in FF's implementation of string comparison and/or xpath. I've attached a screenshot from gecko profiler addon. BTW, I wonder if using asm.js could help by speeding up such functions as isIP, inAngular, stripSingleParenthesis... Or maybe it's faster to directly access the DOM tree and analyze text content per element...
Here's the xpath in version 2.4.3.
document.evaluate(".//text()[not(ancestor::a) and not(ancestor::code) and not(ancestor::head) and not(ancestor::noscript) and not(ancestor::option) and not(ancestor::script) and not(ancestor::style) and not(ancestor::title) and not(ancestor::textarea) and not(ancestor::svg) and not(ancestor::canvas) and not(ancestor::button) and not(ancestor::select) and not(ancestor::template) and not(ancestor::meter) and not(ancestor::progress) and not(ancestor::math) and not(ancestor::h1) and not(ancestor::h2) and not(ancestor::h3) and not(ancestor::h4) and not(ancestor::h5) and not(ancestor::h6) and not(ancestor::*[contains(@class, 'highlight') or contains(@class, 'editbox') or contains(@class, 'code') or contains(@class, 'brush:') or contains(@class, 'bdsug')]) and not(ancestor::*[@contenteditable='true']) and not(ancestor::*[contains(@class, 'linkifyplus')])]", document.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null)
It took 6~7 seconds to execute on my notebook. I agree that filtering out the ancestors is not the best idea.
I'll try to use other methods, including traversing the DOM tree.
Updated to version 3.0.0. The script will traverse the DOM now.
missed your comment until now - i was never notified
thanks, i'll give the script another shot :)
significant increase in page load time - browser stops responding
win 7
ff 33.*
LPP 2.4.3
on quite a few sites i am seeing a very significant increase in load time while the browser stops responding - this is one example where the load time is > 20 sec. (560+ KB) ...
https://github.com/RequestPolicyContinued/requestpolicy/compare/RequestPolicy:dev-1.0...dev-1.0