mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00: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:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user