mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-23 08:09:41 +01:00
Replace String.match() with RegExp.test(); it's slightly more efficient when we don't need the actual result
This commit is contained in:
parent
470b8514e4
commit
755ca7998e
@ -46,7 +46,7 @@ function convertImgSrc() {
|
||||
document.querySelectorAll("img").forEach(element => {
|
||||
if (element.hasAttribute("data-canonical-src")) {
|
||||
element.src = element.getAttribute("data-canonical-src")
|
||||
} else if (!element.src.match(/^[a-z]+\:\/\//i)) {
|
||||
} else if (!/^[a-z]+\:\/\//i.test(element.src)) {
|
||||
element.src = new URL(element.src, document.baseURI).href;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user