Skip to content

Commit

Permalink
Add adblock
Browse files Browse the repository at this point in the history
  • Loading branch information
edanchenkov committed Jun 25, 2020
1 parent 3aa817d commit b31eace
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MenuTube",
"version": "1.6.1",
"version": "1.6.2",
"description": "Catch YouTube into your macOS menu bar!",
"main": "main.js",
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions src/wvHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ document.addEventListener = () => {
};

(function () {

const _check = v => v !== null && v !== undefined && !isNaN(v);
setInterval(() => {
const ad = [...document.querySelectorAll('.ad-showing')][0];
if (_check(ad)) {
const video = document.querySelector('video');
if (_check(video) && _check(video.duration)) {
video.currentTime = video.duration;
}
}
}, 500);

var ipcRenderer = require('electron').ipcRenderer;
var attempts = 1000;

Expand Down

0 comments on commit b31eace

Please sign in to comment.