Guest User

Untitled

a guest
Dec 15th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.85 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Disable Infinite Scroll
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description disable infinite scrolling on youtube
  6. // @author You
  7. // @match *://*.youtube.com/*
  8. // @match *://*.youtu.be/*
  9. // @grant GM_addStyle
  10. // @grant GM_getValue
  11. // @grant GM.getValue
  12. // @grant GM.setValue
  13. // @grant GM_setValue
  14. // @grant GM_registerMenuCommand
  15. // @grant unsafeWindow
  16. // @run-at document-start
  17. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  18. // ==/UserScript==
  19.  
  20. 'use strict';
  21.  
  22.  
  23. /* PAGE LOCATION STATE */
  24. let pageLocation = PAGE_LOCATION.Home;
  25.  
  26. const getPageLocation = () => {
  27. const location = window.location;
  28.  
  29. if (location.pathname === '/') {
  30. return PAGE_LOCATION.Home;
  31. } else if (location.href.includes('/watch?')) {
  32. return PAGE_LOCATION.Video;
  33. } else if (location.pathname.startsWith('/user/') || location.pathname.startsWith('/c/')) {
  34. return PAGE_LOCATION.Channel;
  35. } else if (location.href.includes('/feed/trending')) {
  36. return PAGE_LOCATION.Trending;
  37. } else if (location.href.includes('/feed/explore')) {
  38. return PAGE_LOCATION.Explore;
  39. } else if (location.href.includes('/results?')) {
  40. return PAGE_LOCATION.SearchResults;
  41. } else if (location.href.includes('/shorts/')) {
  42. return PAGE_LOCATION.Shorts;
  43. }
  44. };
  45.  
  46. const setPageLocation = () => {
  47. pageLocation = getPageLocation();
  48. };
  49.  
  50.  
  51. /* OBSERVERS */
  52. let homeObserver = null;
  53. let playerObserver = null;
  54.  
  55. const PAGE_LOCATION = {
  56. "Home": 0,
  57. "Video": 1,
  58. "Channel": 2,
  59. "Trending": 3,
  60. "Explore": 4,
  61. "SearchResults": 5,
  62. "Shorts": 6
  63. };
  64.  
  65. const extensionName ="YouTube Redux";
  66. const logStyle = `background-image: linear-gradient(135deg, #e2e2e2 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%); color: black; padding: 5px; border-radius: 5px;`;
  67.  
  68. const log = (input, isError) => {
  69. if (typeof input === "object") {
  70. console.log(`%c${extensionName}: ${typeof input}`, logStyle);
  71. isError? console.error(input) : console.log(input);
  72. } else {
  73. console.log(`%c${extensionName}: ${input}`, logStyle);
  74. }
  75. };
  76.  
  77. const INFINITE_SCROLLING_MODE = {
  78. "Comments": 0,
  79. "Related": 1
  80. };
  81.  
  82. let reduxSettings = {
  83. "autoConfirm":true,
  84. "disableInfiniteScrolling": true,
  85. "fixHomepage":true,
  86. };
  87.  
  88. const defaultSettings = {
  89. "gridItems": 6,
  90. "hideAutoplayButton": false,
  91. "hideCastButton": false,
  92. "darkPlaylist": true,
  93. "smallPlayer": true,
  94. "smallPlayerWidth": 853,
  95. "showRawValues": true,
  96. "classicLikesColors": false,
  97. "autoConfirm": true,
  98. "disableInfiniteScrolling": true,
  99. "blackBars": false,
  100. "rearrangeInfoRe": true,
  101. "rearrangeInfoNew": true,
  102. "classicLogoChoice": 2017,
  103. "filterMainRe": false,
  104. "filterVideo": true,
  105. "filterMiniRe": true,
  106. "extraLayout": true,
  107. "darkerRed": false,
  108. "trueFullscreen": false,
  109. "favicon": 3,
  110. "channelListView": false,
  111. "squareAvatar": true,
  112. "squareSubs": true,
  113. "hideHomeAvatars": false,
  114. "noHomeScalingRe": true,
  115. "squareSearch": false,
  116. "extraSidebarStyles": true,
  117. "altVideoLayout": false,
  118. "altVideoLayoutExtra": false,
  119. "playlistsFirst": true,
  120. "sortFoundPlaylists": true,
  121. "customTitleFont": false,
  122. "titleFontValue": "Arial",
  123. "hideVoiceSearch": false,
  124. "subBorder": true,
  125. "classicLikesStyle": true,
  126. "hideApps": false,
  127. "classicLikesIconColors": false,
  128. "hideJoinButton": false,
  129. "hideClip": false,
  130. "hidePeopleSearch": true,
  131. "trimSubs": false,
  132. "trimViews": false,
  133. "altStrings": false,
  134. "extraChannel": true,
  135. "noPlayerActionAnimations": false,
  136. "altLoader": false,
  137. "altLoaderSmaller": false,
  138. "showChangelog": true,
  139. "oldIcons": true,
  140. "myChannel": false,
  141. "myChannelCustomText": "My channel",
  142. "extraComments": true,
  143. "collapseSidebar": false,
  144. "hideRelatedVideoAge": true,
  145. "hideVideoCategory": true,
  146. "hideLicensingInfo": true,
  147. "moveAutoplay": true,
  148. "disableMiniplayer": false,
  149. "hideCountryCode": false,
  150. "hideCollapsedChat": false,
  151. "disableVideoPreview": false,
  152. "autoExpandPlaylists": false,
  153. "autoExpandSubs": false,
  154. "fixHomepage": true,
  155. "compatibleDislikesRe": true,
  156. "hideDislikes": false,
  157. "hideDownload": false,
  158. "hideChaptersInDescription": true,
  159. "hideMusicInDescription": false,
  160. "hideHeatmap": false
  161. };
  162.  
  163. let flags = {
  164. "likesChanged":false,
  165. "stylesChanged":false,
  166. "isRearranged":false,
  167. "isRearrangedNew":false,
  168. "likesTracked":false,
  169. "recalcListenersAdded":false,
  170. "trueFullscreenListenersAdded":false,
  171. "homeObserverAdded": false
  172. };
  173. let alignRetry = {
  174. startCount: 0,
  175. maxCount: 5,
  176. timeout: 20
  177. };
  178. let YTReduxURLPath;
  179. let YTReduxURLSearch;
  180. let confirmInterval;
  181. let observerComments;
  182. let observerRelated;
  183. let intervalsArray = [];
  184. let isCheckingRecalc = false;
  185.  
  186.  
  187.  
  188. function startObservingScrolling(mode) {
  189. let maxComments = 20;
  190. let commentsInterval = 20;
  191. let commentsContElement;
  192. let maxRelated;
  193. let relatedInterval = 20;
  194. let relatedElement;
  195. let related;
  196. let relatedContinuation;
  197.  
  198. function disableInfiniteComments() {
  199. let comments = document.querySelectorAll('#contents > ytd-comment-thread-renderer');
  200. commentsContElement = document.querySelector('ytd-comments#comments ytd-item-section-renderer > #contents > ytd-comment-thread-renderer + ytd-continuation-item-renderer');
  201. if (comments.length >= maxComments && commentsContElement != null) {
  202. observerComments.disconnect();
  203. commentsContElement.remove();
  204. if (document.querySelector('#show-more-comments') == null) {
  205. addCommentsButton();
  206. }
  207. }
  208. }
  209.  
  210. function disableInfiniteRelated() {
  211. setLayoutDifferences();
  212. if (related.length >= maxRelated && relatedContinuation != null) {
  213. observerRelated.disconnect();
  214. relatedContinuation.remove();
  215. if (document.querySelector('#show-more-related') == null) {
  216. addRelatedButton();
  217. }
  218. }
  219. }
  220.  
  221. function addCommentsButton() {
  222. let showMoreComments = document.createElement('div');
  223. let continueElement = commentsContElement;
  224. let showMoreText = document.querySelector('.more-button.ytd-video-secondary-info-renderer') == null ? 'SHOW MORE' : document.querySelector('.more-button.ytd-video-secondary-info-renderer').textContent;
  225. showMoreComments.id = 'show-more-comments';
  226. showMoreComments.style = 'text-align:center; margin-bottom: 16px; margin-right: 15px;';
  227. showMoreComments.innerHTML = '<input type="button" style="font-family: Roboto, Arial, sans-serif; padding-top: 9px; width: 100%; border-top: 1px solid #e2e2e2; border-bottom: none; border-left: none; border-right: none; background:none; font-size: 1.1rem; outline: none; cursor:pointer; text-transform: uppercase; font-weight: 500; color: var(--redux-spec-text-secondary); letter-spacing: 0.007px; padding-bottom: 8px;"></input>';
  228. showMoreComments.querySelector('input').value = showMoreText;
  229. contentsElement.append(showMoreComments);
  230. document.querySelector('#show-more-comments').onclick = function() {
  231. let comments = document.querySelector('ytd-comments#comments ytd-item-section-renderer > #contents');
  232. comments.append(continueElement);
  233. window.scrollBy({top: 50, left: 0, behavior: "smooth"});
  234. this.remove();
  235. maxComments += commentsInterval;
  236. observerComments.observe(contentsElement, observerConfig);
  237. };
  238. }
  239.  
  240. function addRelatedButton() {
  241. let showMoreRelated = document.createElement('div');
  242. let continueElement = relatedContinuation;
  243. let showMoreText = document.querySelector('.more-button.ytd-video-secondary-info-renderer') == null ? 'SHOW MORE' : document.querySelector('.more-button.ytd-video-secondary-info-renderer').textContent;
  244. showMoreRelated.id = 'show-more-related';
  245. showMoreRelated.style = 'text-align:center; margin-top: 4px; margin-right: 15px';
  246. showMoreRelated.innerHTML = '<input type="button" style="font-family: Roboto, Arial, sans-serif; padding-top: 9px; width: 100%; border-top: 1px solid #e2e2e2; border-bottom: none; border-left: none; border-right: none; background:none; font-size: 1.1rem; outline: none; cursor:pointer; text-transform: uppercase; font-weight: 500; color: var(--redux-spec-text-secondary); letter-spacing: 0.007px;"></input>';
  247. showMoreRelated.querySelector('input').value = showMoreText;
  248. relatedElement.append(showMoreRelated);
  249. document.querySelector('#show-more-related').onclick = function() {
  250. relatedElement.append(continueElement);
  251. window.scrollBy({top: 50, left: 0, behavior: "smooth"});
  252. this.remove();
  253. maxRelated += relatedInterval;
  254. observerRelated.observe(relatedElement, observerConfig);
  255. };
  256. }
  257.  
  258. function setLayoutDifferences() {
  259. if (document.querySelector('#secondary > #secondary-inner > #related > ytd-watch-next-secondary-results-renderer > #items').childElementCount <= 3) { //condition for differences in layout between YT languages
  260. relatedElement = document.querySelector('#secondary > #secondary-inner > #related > ytd-watch-next-secondary-results-renderer > #items > ytd-item-section-renderer > #contents');
  261. related = relatedElement.querySelectorAll('ytd-compact-video-renderer, ytd-compact-radio-renderer, ytd-compact-playlist-renderer'); //normal video + mix + playlist
  262. relatedContinuation = relatedElement.querySelector('ytd-continuation-item-renderer');
  263. } else {
  264. relatedElement = document.querySelector('#secondary > #secondary-inner > #related > ytd-watch-next-secondary-results-renderer > #items');
  265. related = relatedElement.querySelectorAll('.ytd-watch-next-secondary-results-renderer');
  266. relatedContinuation = relatedElement.querySelector('ytd-continuation-item-renderer');
  267. }
  268. }
  269.  
  270. const observerConfig = {
  271. childList: true
  272. };
  273. const contentsElement = document.querySelector('#comments > #sections > #contents.style-scope.ytd-item-section-renderer');
  274.  
  275. if (mode === INFINITE_SCROLLING_MODE.Comments) {
  276. if (!!document.querySelector('#show-more-comments')) {document.querySelector('#show-more-comments').remove();}
  277. observerComments = new MutationObserver(disableInfiniteComments);
  278. observerComments.observe(contentsElement, observerConfig);
  279.  
  280. const sortButtons = document.querySelectorAll('div[slot="dropdown-content"] > #menu > a');
  281. sortButtons.forEach(element => {
  282. element.onclick = resetCommentsObserver;
  283. });
  284. } else if (mode === INFINITE_SCROLLING_MODE.Related) {
  285. if (!!document.querySelector('#show-more-related')) {document.querySelector('#show-more-related').remove();}
  286. setLayoutDifferences();
  287.  
  288. maxRelated = related.length >= 39 ? 20 : related.length; //to reset max on url change;
  289. if (related.length >= maxRelated && relatedContinuation != null) {
  290. relatedContinuation.remove();
  291. addRelatedButton();
  292. }
  293. observerRelated = new MutationObserver(disableInfiniteRelated);
  294. observerRelated.observe(relatedElement, observerConfig);
  295. }
  296.  
  297. function resetCommentsObserver() {
  298. const comments = document.querySelectorAll('#contents > ytd-comment-thread-renderer');
  299. comments.forEach(element => {
  300. element.remove();
  301. });
  302. if (!!document.querySelector('#show-more-comments')) {document.querySelector('#show-more-comments').remove();}
  303. maxComments = 20;
  304. observerComments.observe(contentsElement, observerConfig);
  305. }
  306. }
  307.  
  308. function confirmIt() {
  309. let confirmButton = document.querySelector('paper-dialog > yt-confirm-dialog-renderer > div:last-child > div > #confirm-button') || document.querySelector('ytd-popup-container yt-confirm-dialog-renderer > #main > div.buttons > #confirm-button');
  310. if (!confirmButton) return;
  311. let buttonParent = confirmButton.closest('tp-yt-paper-dialog');
  312. let buttonParentVisible = buttonParent.style.display !== 'none';
  313. let buttonVisible = document.querySelector('ytd-popup-container tp-yt-paper-dialog:not([aria-hidden="true"])');
  314. let popupElement = document.querySelector('ytd-popup-container yt-confirm-dialog-renderer > #main > div.buttons > yt-button-renderer');
  315. let popupTypeCheck = popupElement == null ? false : popupElement.hasAttribute('hidden');
  316. if (confirmButton != null && !!buttonVisible && popupTypeCheck && buttonParentVisible) {
  317. confirmButton.click();
  318. document.querySelector('video').play();
  319. //log('Clicked at: ' + new Date());
  320. }
  321. }
  322.  
  323. function waitForElement(selector, interval, callback) {
  324. let wait = setInterval(() => {
  325. let element = document.querySelector(selector);
  326. if (element != null) {
  327. clearInterval(wait);
  328. let index = intervalsArray.indexOf(wait); //get index of and remove the previously added interval from array when it's cleared
  329. intervalsArray.splice(index, 1);
  330. callback();
  331. }
  332. }, interval);
  333. intervalsArray.push(wait); //add current interval to array
  334. }
  335.  
  336. function changeGridWidth() {
  337. let styleItem;
  338.  
  339. const changeGridAction = () => {
  340. if (flags.homeObserverAdded) {
  341. homeObserver.disconnect();
  342. }
  343.  
  344. styleItem = document.querySelector('#primary > ytd-rich-grid-renderer');
  345. if (!styleItem) return;
  346. let currentStyle = styleItem.style.cssText;
  347. let currentStyleArray = currentStyle.split(";");
  348.  
  349. for (let i = 0; i < currentStyleArray.length-1; i++) { //split, replace and join settings on the fly
  350. if (currentStyleArray[i].includes('--ytd-rich-grid-items-per-row')) {
  351. let splitElement = currentStyleArray[i].split(":");
  352. splitElement[1] = reduxSettings.gridItems + '!important'; //to override different important from css
  353. currentStyleArray[i] = splitElement.join(":");
  354. }
  355. }
  356. styleItem.style.cssText = currentStyleArray.join(";");
  357.  
  358. if (flags.homeObserverAdded) {
  359. homeObserver.observe(styleItem, {attributes: true, attributeFilter: ['style']});
  360. }
  361. };
  362.  
  363. changeGridAction();
  364.  
  365. if (pageLocation === PAGE_LOCATION.Home) {
  366. if (!flags.homeObserverAdded) {
  367. //observe since YT keeps restoring grid values on page navigation
  368. homeObserver = new MutationObserver(() => {
  369. changeGridAction();
  370. });
  371. homeObserver.observe(styleItem, {attributes: true, attributeFilter: ['style']});
  372. flags.homeObserverAdded = true;
  373. }
  374. }
  375. }
  376.  
  377. function main() {
  378. if (reduxSettings.autoConfirm) {
  379. if (confirmInterval == undefined) {
  380. confirmInterval = setInterval(confirmIt, 500);
  381. setInterval(() => {
  382. let keyboardEvent = document.createEvent('KeyboardEvent');
  383. let initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent';
  384.  
  385. keyboardEvent[initMethod](
  386. 'keydown', // event type: keydown, keyup, keypress
  387. true, // bubbles
  388. true, // cancelable
  389. window, // view: should be window
  390. false, // ctrlKey
  391. false, // altKey
  392. false, // shiftKey
  393. false, // metaKey
  394. 113, // keyCode: unsigned long - the virtual key code, else 0
  395. 0, // charCode: unsigned long - the Unicode character associated with the depressed key, else 0
  396. );
  397. document.dispatchEvent(keyboardEvent);
  398. }, 60000*10);
  399. }
  400. }
  401.  
  402. if (reduxSettings.disableInfiniteScrolling && pageLocation === PAGE_LOCATION.Video) {
  403. waitForElement('#contents > ytd-comment-thread-renderer, #contents > ytd-message-renderer', 10, () => { startObservingScrolling(INFINITE_SCROLLING_MODE.Comments); }); // additional element in selector for videos with disabled comments
  404. }
  405. if (reduxSettings.disableInfiniteScrolling && pageLocation === PAGE_LOCATION.Video) {
  406. waitForElement('#secondary > #secondary-inner > #related > ytd-watch-next-secondary-results-renderer > #items ytd-continuation-item-renderer', 10, () => { startObservingScrolling(INFINITE_SCROLLING_MODE.Related); });
  407.  
  408. }
  409. if (pageLocation === PAGE_LOCATION.Home) {
  410. waitForElement('#primary > ytd-rich-grid-renderer', 10, changeGridWidth);
  411. }
  412. }
  413.  
  414. function addClearHomepageEvent(selector, clearPlaylists) {
  415. const elements = document.querySelectorAll(selector);
  416. for (const element of elements) {
  417. element.addEventListener('click', () => {
  418. const reduxHomeContainerItems = document.querySelectorAll('.redux-home-container > ytd-rich-item-renderer');
  419. const reduxPlaylistContainerItems = document.querySelectorAll('.redux-playlist > ytd-rich-item-renderer');
  420. const containerItems = clearPlaylists ? [...reduxHomeContainerItems, ...reduxPlaylistContainerItems] : reduxHomeContainerItems;
  421. for (const item of containerItems) {
  422. item.style.opacity = '0';
  423. }
  424. setTimeout(() => {
  425. for (const item of containerItems) {
  426. item.remove();
  427. }
  428. }, 1000);
  429. });
  430. }
  431. }
  432.  
  433. function moveTopLevelItems() {
  434. let topLevelElements = document.querySelectorAll('.ytd-video-primary-info-renderer > #top-level-buttons-computed > *:not(ytd-toggle-button-renderer):not([is-hidden]), #info #flexible-item-buttons > *');
  435. let infoContents = document.querySelector('#info-contents > ytd-video-primary-info-renderer');
  436. let infoDiv = document.querySelector('#info-contents div#info');
  437. let miscButton = document.querySelector('#info-contents ytd-video-primary-info-renderer > yt-icon-button');
  438. let existingMovedItem = document.querySelector('[redux-last-top-stream]')
  439. || document.querySelector('yt-icon-button[redux-last-top]')
  440. || document.querySelector('ytd-button-renderer[redux-last-top]');
  441.  
  442. if (reduxSettings.altVideoLayout) {
  443. document.querySelector('ytd-video-primary-info-renderer').style = 'padding-left: 15px !important; padding-top: 15px !important';
  444. if (miscButton != null) {
  445. infoDiv.prepend(miscButton);
  446. miscButton.style = 'transform: translateY(0px)';
  447. }
  448.  
  449. for (let i = 0; i < topLevelElements.length; i++) {
  450. infoDiv.prepend(topLevelElements[i]);
  451. topLevelElements[i].classList.add('redux-moved-info');
  452. topLevelElements[i].setAttribute('redux-url-check', window.location.search);
  453. }
  454.  
  455. if (reduxSettings.altVideoLayoutExtra) {
  456. let remainingTopLevel = document.querySelector('#info #top-level-buttons-computed');
  457. let likesValues = [
  458. document.querySelectorAll('ytd-toggle-button-renderer #text.ytd-toggle-button-renderer')[0].getAttribute('aria-label'),
  459. document.querySelectorAll('ytd-toggle-button-renderer #text.ytd-toggle-button-renderer')[1].getAttribute('aria-label')
  460. ];
  461. let separator = ", ";
  462. if (likesValues[0] == null) {
  463. likesValues[0] = "";
  464. separator = "";
  465. }
  466. if (likesValues[1] == null) {
  467. likesValues[1] = "";
  468. separator = "";
  469. }
  470. let menu = document.querySelector('#menu.ytd-video-primary-info-renderer');
  471. let likesText = document.createTextNode(`${likesValues[0]}${separator}${likesValues[1]}`);
  472.  
  473. document.querySelector('#info.ytd-video-primary-info-renderer > #menu-container').style = 'transform: translateY(0px) !important;';
  474. for (let i = 0; i < menu.childNodes.length; i++) { //remove existing text nodes
  475. if (menu.childNodes[i].nodeType == 3) {
  476. menu.childNodes[i].remove();
  477. }
  478. }
  479.  
  480. menu.prepend(likesText);
  481. infoDiv.prepend(remainingTopLevel);
  482. }
  483.  
  484. } else {
  485. for (let i = topLevelElements.length-1; i >= 0; i--) {
  486. infoContents.insertBefore(topLevelElements[i], existingMovedItem);
  487. topLevelElements[i].classList.add('redux-moved-info');
  488. topLevelElements[i].setAttribute('redux-url-check', window.location.search);
  489. }
  490. }
  491. }
  492.  
  493.  
  494. function clearStoredIntervals() {
  495. intervalsArray.forEach(element => {
  496. clearInterval(element);
  497. intervalsArray.shift();
  498. });
  499. }
  500.  
  501. function clearMovedInfo() {
  502. let moveInfo = document.querySelectorAll('.redux-moved-info');
  503. moveInfo.forEach(element => element.remove());
  504. waitForElement('.ytd-video-primary-info-renderer > #top-level-buttons-computed > *:not(ytd-toggle-button-renderer):not([is-hidden])', 10, moveTopLevelItems);
  505. }
  506.  
  507. (() => {
  508. setPageLocation();
  509.  
  510. try {
  511. main();
  512. } catch (error) {
  513. log(error, true);
  514. }
  515.  
  516. if (reduxSettings.fixHomepage) {
  517. const logoSelector = 'ytd-topbar-logo-renderer#logo';
  518. waitForElement(logoSelector, 10, () => {
  519. addClearHomepageEvent(logoSelector);
  520. });
  521.  
  522. const filtersSelector = '[page-subtype="home"] #chips yt-chip-cloud-chip-renderer';
  523. waitForElement(filtersSelector, 10, () => {
  524. addClearHomepageEvent(filtersSelector, true);
  525. });
  526. }
  527.  
  528. YTReduxURLPath = location.pathname;
  529. YTReduxURLSearch = location.search;
  530.  
  531. setInterval(function() {
  532. if (location.pathname != YTReduxURLPath || location.search != YTReduxURLSearch) {
  533. setPageLocation();
  534. YTReduxURLPath = location.pathname;
  535. YTReduxURLSearch = location.search;
  536. flags.likesChanged = false;
  537.  
  538. if (reduxSettings.disableInfiniteScrolling) {
  539. if (observerComments != undefined) {
  540. observerComments.disconnect();
  541. }
  542. if (observerRelated != undefined) {
  543. observerRelated.disconnect();
  544. }
  545. let comments = document.querySelectorAll('#contents > ytd-comment-thread-renderer');
  546. comments.forEach(element => { //remove comments because YT sometimes keeps old ones after url change which messes with comments observer checking their length; also applied when sorting
  547. element.remove();
  548. });
  549. }
  550.  
  551. clearStoredIntervals();
  552.  
  553. if (!!document.querySelector('.redux-moved-info')
  554. && pageLocation === PAGE_LOCATION.Video
  555. && document.querySelector('.redux-moved-info').getAttribute('redux-url-check') != window.location.search) {
  556. clearMovedInfo(); //contains an interval
  557. }
  558.  
  559. try {
  560. main();
  561. } catch (error) {
  562. log(error, true);
  563. }
  564. }
  565. }, 100);
  566. })();
Add Comment
Please, Sign In to add comment