FrostCo / AdvancedProfanityFilter

A browser extension to filter profanity from webpages
GNU General Public License v3.0
164 stars 27 forks source link

Xfinity Stream Filtering #495

Closed richardfrost closed 1 year ago

richardfrost commented 1 year ago

:movie_camera: The Site

www.xfinity.com

:speech_balloon: Subtitle Element/Node

Example:

<div id="inner-cc-container" style="position: absolute; left: 63.9px; top: 282.062px; width: 1150.2px; height: 611.044px; visibility: hidden;">
  <!-- ... -->
  <div style="position: absolute; width: 168.948px; height: 1.2em; font-family: &quot;monospaced sans serif&quot;; font-size: 23.5px; left: 21.875%; top: 86.6667%; display: block;">
    <svg width="100%" height="100%">
      <rect id="cc-window-rect-13" width="100%" height="100%" x="0" y="0" fill="rgb(0,0,0)" style="opacity: 0;"></rect>
      <rect id="cc-background-rect-row-13-0" width="168.947998046875" height="1.2em" x="0" y="0em" fill="rgb(0,0,0)" style="opacity: 1;"></rect>
      <rect id="cc-background-rect-row-13-1" width="0" height="1.2em" x="0" y="1em" fill="rgb(0,0,0)" style="opacity: 1;"></rect>
      <rect id="cc-background-rect-row-13-2" width="0" height="1.2em" x="0" y="2em" fill="rgb(0,0,0)" style="opacity: 1;"></rect>
      <text x="0" text-anchor="start" id="text-13-0" y="0" dy="0.96em" dx="0" font-weight="bold" font-size="23.5" font-style="normal" fill="rgb(255,255,255)" style="stroke: none; text-shadow: none; stroke-width: 0px; opacity: 1;">
        Come on, I came
      </text>
      <text x="0" text-anchor="start" id="text-13-1" y="0" dy="1.96em" dx="0" font-weight="bold" font-size="23.5" font-style="normal" fill="rgb(255,255,255)" style="stroke: none; text-shadow: none; stroke-width: 0px; opacity: 1;"></text>
      <text x="0" text-anchor="start" id="text-13-2" y="0" dy="2.96em" dx="0" font-weight="bold" font-size="23.5" font-style="normal" fill="rgb(255,255,255)" style="stroke: none; text-shadow: none; stroke-width: 0px; opacity: 1;"></text>
    </svg>
  </div>
  <div style="position: absolute; width: 257.569px; height: 1.2em; font-family: &quot;monospaced sans serif&quot;; font-size: 23.5px; left: 12.5%; top: 93.3333%; display: block;">
    <svg width="100%" height="100%">
      <rect id="cc-window-rect-14" width="100%" height="100%" x="0" y="0" fill="rgb(0,0,0)" style="opacity: 0;"></rect>
      <rect id="cc-background-rect-row-14-0" width="257.5693359375" height="1.2em" x="0" y="0em" fill="rgb(0,0,0)" style="opacity: 1;"></rect>
      <rect id="cc-background-rect-row-14-1" width="0" height="1.2em" x="0" y="1em" fill="rgb(0,0,0)" style="opacity: 1;"></rect>
      <rect id="cc-background-rect-row-14-2" width="0" height="1.2em" x="0" y="2em" fill="rgb(0,0,0)" style="opacity: 1;"></rect>
      <text x="0" text-anchor="start" id="text-14-0" y="0" dy="0.96em" dx="0" font-weight="bold" font-size="23.5" font-style="normal" fill="rgb(255,255,255)" style="stroke: none; text-shadow: none; stroke-width: 0px; opacity: 1;">
        all the way up here, dude.
      </text>
      <text x="0" text-anchor="start" id="text-14-1" y="0" dy="1.96em" dx="0" font-weight="bold" font-size="23.5" font-style="normal" fill="rgb(255,255,255)" style="stroke: none; text-shadow: none; stroke-width: 0px; opacity: 1;"></text>
      <text x="0" text-anchor="start" id="text-14-2" y="0" dy="2.96em" dx="0" font-weight="bold" font-size="23.5" font-style="normal" fill="rgb(255,255,255)" style="stroke: none; text-shadow: none; stroke-width: 0px; opacity: 1;"></text>
    </svg>
  </div>
</div>

:pencil: Additional notes

Link to the streaming landing page: https://www.xfinity.com/stream

This was requested in #490

richardfrost commented 1 year ago

Here is my attempt at a working config:

{
  "www.xfinity.com": [
    {
      "apfCaptions": true,
      "apfCaptionsSelector": "div#viper-player-container",
      "displaySelector": "div#viper-player-container div#inner-cc-container",
      "mode": "watcher",
      "subtitleSelector": "div#viper-player-container div#inner-cc-container svg > text",
      "videoSelector": "div#viper-player-container > video"
    }
  ]
}

To use this config, paste it into the Custom Sites area (Options page > Audio tab) and click the blue "SAVE" button underneath it. Then, make sure to refresh the tab for the video site (if you have it open still) and it will load this new configuration.

If you get a chance to test it, let me know how it works for you.

ampolisano commented 1 year ago

Tested and working in Google Chrome. Thank you so much!

richardfrost commented 1 year ago

Thanks for reporting back @ampolisano. I'll make sure to include this in the officially supported sites for the next version.

richardfrost commented 1 year ago

This has been included in version 3.1.0.

Once you get the update @ampolisano you should be able to remove the custom config we tested above.