summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2017-07-05 17:15:10 +0530
committerArun Isaac2017-07-05 18:06:49 +0530
commit2d797c6b7d48763d481f72b3a7b8788b35ee6127 (patch)
tree738de0b88480f3d1a1687f43c86e29ce2734ea11
parentfb27d6ce818f5dd2836c2a48ce825a7649a55f9c (diff)
downloadyoutube-noscript-shim-2d797c6b7d48763d481f72b3a7b8788b35ee6127.tar.gz
youtube-noscript-shim-2d797c6b7d48763d481f72b3a7b8788b35ee6127.tar.lz
youtube-noscript-shim-2d797c6b7d48763d481f72b3a7b8788b35ee6127.zip
Remove `blockVideos'.
* viewtube.js (blockVideos): Remove function. This function, part of ViewTube, is not relevant to YouTube.
-rw-r--r--viewtube.js63
1 files changed, 0 insertions, 63 deletions
diff --git a/viewtube.js b/viewtube.js
index dda3e99..5ed5a7a 100644
--- a/viewtube.js
+++ b/viewtube.js
@@ -519,68 +519,6 @@
}
}
-
- // ==========Websites========== //
-
- // Fixes
-
- var blockObject = page.doc;
- var blockInterval = 50;
-
- function blockVideos() {
- var elVideos = getMyElement(blockObject, 'video', 'tag', '', -1, false);
- if (elVideos.length > 0) {
- for (var v = 0; v < elVideos.length; v++) {
- var elVideo = elVideos[v];
- if (elVideo && elVideo.id != 'vtVideo' && elVideo.currentSrc) {
- if (!elVideo.paused) {
- elVideo.pause();
- if (page.url.indexOf('youtube.com/watch') == -1) elVideo.src = "#";
- }
- }
- }
- }
- var elEmbeds = getMyElement(blockObject, 'embed', 'tag', '', -1, false) || getMyElement(blockObject, 'object', 'tag', '', -1, false);
- if (elEmbeds.length > 0) {
- for (var e = 0; e < elEmbeds.length; e++) {
- var elEmbed = elEmbeds[e];
- if (elEmbed && elEmbed.id != 'vtVideo' && elEmbed.parentNode) {
- elEmbed.parentNode.removeChild(elEmbed);
- }
- }
- }
- if (blockObject !== page.doc) {
- var elFrames = getMyElement(blockObject, 'iframe', 'tag', '', -1, false);
- if (elFrames.length > 0) {
- for (var e = 0; e < elFrames.length; e++) {
- var elFrame = elFrames[e];
- if (elFrame && elFrame.parentNode)
- elFrame.parentNode.removeChild(elFrame);
-
- }
- }
- }
- }
- blockVideos();
-
- page.win.setInterval(function() {
-
- // Force page reload on title and location change
- if (page.title != page.doc.title && page.url != page.win.location.href) {
- if (player['playerSocket']) styleMyElement(player['playerSocket'], {display: 'none'});
- page.title = page.doc.title;
- page.url = page.win.location.href;
- page.win.location.reload();
- }
-
- // Block videos
- if (blockObject && blockInterval > 0) {
- blockVideos();
- if (blockInterval > 0) blockInterval--;
- }
-
- }, 500);
-
// =====YouTube===== //
/* Redirect Categories */
@@ -760,7 +698,6 @@
styleMyElement(myPlayerWindow, {position: 'relative', width: ytPlayerWidth + 'px', height: ytPlayerHeight + 'px', backgroundColor: '#FFFFFF'});
modifyMyElement(ytPlayerWindow, 'div', '', false, true);
ytPlayerWindow.appendChild(myPlayerWindow);
- blockObject = ytPlayerWindow;
/* Update Sizes */
page.win.addEventListener('resize', function() {