Skip to content

Commit

Permalink
comments and text
Browse files Browse the repository at this point in the history
  • Loading branch information
garygcchiu committed Nov 9, 2021
1 parent e48a85c commit 75f47a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ chrome.storage.sync.get("filterMixPlaylists", ({ filterMixPlaylists }) => {
shouldFilterMixPlaylists = filterMixPlaylists;
});

// helper functions
// helper functions (TODO: look into separating into different file, chrome extensions don't play nicely with modules)
const isWatchedVideo = (target) => (target.nodeName === WATCHED_VIDEO_BAR_NODE_NAME);
const isOldVideo = (target) => (target.nodeName === VIDEO_ELEMENT_NODE_NAME || target.nodeName === VIDEO_THUMBNAIL_NODE_NAME);
const isMixPlaylist = (target) => (target.nodeName === YOUTUBE_MIX_PLAYLIST_ELEMENT_NODE_NAME);
Expand All @@ -54,7 +54,7 @@ const filterWatchedVideo = (element) => {
const { watchedPercentage, videoMetadata, videoURL } = getVideoInformation(videoElement);
if (watchedPercentage > videoWatchedThreshold) {
console.log(`[Youtube Recommendations Filter] Removing watched video ${videoMetadata} from Recommendations (watched ${watchedPercentage}%). URL: ${videoURL}`);
videoElement.style.setProperty("display", "none");
videoElement.style.setProperty("display", "none"); // removing from DOM causes a lot of problems when new Recommendations are loaded
} else {
console.log(`[Youtube Recommendations Filter] NOT removing video ${videoMetadata}: only ${watchedPercentage}% watched, did not exceed ${videoWatchedThreshold}% threshold`);
}
Expand Down
4 changes: 2 additions & 2 deletions interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<div>
<label for="watched-threshold"><b>Watched Threshold (%):</b></label>
<input type="number" id="watched-threshold" min="0" max="100" />
<div>If you have watched less than this percentage of the video, the video won't be filtered out. Default: 0 (all watched videos filtered)</div>
<div>If you have watched less than this percentage of the video, it won't be filtered out. Default: 0 (all watched videos are filtered)</div>
</div>
<br/>
<div>
<label for="age-threshold"><b>Age Threshold (# years old):</b></label>
<input type="number" id="age-threshold" step="1" min="0" max="100" />
<div>If the video is younger than this value, the video won't be filtered out. Default: 5 (videos older than 5 years old filtered)</div>
<div>If the video is younger than this value, it won't be filtered out. Default: 5 (videos older than 5 years old are filtered)</div>
</div>
<br/>
<div>
Expand Down

0 comments on commit 75f47a4

Please sign in to comment.