Untitled Diff

// ==UserScript==
// ==UserScript==
// @name 7ktTube | 2016 REDUX
// @name 7ktTube | 2016 REDUX
// @namespace STILL_ALIVE
// @namespace STILL_ALIVE
// @version 3.4.6
// @version 3.4.7
// @description Old YouTube 2016 Layout | Old watchpage | Change thumbnail & video player size | grayscale seen video thumbnails | Hide suggestion blocks, category/filter bars | Square profile-pictures | Disable hover thumbnail previews | and much more!
// @description Old YouTube 2016 Layout | Old watchpage | Change thumbnail & video player size | grayscale seen video thumbnails | Hide suggestion blocks, category/filter bars | Square profile-pictures | Disable hover thumbnail previews | and much more!
// @author 7KT-SWE
// @author 7KT-SWE
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAACnVBMVEUAAAD////////94+PX19f+8fH/////////+fn83Nz////////////////////////////////////////////////////////////829vS0tL////////////////////////////////////////////////y8vLp6en95+f////////////sKCgAAADpCQnqDg7pBgbqCwvsHh7sICDsIyPtKirsJibrGhr1kZHyaGjrGBjnAAD81tbrHBz3oqLsJSXxX1/qEBDp6enxZGSysrIVFRX2k5PxWVnqEhK0tLT1gYHtLCzqFBTybW3wUlLtMDDtMjLz8/PuOzvqFxcHBwf95eX0iIjxYGDvQEDpAQF/f3/wU1PuNTX+7e394+PuODgfHx///f3+9PT6xMT4qKilpaX1i4v82dnvR0f/+vr+8vLj5OT2nJzzcnLzcHDwS0vvRETrFRXx8fH7z8/5urrsk5N2dnbxVlbwT08iIiL83d380dH7ycmqqqr1jo70fHx0dHT7JSX6+vr39/f/9vb+8/P+6ur83Nz71NTR0dH5tLT3paX2mZn1iIj1hYXxXFwFBQXNzc33r6/3n5+JiYmFhYV6enrzeHhJSUkiPDzpDw8LDAz95+f7zc36vr68vLyUlJTzdXVra2vyamo0NDTrJib8ICD5Hh4dHR0RERHf39/Y2Nj7zs7Gxsb6v7+2trbvra2Xl5eQkJDybGxeXl5XV1dMTExHR0c7OzsdNjYuLi4SLS38KiopKSn9/Pzv+vr839+8yMj5w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O1k2HfNXAjLQLJauIUgXIVk2nU0Lfy2w2WaAESNATyrZhNPRFEFY9xT5IgP1glm/E9CpBUMTk13ipN8uvWAlYx8Wl66ZQCxd4wltESexUlg30FxBoBesp53pkt1yO/XQKJhlty9XJpzWJH/b7RFSwSRbeK2TuXQ9GL5sPDAKwGBoJD0gXzV2tJ4cxhV+FxHsNwh2SckFLn9s+WAUaIylmeX683WUQBa/mw2bRDNsbFIBJ08AmAHTFiQVzPBxri59tPMRIZknglWGTaLxnLqKFvm+pO/oXvJ0hHSh41hl4RUYRVLaDPXLKU8NGwgUFvoZt4UIZsV6kA+vl9xiTOBwLwvPmLEz3B4Pbp7pDH+/Rc3s/mnNp09ftFK2zl40fXrzvl5mBexSn8kMvoZvgTsxYrAl9nXCSbfAG3XqVuNY2aIiRiUpGuXIpbyVbdmSg8+2KDocIsvznOiAWKRAl16rWcrCo2s8jDC2ZcspPONyx260bTzealQ3S1cyavsCxyJiA4N3WK0OnhdsCPQ9CBecvEVC9eovRVuttCSo5zIeN8Uaq9u9YVa0mIjArCDbvdqG9eyAie3zVu9wsmGtbbkv9FK8ae1L9Cm85W54aSDMUaa1z4wiLw0YX3tY0iXAmnL/rfR68tpD/IsbfZrRlMgJiCybFgTORjN+srJvlOTVk0Gt3VHaCqHRVz6Xy+PxSAiR4FAQFSQIvAT9UVKmaStC5qa0wEmlXKnkL8/smLB+6KqOe8ecb92yfXDysAj8G6fXG+rSFePm3QienHbp6oVEIpEpnYOrVzfbP3pzx1Xt1jUfYHx5JtXrP4QCBQrkhTTMTShYsSCiYm4F9H/wklxGjK///ALA2h/WmqCBcwAAAABJRU5ErkJggg==
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAACnVBMVEUAAAD////////94+PX19f+8fH/////////+fn83Nz////////////////////////////////////////////////////////////829vS0tL////////////////////////////////////////////////y8vLp6en95+f////////////sKCgAAADpCQnqDg7pBgbqCwvsHh7sICDsIyPtKirsJibrGhr1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BecvEVC9eovRVuttCSo5zIeN8Uaq9u9YVa0mIjArCDbvdqG9eyAie3zVu9wsmGtbbkv9FK8ae1L9Cm85W54aSDMUaa1z4wiLw0YX3tY0iXAmnL/rfR68tpD/IsbfZrRlMgJiCybFgTORjN+srJvlOTVk0Gt3VHaCqHRVz6Xy+PxSAiR4FAQFSQIvAT9UVKmaStC5qa0wEmlXKnkL8/smLB+6KqOe8ecb92yfXDysAj8G6fXG+rSFePm3QienHbp6oVEIpEpnYOrVzfbP3pzx1Xt1jUfYHx5JtXrP4QCBQrkhTTMTShYsSCiYm4F9H/wklxGjK///ALA2h/WmqCBcwAAAABJRU5ErkJggg==
// @icon64 data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAACNFBMVEUAAAD////////4rKyYmJj////3pqb7zMz4trb////////////////////////819f5wMD////////////83d36xMT5urqOjo7/////////////+Pj+8vL96+v95+f95eX84+O6urr4r6+qqqr3qKj////////////////sKCgAAADsJCTsKSnrICDpCgrrHh7qERHsIiLpBQX+8PDrGxvrGBjqDg7pBwfrFRURERH/+fn82Nh7e3vtLS3809PwXFztLi7pAADs7e381tb7zs7uMzPqDAz96urvR0f82trtMDD+8/PwUVHwS0v95+f3o6P4qan3oKDyamr/+/v+7u7zbW3xV1fvQ0M5OTnqCgrmAADn5+f7yMj6wcH6vLz2mZn2kZHzdHRhYWFaWlruPj7uOzvuODguLi7+9/f/9fXx8fH95ub95eX84OD7y8vExMT7w8O6urr3nJz0gIDwVFT/NDQJCwv94uL83t7V1dX70NC+vr62trb4rq6ZmZn2lZWKiopqampoaGjyZGTxXFxPT0//QUHuQEDtFhbe3t73trb1s7Nzi4v1iYmIiIj0g4N5eXmjc3PzcnJCQkL/OTkpKSkdHR39///t///u7u7q6urf39/IyMj6vr7NpaWkpKSQkJCBgYHzd3ewcnJubm7xZWWiZGTxYWFXV1cAGRkYGBjd+fn19fXh4eGsrKzQl5fHlpatgoKkfHy0dnaqa2tiYmJdXV3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6gzIo7S+URRgMDW1IRb0+wkj9FjUBp7EXYAi7NlZWB2Qy3YWVmEegNZAWXR9rczztLwwF1WcjGkmUL/OBg6HXIDgK4KdErqNbSUAlkYR5KFGLyIz0ZgIgtqYYwOV/k7AAoRyAmIhQrn5Qo4zuEYJgmyAvwJZYf1bYQNLsgDrKw/DbNhmtMP3dWIZsmr4Soq8AgsSWjNc8XQZjLKUYHN2Of0rILkBaDG/AQANfnsjb3QwQCNdBJaaLQBATMSyA74/A6Vlbav+B7Bzkf4zUMqSWy66gErvwIbG/CDPJ6+zitRM9AxsUzUfD4J7Jh4SPQPNxKhcX7qOnYLeUGoD5RmAihJa5Uwkv9KcmgeVbD5SAI7l2kBdJ0AqgBaEEgU2kJegRQDQCPShkmBAOXXdD9q1TkAe7OwrQzYQPVOL2LVQB9tIfRVsYzLG/g4HqHUDvGY9txzASpXB24/VVRoMRPxZ+l2ZhZYjuPIkiYTCCHJmO2wCEiurQpCOkNhhPVN3KjpJ3ZV7w3NBtAa2uGZfzTk2RuKzlpYnRl2kbR/h97VF6uT2wqpDcUK0+pqWgtYzkpzPngvt1oJjIMwOxceAfIlSKhKCCQmpqohlSjVMNEplicIxgchUlWTqg/qYF+FEByYXXcsNknwSWp/sjpzccx8TrAi8tacdi8KiK7nsWyqFAO1KiEqrYdnnLDxbZQq658C5GG1s4Zla+hY2GJpuv57wfwh7S5EkeFyIBr8HKs1xLb4jhxtK8jEvwPc6e0lgCZkxd6FI11WfBF0QaFxSCzNz9lyrdmr5P3Hy1FFDh/btO3rYmH79ZvSEzOrD0pOlX78xw4aN7tt36KhpUyalLf9/A5nj/LZRV7kLAAAAAElFTkSuQmCC
// @icon64 data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAACNFBMVEUAAAD////////4rKyYmJj////3pqb7zMz4trb////////////////////////819f5wMD////////////83d36xMT5urqOjo7/////////////+Pj+8vL96+v95+f95eX84+O6urr4r6+qqqr3qKj////////////////sKCgAAADs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w3NBtAa2uGZfzTk2RuKzlpYnRl2kbR/h97VF6uT2wqpDcUK0+pqWgtYzkpzPngvt1oJjIMwOxceAfIlSKhKCCQmpqohlSjVMNEplicIxgchUlWTqg/qYF+FEByYXXcsNknwSWp/sjpzccx8TrAi8tacdi8KiK7nsWyqFAO1KiEqrYdnnLDxbZQq658C5GG1s4Zla+hY2GJpuv57wfwh7S5EkeFyIBr8HKs1xLb4jhxtK8jEvwPc6e0lgCZkxd6FI11WfBF0QaFxSCzNz9lyrdmr5P3Hy1FFDh/btO3rYmH79ZvSEzOrD0pOlX78xw4aN7tt36KhpUyalLf9/A5nj/LZRV7kLAAAAAElFTkSuQmCC
// @license GPL-3.0-only
// @license GPL-3.0-only
// @homepageURL https://7kttube.tk/
// @homepageURL https://7kttube.tk/
// @downloadURL https://7kttube.tk/install/7ktTube.user.js
// @downloadURL https://7kttube.tk/install/7ktTube.user.js
// @updateURL https://7kttube.tk/install/7ktTube.user.js
// @updateURL https://7kttube.tk/install/7ktTube.user.js
// @supportURL https://discord.gg/7WRjXHMfXJ
// @supportURL https://discord.gg/7WRjXHMfXJ
// @contributionURL https://www.paypal.com/donate/?hosted_button_id=2EJR4DLTR4Y7Q
// @contributionURL https://www.paypal.com/donate/?hosted_button_id=2EJR4DLTR4Y7Q
// @require https://unpkg.com/vue@2.6.12/dist/vue.js
// @require https://unpkg.com/vue@2.6.12/dist/vue.js
// @require https://unpkg.com/xfetch-js@0.5.0/dist/xfetch.min.js
// @require https://unpkg.com/xfetch-js@0.5.0/dist/xfetch.min.js
// @match *://*.youtube.com/*
// @match *://*.youtube.com/*
// @match *://*.youtu.be/*
// @match *://*.youtu.be/*
// @grant GM_addStyle
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_getValue
// @grant GM.getValue
// @grant GM.getValue
// @grant GM.setValue
// @grant GM.setValue
// @grant GM_setValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @grant GM_registerMenuCommand
// @grant unsafeWindow
// @grant unsafeWindow
// @run-at document-start
// @run-at document-start
// @compatible Chrome >=55 + Tampermonkey + Violentmonkey
// @compatible Chrome >=55 + Tampermonkey + Violentmonkey
// @compatible Firefox >=56 + Tampermonkey + Violentmonkey
// @compatible Firefox >=56 + Tampermonkey + Violentmonkey
// @compatible Opera + Tampermonkey + Violentmonkey
// @compatible Opera + Tampermonkey + Violentmonkey
// @compatible Edge + Tampermonkey + Violentmonkey
// @compatible Edge + Tampermonkey + Violentmonkey
// ==/UserScript==
// ==/UserScript==
/*jshint esversion: 6 */
/*jshint esversion: 6 */
// fix GM_addStyle
// fix GM_addStyle
if (typeof GM_addStyle !== "function") {
if (typeof GM_addStyle !== "function") {
function GM_addStyle(css) {
function GM_addStyle(css) {
let style = document.createElement('style');
let style = document.createElement('style');
style.type = 'text/css';
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
style.appendChild(document.createTextNode(css));
const head = document.getElementsByTagName('head')[0];
const head = document.getElementsByTagName('head')[0];
if (head) head.appendChild(style);
if (head) head.appendChild(style);
else document.documentElement.appendChild(style);
else document.documentElement.appendChild(style);
}
}
}
}
const yt_lib_custom = {
const yt_lib_custom = {
removeEl: selector => {
removeEl: selector => {
let e = document.querySelector(selector);
let e = document.querySelector(selector);
e && e.parentNode.removeChild(e);
e && e.parentNode.removeChild(e);
},
},
getQueryURL: (query, url) => new URLSearchParams((url ? new URL(url) : location).search).get(query),
getQueryURL: (query, url) => new URLSearchParams((url ? new URL(url) : location).search).get(query),
}
}
// remove el
// remove el
window.addEventListener('load', () => {
window.addEventListener('load', () => {
document.querySelectorAll("#masthead-ad,#root").forEach(e => e.remove()); // ad
document.querySelectorAll("#masthead-ad,#root").forEach(e => e.remove()); // ad
document.body.addEventListener("yt-navigate-finish", () => {
document.body.addEventListener("yt-navigate-finish", () => {
yt_lib_custom.removeEl('ytp-miniplayer');
yt_lib_custom.removeEl('ytd-miniplayer');
yt_lib_custom.removeEl('ytp-miniplayer-ui');
yt_lib_custom.removeEl('ytd-miniplayer-ui');
yt_lib_custom.removeEl('.ytp-miniplayer-button');
yt_lib_custom.removeEl('.ytp-miniplayer-button');
if (window.location.pathname != "/watch") yt_lib_custom.removeEl('#movie_player video');
if (window.location.pathname != "/watch") yt_lib_custom.removeEl('#movie_player video');
});
});
});
});
function restoreAppbarLinks() {
function restoreAppbarLinks() {
var trendingData = {
var trendingData = {
"navigationEndpoint": {
"navigationEndpoint": {
"clickTrackingParams": "CBwQtSwYASITCNqYh-qO_fACFcoRrQYdP44D9Q==",
"clickTrackingParams": "CBwQtSwYASITCNqYh-qO_fACFcoRrQYdP44D9Q==",
"commandMetadata": {
"commandMetadata": {
"webCommandMetadata": {
"webCommandMetadata": {
"url": "/feed/trending",
"url": "/feed/trending",
"webPageType": "WEB_PAGE_TYPE_BROWSE",
"webPageType": "WEB_PAGE_TYPE_BROWSE",
"rootVe": 6827,
"rootVe": 6827,
"apiUrl": "/youtubei/v1/browse"
"apiUrl": "/youtubei/v1/browse"
}
}
},
},
"browseEndpoint": {
"browseEndpoint": {
"browseId": "FEtrending"
"browseId": "FEtrending"
}
}
},
},
"icon": {
"icon": {
"iconType": "TRENDING"
"iconType": "TRENDING"
},
},
"trackingParams": "CBwQtSwYASITCNqYh-qO_fACFcoRrQYdP44D9Q==",
"trackingParams": "CBwQtSwYASITCNqYh-qO_fACFcoRrQYdP44D9Q==",
"formattedTitle": {
"formattedTitle": {
"simpleText": "Trending"
"simpleText": "Trending"
},
},
"accessibility": {
"accessibility": {
"accessibilityData": {
"accessibilityData": {
"label": "Trending"
"label": "Trending"
}
}
},
},
"isPrimary": true
"isPrimary": true
};
};
var guidetemplate = `<ytd-guide-entry-renderer class="style-scope ytd-guide-section-renderer" is-primary="" line-end-style="none"><!--css-build:shady--><a id="endpoint" class="yt-simple-endpoint style-scope ytd-guide-entry-renderer" tabindex="-1" role="tablist"><tp-yt-paper-item role="tab" class="style-scope ytd-guide-entry-renderer" tabindex="0" aria-disabled="false"><!--css-build:shady--><yt-icon class="guide-icon style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><yt-img-shadow height="24" width="24" class="style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-img-shadow><yt-formatted-string class="title style-scope ytd-guide-entry-renderer"><!--css-build:shady--></yt-formatted-string><span class="guide-entry-count style-scope ytd-guide-entry-renderer"></span><yt-icon class="guide-entry-badge style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><div id="newness-dot" class="style-scope ytd-guide-entry-renderer"></div></tp-yt-paper-item></a><yt-interaction class="style-scope ytd-guide-entry-renderer"><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction></ytd-guide-entry-renderer>`;
var guidetemplate = `<ytd-guide-entry-renderer class="style-scope ytd-guide-section-renderer" is-primary="" line-end-style="none"><!--css-build:shady--><a id="endpoint" class="yt-simple-endpoint style-scope ytd-guide-entry-renderer" tabindex="-1" role="tablist"><tp-yt-paper-item role="tab" class="style-scope ytd-guide-entry-renderer" tabindex="0" aria-disabled="false"><!--css-build:shady--><yt-icon class="guide-icon style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><yt-img-shadow height="24" width="24" class="style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-img-shadow><yt-formatted-string class="title style-scope ytd-guide-entry-renderer"><!--css-build:shady--></yt-formatted-string><span class="guide-entry-count style-scope ytd-guide-entry-renderer"></span><yt-icon class="guide-entry-badge style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><div id="newness-dot" class="style-scope ytd-guide-entry-renderer"></div></tp-yt-paper-item></a><yt-interaction class="style-scope ytd-guide-entry-renderer"><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction></ytd-guide-entry-renderer>`;
document.querySelector(`#items > ytd-guide-entry-renderer:first-child`).insertAdjacentHTML("afterend", guidetemplate);
document.querySelector(`#items > ytd-guide-entry-renderer:first-child`).insertAdjacentHTML("afterend", guidetemplate);
document.querySelector(`#items > ytd-guide-entry-renderer:nth-child(2)`).data = trendingData;
document.querySelector(`#items > ytd-guide-entry-renderer:nth-child(2)`).data = trendingData;
document.querySelector(`#items > ytd-guide-entry-renderer:nth-child(3)`).remove();
document.querySelector(`#items > ytd-guide-entry-renderer:nth-child(3)`).remove();
document.querySelector("ytd-guide-section-renderer.style-scope:first-child").data.items[1].guideEntryRenderer = trendingData;
document.querySelector("ytd-guide-section-renderer.style-scope:first-child").data.items[1].guideEntryRenderer = trendingData;
}
}
function gen_aspect_fix() {
function gen_aspect_fix() {
"use strict";
"use strict";
var vidfix = {
var vidfix = {
inject: function(is_user_script) {
inject: function(is_user_script) {
var modules;
var modules;
var vidfix_api;
var vidfix_api;
var user_settings;
var user_settings;
var default_language;
var default_language;
var send_settings_to_page;
var send_settings_to_page;
var receive_settings_from_page;
var receive_settings_from_page;
modules = [];
modules = [];
vidfix_api = {
vidfix_api = {
initializeBypasses: function() {
initializeBypasses: function() {
var ytd_watch;
var ytd_watch;
var sizeBypass;
var sizeBypass;
if (ytd_watch = document.querySelector("ytd-watch, ytd-watch-flexy")) {
if (ytd_watch = document.querySelector("ytd-watch, ytd-watch-flexy")) {
sizeBypass = function() {
sizeBypass = function() {
var width;
var width;
var height;
var height;
var movie_player;
var movie_player;
if (!ytd_watch.theater && !document.querySelector(".iri-full-browser") && (movie_player = document.querySelector("#movie_player"))) {
if (!ytd_watch.theater && !document.querySelector(".iri-full-browser") && (movie_player = document.querySelector("#movie_player"))) {
width = movie_player.offsetWidth;
width = movie_player.offsetWidth;
height = Math.round(movie_player.offsetWidth / (16 / 9));
height = Math.round(movie_player.offsetWidth / (16 / 9));
if (ytd_watch.updateStyles) {
if (ytd_watch.updateStyles) {
ytd_watch.updateStyles({
ytd_watch.updateStyles({
"--ytd-watch-flexy-width-ratio": 1,
"--ytd-watch-flexy-width-ratio": 1,
"--ytd-watch-flexy-height-ratio": 0.5625
"--ytd-watch-flexy-height-ratio": 0.5625
});
});
ytd_watch.updateStyles({
ytd_watch.updateStyles({
"--ytd-watch-width-ratio": 1,
"--ytd-watch-width-ratio": 1,
"--ytd-watch-height-ratio": 0.5625
"--ytd-watch-height-ratio": 0.5625
});
});
}
}
}
}
else {
else {
width = window.NaN;
width = window.NaN;
height = window.NaN;
height = window.NaN;
}
}
return {
return {
width: width,
width: width,
height: height
height: height
};
};
};
};
if (ytd_watch.calculateCurrentPlayerSize_) {
if (ytd_watch.calculateCurrentPlayerSize_) {
if (!ytd_watch.calculateCurrentPlayerSize_.bypassed) {
if (!ytd_watch.calculateCurrentPlayerSize_.bypassed) {
ytd_watch.calculateCurrentPlayerSize_ = sizeBypass;
ytd_watch.calculateCurrentPlayerSize_ = sizeBypass;
ytd_watch.calculateCurrentPlayerSize_.bypassed = true;
ytd_watch.calculateCurrentPlayerSize_.bypassed = true;
}
}
if (!ytd_watch.calculateNormalPlayerSize_.bypassed) {
if (!ytd_watch.calculateNormalPlayerSize_.bypassed) {
ytd_watch.calculateNormalPlayerSize_ = sizeBypass;
ytd_watch.calculateNormalPlayerSize_ = sizeBypass;
ytd_watch.calculateNormalPlayerSize_.bypassed = true;
ytd_watch.calculateNormalPlayerSize_.bypassed = true;
}
}
}
}
}
}
},
},
initializeSettings: function(new_settings) {
initializeSettings: function(new_settings) {
var i;
var i;
var j;
var j;
var option;
var option;
var options;
var options;
var loaded_settings;
var loaded_settings;
var vidfix_settings;
var vidfix_settings;
if (vidfix_settings = document.getElementById("vidfix-settings")) {
if (vidfix_settings = document.getElementById("vidfix-settings")) {
loaded_settings = JSON.parse(vidfix_settings.textContent || "null");
loaded_settings = JSON.parse(vidfix_settings.textContent || "null");
receive_settings_from_page = vidfix_settings.getAttribute("settings-beacon-from");
receive_settings_from_page = vidfix_settings.getAttribute("settings-beacon-from");
send_settings_to_page = vidfix_settings.getAttribute("settings-beacon-to");
send_settings_to_page = vidfix_settings.getAttribute("settings-beacon-to");
vidfix_settings.remove();
vidfix_settings.remove();
}
}
user_settings = new_settings || loaded_settings || user_settings || {};
user_settings = new_settings || loaded_settings || user_settings || {};
for (i = 0; i < modules.length; i++) {
for (i = 0; i < modules.length; i++) {
for (options in modules[i].options) {
for (options in modules[i].options) {
if (modules[i].options.hasOwnProperty(options)) {
if (modules[i].options.hasOwnProperty(options)) {
option = modules[i].options[options];
option = modules[i].options[options];
if (!(option.id in user_settings) && "value" in option) {
if (!(option.id in user_settings) && "value" in option) {
user_settings[option.id] = option.value;
user_settings[option.id] = option.value;
}
}
}
}
}
}
}
}
},
},
initializeModulesUpdate: function() {
initializeModulesUpdate: function() {
var i;
var i;
for (i = 0; i < modules.length; i++) {
for (i = 0; i < modules.length; i++) {
if (modules[i].onSettingsUpdated) {
if (modules[i].onSettingsUpdated) {
modules[i].onSettingsUpdated();
modules[i].onSettingsUpdated();
}
}
}
}
},
},
initializeModules: function() {
initializeModules: function() {
var i;
var i;
for (i = 0; i < modules.length; i++) {
for (i = 0; i < modules.length; i++) {
if (modules[i].ini) {
if (modules[i].ini) {
modules[i].ini();
modules[i].ini();
}
}
}
}
},
},
initializeOption: function() {
initializeOption: function() {
var key;
var key;
if (this.started) {
if (this.started) {
return true;
return true;
}
}
this.started = true;
this.started = true;
for (key in this.options) {
for (key in this.options) {
if (this.options.hasOwnProperty(key)) {
if (this.options.hasOwnProperty(key)) {
if (!(key in user_settings) && this.options[key].value) {
if (!(key in user_settings) && this.options[key].value) {
user_settings[key] = this.options[key].value;
user_settings[key] = this.options[key].value;
}
}
}
}
}
}
return false;
return false;
},
},
initializeBroadcast: function(event) {
initializeBroadcast: function(event) {
if (event.data) {
if (event.data) {
if (event.data.type === "settings") {
if (event.data.type === "settings") {
if (event.data.payload) {
if (event.data.payload) {
if (event.data.payload.broadcast_id === this.broadcast_channel.name) {
if (event.data.payload.broadcast_id === this.broadcast_channel.name) {
this.initializeSettings(event.data.payload);
this.initializeSettings(event.data.payload);
this.initializeModulesUpdate();
this.initializeModulesUpdate();
}
}
}
}
}
}
}
}
},
},
ini: function() {
ini: function() {
this.initializeSettings();
this.initializeSettings();
this.broadcast_channel = new BroadcastChannel(user_settings.broadcast_id);
this.broadcast_channel = new BroadcastChannel(user_settings.broadcast_id);
this.broadcast_channel.addEventListener("message", this.initializeBroadcast.bind(this));
this.broadcast_channel.addEventListener("message", this.initializeBroadcast.bind(this));
document.documentElement.addEventListener("load", this.initializeSettingsButton, true);
document.documentElement.addEventListener("load", this.initializeSettingsButton, true);
document.documentElement.addEventListener("load", this.initializeBypasses, true);
document.documentElement.addEventListener("load", this.initializeBypasses, true);
if (this.isSettingsPage) {
if (this.isSettingsPage) {
this.initializeModules();
this.initializeModules();
}
}
}
}
};
};
vidfix_api.ini();
vidfix_api.ini();
},
},
isAllowedPage: function() {
isAllowedPage: function() {
var current_page;
var current_page;
if (current_page = window.location.pathname.match(/\/[a-z-]+/)) {
if (current_page = window.location.pathname.match(/\/[a-z-]+/)) {
current_page = current_page[0];
current_page = current_page[0];
}
}
else {
else {
current_page = window.location.pathname;
current_page = window.location.pathname;
}
}
return ["/tv", "/embed", "/live_chat", "/account", "/account_notifications", "/create_channel", "/dashboard", "/upload", "/webcam"].indexOf(current_page) < 0;
return ["/tv", "/embed", "/live_chat", "/account", "/account_notifications", "/create_channel", "/dashboard", "/upload", "/webcam"].indexOf(current_page) < 0;
},
},
generateUUID: function() {
generateUUID: function() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11)
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11)
.replace(/[018]/g, function(point) {
.replace(/[018]/g, function(point) {
return (point ^ window.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> point / 4)
return (point ^ window.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> point / 4)
.toString(16);
.toString(16);
});
});
},
},
saveSettings: function() {
saveSettings: function() {
if (this.is_user_script) {
if (this.is_user_script) {
this.GM.setValue(this.id, JSON.stringify(this.user_settings));
this.GM.setValue(this.id, JSON.stringify(this.user_settings));
}
}
else {
else {
chrome.storage.local.set({
chrome.storage.local.set({
vidfixSettings: this.user_settings
vidfixSettings: this.user_settings
});
});
}
}
},
},
updateSettingsOnOpenWindows: function() {
updateSettingsOnOpenWindows: function() {
this.broadcast_channel.postMessage({
this.broadcast_channel.postMessage({
type: "settings",
type: "settings",
payload: this.user_settings
payload: this.user_settings
});
});
},
},
settingsUpdatedFromOtherWindow: function(event) {
settingsUpdatedFromOtherWindow: function(event) {
if (event.data && event.data.broadcast_id === this.broadcast_channel.name) {
if (event.data && event.data.broadcast_id === this.broadcast_channel.name) {
this.user_settings = event.data;
this.user_settings = event.data;
this.saveSettings();
this.saveSettings();
}
}
},
},
contentScriptMessages: function(custom_event) {
contentScriptMessages: function(custom_event) {
var updated_settings;
var updated_settings;
if ((updated_settings = custom_event.detail.settings) !== undefined) {
if ((updated_settings = custom_event.detail.settings) !== undefined) {
this.saveSettings();
this.saveSettings();
}
}
},
},
initializeScript: function(event) {
initializeScript: function(event) {
var holder;
var holder;
this.user_settings = event[this.id] || event;
this.user_settings = event[this.id] || event;
if (!this.user_settings.broadcast_id) {
if (!this.user_settings.broadcast_id) {
this.user_settings.broadcast_id = this.generateUUID();
this.user_settings.broadcast_id = this.generateUUID();
this.saveSettings();
this.saveSettings();
}
}
this.broadcast_channel = new BroadcastChannel(this.user_settings.broadcast_id);
this.broadcast_channel = new BroadcastChannel(this.user_settings.broadcast_id);
this.broadcast_channel.addEventListener("message", this.settingsUpdatedFromOtherWindow.bind(this));
this.broadcast_channel.addEventListener("message", this.settingsUpdatedFromOtherWindow.bind(this));
event = JSON.stringify(this.user_settings);
event = JSON.stringify(this.user_settings);
holder = document.createElement("vidfix-settings");
holder = document.createElement("vidfix-settings");
holder.id = "vidfix-settings";
holder.id = "vidfix-settings";
holder.textContent = event;
holder.textContent = event;
holder.setAttribute("style", "display: none");
holder.setAttribute("style", "display: none");
holder.setAttribute("settings-beacon-from", this.receive_settings_from_page);
holder.setAttribute("settings-beacon-from", this.receive_settings_from_page);
holder.setAttribute("settings-beacon-to", this.send_settings_to_page);
holder.setAttribute("settings-beacon-to", this.send_settings_to_page);
document.documentElement.appendChild(holder);
document.documentElement.appendChild(holder);
holder = document.createElement("script");
holder = document.createElement("script");
holder.textContent = "(" + this.inject + "(" + this.is_user_script.toString() + "))";
holder.textContent = "(" + this.inject + "(" + this.is_user_script.toString() + "))";
document.documentElement.appendChild(holder);
document.documentElement.appendChild(holder);
holder.remove();
holder.remove();
this.inject = null;
this.inject = null;
delete this.inject;
delete this.inject;
},
},
main: function(event) {
main: function(event) {
var now;
var now;
var context;
var context;
now = Date.now();
now = Date.now();
this.receive_settings_from_page = now + "-" + this.generateUUID();
this.receive_settings_from_page = now + "-" + this.generateUUID();
this.send_settings_to_page = now + 1 + "-" + this.generateUUID();
this.send_settings_to_page = now + 1 + "-" + this.generateUUID();
window.addEventListener(this.receive_settings_from_page, this.contentScriptMessages.bind(this), false);
window.addEventListener(this.receive_settings_from_page, this.contentScriptMessages.bind(this), false);
if (!event) {
if (!event) {
if (this.is_user_script) {
if (this.is_user_script) {
context = this;
context = this;
// javascript promises are horrible
// javascript promises are horrible
this.GM.getValue(this.id, "{}")
this.GM.getValue(this.id, "{}")
.then(function(value) {
.then(function(value) {
event = JSON.parse(value);
event = JSON.parse(value);
context.initializeScript(event);
context.initializeScript(event);
});
});
}
}
}
}
else {
else {
this.initializeScript(event);
this.initializeScript(event);
}
}
},
},
ini: function() {
ini: function() {
if (this.isAllowedPage()) {
if (this.isAllowedPage()) {
this.is_settings_page = window.location.pathname === "/vidfix-settings";
this.is_settings_page = window.location.pathname === "/vidfix-settings";
this.id = "vidfixSettings";
this.id = "vidfixSettings";
if (typeof GM === "object" || typeof GM_info === "object") {
if (typeof GM === "object" || typeof GM_info === "object") {
this.is_user_script = true;
this.is_user_script = true;
// GreaseMonkey 4 polly fill
// GreaseMonkey 4 polly fill
// https://arantius.com/misc/greasemonkey/imports/greasemonkey4-polyfill.js
// https://arantius.com/misc/greasemonkey/imports/greasemonkey4-polyfill.js
if (typeof GM === "undefined") {
if (typeof GM === "undefined") {
this.GM = {
this.GM = {
setValue: GM_setValue,
setValue: GM_setValue,
info: GM_info,
info: GM_info,
getValue: function() {
getValue: function() {
return new Promise((resolve, reject) => {
return new Promise((resolve, reject) => {
try {
try {
resolve(GM_getValue.apply(this, arguments));
resolve(GM_getValue.apply(this, arguments));
}
}
catch (e) {
catch (e) {
reject(e);
reject(e);
}
}
});
});
}
}
};
};
}
}
else {
else {
this.GM = GM;
this.GM = GM;
}
}
this.main();
this.main();
}
}
else {
else {
this.is_user_script = false;
this.is_user_script = false;
chrome.storage.local.get(this.id, this.main.bind(this));
chrome.storage.local.get(this.id, this.main.bind(this));
}
}
}
}
}
}
};
};
vidfix.ini();
vidfix.ini();
function addGlobalStyle(css) {
function addGlobalStyle(css) {
var head, style;
var head, style;
head = document.getElementsByTagName('head')[0];
head = document.getElementsByTagName('head')[0];
if (!head) {
if (!head) {
return;
return;
}
}
style = document.createElement('style');
style = document.createElement('style');
style.type = 'text/css';
style.type = 'text/css';
style.innerHTML = css;
style.innerHTML = css;
head.appendChild(style);
head.appendChild(style);
}
}
addGlobalStyle('.html5-video-player { background-color: #000!important; }');
addGlobalStyle('.html5-video-player { background-color: #000!important; }');
}
}
function waitForElement(selector) {
function waitForElement(selector) {
return new Promise(resolve => {
return new Promise(resolve => {
if (document.querySelector(selector)) {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
return resolve(document.querySelector(selector));
}
}
const observer = new MutationObserver(mutations => {
const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
if (document.querySelector(selector)) {
resolve(document.querySelector(selector));
resolve(document.querySelector(selector));
observer.disconnect();
observer.disconnect();
}
}
});
});
observer.observe(document, {
observer.observe(document, {
childList: true,
childList: true,
subtree: true
subtree: true
});
});
});
});
}
}
function doMastheadFix()
function doMastheadFix()