PageSourceSearch

https://greenfoxwindows.ca/wp-content/themes/web3/l10c/ghostbuster.js

js greenfoxwindows.ca collected 2026-10-01 07:02:23 UTC 1,441 bytes, 40 lines download raw bytes

1
2  /* injected <style> ghostbuster v4 – recursive inline style neutralizer */
3  document.addEventListener("DOMContentLoaded", function () {
4    // Log to the console?
5    const useConsole = true;
6    // Font-related properties to hunt down
7    const fontProperties = [
8      "font", "font-family", "font-weight", "font-size",
9      "font-style", "line-height", "letter-spacing", "text-transform"
10    ];
11
12    // Regex to match any of those properties in a style string
13    const fontRegex = new RegExp(`\\b(${fontProperties.join("|")})\\s*:`, "i");
14
15    // Get all .entry-content zones
16    const entryZones = document.querySelectorAll(".entry-content");
17
18    entryZones.forEach(zone => {
19      // 1. Neutralize <style> tags inside .entry-content
20      const rogueStyles = zone.querySelectorAll("style");
21      rogueStyles.forEach(styleTag => {
22        if (useConsole) console.warn("Busted injected <style> tag in .entry-content", styleTag);
23        styleTag.remove();
24      });
25
26      // 2. Sweep all descendant elements inside the zone
27      const allDescendants = zone.querySelectorAll("*");
28
29      allDescendants.forEach(el => {
30        if (el.hasAttribute("style")) {
31          const styleValue = el.getAttribute("style");
32
33          if (fontRegex.test(styleValue)) {
34            if (useConsole) console.warn("Removing inline font style from:", el);
35            el.removeAttribute("style");
36          }
37        }
38      });
39    });
40  });

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.