|
1 | 1 | let sfw_mediaObserver = null; |
2 | 2 | let sfw_playListener = null; |
3 | | -let sfw_extraListeners = null; |
| 3 | +let sfw_extraListeners = null; |
4 | 4 |
|
5 | 5 | async function getSfwConfig() { |
6 | 6 | try { |
@@ -163,32 +163,28 @@ async function sfwswitch_switcher() { |
163 | 163 | } |
164 | 164 | } |
165 | 165 |
|
166 | | -const SFW_NEVER_UNBLUR_CSS = [ |
167 | | - ".thumbnail-container img,.detail-header-image,.wall-item-gallery,", |
168 | | - ".scene-player-container,.scene-cover,.scene-card-preview,.scrubber-item,", |
169 | | - ".scene-image,.scene-card img,.wall-item-media,.wall-item.show-title,", |
170 | | - ".image-card img,.image-thumbnail,.Lightbox-carousel,.image-image,", |
171 | | - ".react-photo-gallery--gallery img,.group-card-image,.gallery-image,", |
172 | | - ".gallery-card-image,.gallery-card img,.gallery-cover img,", |
173 | | - ".GalleryWallCard.GalleryWallCard-portrait,.GalleryWallCard.GalleryWallCard-landscape,", |
174 | | - ".performer-card img,.studio-card-image,.studio-card img,.tag-card img", |
175 | | - "{filter:blur(30px)!important}", |
176 | | - ".card-section-title,.detail-item-value,.TruncatedText,.scene-studio-overlay,", |
177 | | - ".scene-header>h3,h3.scene-header,.queue-scene-details,.marker-wall,", |
178 | | - ".performer-name,.card-section,.name-data,.aliases-data,.gallery-header.no-studio,", |
179 | | - ".studio-name,.studio-overlay a,.studio-logo,.studio-parent-studios,", |
180 | | - ".group-details>div>h2,h3.image-header,.TruncatedText.image-card__description,", |
181 | | - ".TruncatedText.tag-description,.tag-item.tag-link.badge.badge-secondary,.tag-name", |
182 | | - "{filter:blur(2px)!important}", |
183 | | -].join(""); |
184 | | - |
185 | 166 | function sfw_apply_never_unblur(enabled) { |
186 | 167 | const existing = document.getElementById("sfw-never-unblur"); |
187 | 168 | if (enabled && !existing) { |
188 | | - const style = document.createElement("style"); |
189 | | - style.id = "sfw-never-unblur"; |
190 | | - style.textContent = SFW_NEVER_UNBLUR_CSS; |
191 | | - document.head.appendChild(style); |
| 169 | + let css = ""; |
| 170 | + for (let s = 0; s < document.styleSheets.length; s++) { |
| 171 | + const sheet = document.styleSheets[s]; |
| 172 | + try { |
| 173 | + if (!sheet.href || !sheet.href.includes("/plugin/sfwswitch/css")) continue; |
| 174 | + for (let i = 0; i < sheet.cssRules.length; i++) { |
| 175 | + const rule = sheet.cssRules[i]; |
| 176 | + if (rule instanceof CSSStyleRule && !rule.selectorText.includes(":hover")) { |
| 177 | + css += `${rule.selectorText}{filter:${rule.style.filter}!important}`; |
| 178 | + } |
| 179 | + } |
| 180 | + } catch (e) {} |
| 181 | + } |
| 182 | + if (css) { |
| 183 | + const style = document.createElement("style"); |
| 184 | + style.id = "sfw-never-unblur"; |
| 185 | + style.textContent = css; |
| 186 | + document.head.appendChild(style); |
| 187 | + } |
192 | 188 | } else if (!enabled && existing) { |
193 | 189 | existing.remove(); |
194 | 190 | } |
|
0 commit comments