diff --git a/assets/icons/language.svg b/assets/icons/language.svg new file mode 100644 index 0000000..5350475 --- /dev/null +++ b/assets/icons/language.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/index.html b/index.html index 3626a05..96aa74e 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - Does uBlock Origin (uBO) currently bypass YouTube's adblock detection? + Does uBlock Origin (uBO) currently bypass YouTube's adblock detection? @@ -15,10 +15,14 @@ +
-

What does it mean?

-

We are currently evaluating if uBlock Origin's filters have been updated to deal with the latest Anti-Adblocker script. This website doesn't check your device. It simply compares text files provided by the uBO team to let you know the current status of uBO's solutions for YouTube.

- - - - - -

What should I do now?

-

Please come back later.

- +

What does it mean?

+

We are currently evaluating if uBlock Origin's filters have been updated to deal with the latest Anti-Adblocker script. This website doesn't check your device. It simply compares text files provided by the uBO team to let you know the current status of uBO's solutions for YouTube.

+ + + + + +

What should I do now?

+

Please come back later.

+ - + -

What does this website do?

-

It simply gets the info of the latest YT script ID solved by uBlock Origin and compares it against the latest YouTube Anti-Adblocker script ID. +

What does this website do?

+

It simply gets the info of the latest YT script ID solved by uBlock Origin and compares it against the latest YouTube Anti-Adblocker script ID. If it's the same, then the uBlock Origin team has finally updated their filters. If it's not, a fix is on the way. This website does not check if your own uBlock Origin version is up-to-date.

-

How can I contribute to this website?

-

You can make changes and pull request to the dev branch.

-

Please keep in mind we are all volunteers. We don't get any revenue from this and we cannot be online 24/7. Thanks for understanding!

+

How can I contribute to this website?

+

You can make changes and pull request to the dev branch.

+

Please keep in mind we are all volunteers. We don't get any revenue from this and we cannot be online 24/7. Thanks for understanding!

diff --git a/lang/en-EN.json b/lang/en-EN.json new file mode 100644 index 0000000..c02995a --- /dev/null +++ b/lang/en-EN.json @@ -0,0 +1,35 @@ +{ + "html-title":"Does uBlock Origin (uBO) currently bypass YouTube's adblock detection?", + "main-question": "Does uBlock Origin (uBO) bypass the latest YouTube anti-adblock script?", + "answer-default": "No idea", + "answer-yes": "YES", + "answer-no": "NO", + + "troubleshoot-footer": "Still having the annoying popup? See r/uBlockOrigin", + "update-since-yes": "Latest solution: ", + "update-since-no": "YT script changed: ", + + "h2-1": "What does it mean?", + "h2-1-default": "We are currently evaluating if uBlock Origin's filters have been updated to deal with the latest Anti-Adblocker script. This website doesn't check your device. It simply compares text files provided by the uBO team to let you know the current status of uBO's solutions for YouTube.", + "h2-1-yes": "It means that uBO's filters can bypass the Anti-Adblocker script, and you can safely watch YouTube without ads.", + "h2-1-no": "It means that uBO's filters have not yet been updated to bypass the latest YouTube Anti-Adblocker script, so you might be getting detected again.", + + "h3-1": "Does this mean that uBlock Origin is not working on YouTube at all?", + "h3-1-1": "A different ID doesn't always mean the detection will occur.", + "h3-1-2": "uBlock Origin could still work on YouTube. Not all YT updates are targeted against uBO's solutions.", + + "h2-2": "What should I do now?", + "h2-2-default": "Please come back later.", + "h2-2-yes": "You might need to force an update of the 'uBlock filters - Quick fixes' list in uBlock Origin and remove potential conflicts caused by other extensions or different external causes to the detection. Logging out and clearing YouTube and Google cookies, closing YT tabs and restarting your browser is helpful too.

There is a good guide made by the uBO team themselves on
Reddit. Make sure to read and follow it.", + "h2-2-recommends": "If the update itself didn't fix the problem on your side, it means something else causes it - likely another extension or your custom config.
Trying to update it endlessly won't change a thing. Thus, really make sure you've read and followed the reddit mega thread.

", + "h2-2-donotspam": "Please DO NOT spam click the link updater.", + "update-button": "Update uBO Quick Fixes", + "h2-2-no": "It is recommended to wait for uBlock Origin to update their filters and come back later.", + + "h2-3": "What does this website do?", + "h2-3-1": "It simply gets the info of the latest YT script ID solved by uBlock Origin and compares it against the latest YouTube Anti-Adblocker script ID. If it's the same, then the uBlock Origin team has finally updated their filters. If it's not, a fix is on the way. This website does not check if your own uBlock Origin version is up-to-date.", + + "h2-4": "How can I contribute to this website?", + "h2-4-1": "You can make changes and pull request to the dev branch.", + "h2-4-2": "Please keep in mind we are all volunteers. We don't get any revenue from this and we cannot be online 24/7. Thanks for understanding!" +} \ No newline at end of file diff --git a/lang/es-ES.json b/lang/es-ES.json new file mode 100644 index 0000000..017a0bb --- /dev/null +++ b/lang/es-ES.json @@ -0,0 +1,34 @@ +{ + "html-title":"¿uBlock Origin (uBO) es capaz de bloquear anuncios en YouTube?", + "main-question": "Puede uBlock Origin (uBO) saltarse el último script anti-adblock de YouTube?", + "answer-default": "Ni idea", + "answer-yes": "SÍ", + "answer-no": "NO", + + "troubleshoot-footer": "¿Sigues teniendo la molesta ventana emergente? Consulte r/uBlockOrigin", + "update-since-yes": "Última actualización del parche: ", + "update-since-no": "Última actualización de YT: ", + + "h2-1": "Qué es esto?", + "h2-1-default": "Ahora mismo estamos evaluando si los filtros de uBlock Origin se han actualizado para hacer frente al último script Anti-Adblocker. Este sitio web no analiza tu dispositivo. Simplemente compara bases de datos proporcionados por el equipo de uBO para informarte del estado actual de los filtros de uBO para YouTube.", + "h2-1-yes": "Los filtros de uBO pueden saltarse el script Anti-Adblocker de YouTube, y puedes ver YouTube sin anuncios de forma segura", + "h2-1-no": "Significa que los filtros de uBO aún no se han actualizado para evitar el último script de YouTube, por lo que es posible que detecten uBO", + + "h3-1": "¿Significa esto que uBlock Origin no funciona en YouTube?", + "h3-1-1": "Un ID distinto no siempre significa que detectarán uBO.", + "h3-1-2": "uBlock Origin podría seguir funcionando en YouTube. No todas las actualizaciones de YT están dirigidas contra las soluciones de uBO.", + + "h2-2": "¿Qué debería hacer ahora?", + "h2-2-default": "Por favor, inténtelo de nuevo más tarde", + "h2-2-yes": "A lo mejor necesitas forzar una actualización de los filtros 'Quick fixes' de uBlock Origin y eliminar cualquier conflicto provocado por otra extensión o ver qué está causando la detección. Cerrar sesión, limpiar las cookies de YouTube y Google, cerrando las pestañas de YT y reiniciando tu navegador podría ayudarte.

Existe una guía hecha por el propio equipo de uBO en
Reddit. No olvide echar un vistazo. ", + "h2-2-recommends": "Si la actualización no ha sido útil, significa que algo ajeno a uBO es causa del problema - por lo general otra extensión o alguna configuración personal.
Actualizar de manera insistente no hará nada, por lo que asegúrate que has entendido la publicación ", + "h2-2-donotspam": "Por favor, no satures el link", + "update-button": "Actualizar uBO 'Quick Fixes'", + "h2-2-no": "Es mejor esperar a que el equipo de uBlock Origin actualice sus filtros, así que vuelve más tarde", + "h2-3": "¿Cómo funciona esta página?", + "h2-3-1": "Simplemente descarga la información del último ID del último script resuelto de YouTube y lo compara con el último ID del script anti-adblock de YouTube. Si es el mismo, entonces el equipo de uBlock Origin ha actualizado sus filtros. Si no lo es, el equipo de uBO está trabajando en ello. Esta página NO detecta si tienes actualizado uBO.", + + "h2-4": "¿Cómo puedo ayudar a crear esta página?", + "h2-4-1": "Puedes hacer una solicitud de cambios a la rama dev. Es recmendable que uses inglés para comunicarte con los que mantienen el proyecto", + "h2-4-2": "Por favor, piensa que todos somos voluntarios. No obtenemos ningún beneficio económico de esto y no podemos estar pendientes 24/7. Gracias por entenderlo." +} \ No newline at end of file diff --git a/main.js b/main.js index 044ebea..3520efb 100644 --- a/main.js +++ b/main.js @@ -5,6 +5,7 @@ Main javascript function. import { areCodesEqual } from "./modules/are_codes_equal.mjs" import { changeUpdatedDateHTML } from "./modules/change_updated_date_html.mjs" import { quickFilterButtonChange } from "./modules/quick_filter_button_change.mjs" +import { getLanguage } from "./modules/languaje.mjs" const UBLOCK_LIST = "https://raw.githubusercontent.com/stephenhawk8054/misc/main/yt-fix.txt" const UBLOCK_API_URL = "https://api.github.com/repos/stephenhawk8054/misc/commits?path=yt-fix.txt&page=1&per_page=1"; @@ -116,6 +117,7 @@ async function main(){ } window.addEventListener("load", (event) => { + getLanguage(); main(); }); diff --git a/modules/are_codes_equal.mjs b/modules/are_codes_equal.mjs index 9dcf495..76188a9 100644 --- a/modules/are_codes_equal.mjs +++ b/modules/are_codes_equal.mjs @@ -112,22 +112,18 @@ async function areCodesEqual({id_ublock, id_yt, force_deploy_url, forceEquality // All the changes listed below. if (codes.id_ublock == codes.id_yt) { // It means uBlock is updated to the latest YouTube script. - document.getElementById('main-answer').innerHTML = "YES"; changeBgColor('yes'); changeShortcutIconColor('yes'); displayClassname('default', 'none'); displayClassname('aa-blocked', 'block'); displayTroubleshootLink(true); - document.getElementById('update-since-footer-p').innerHTML = 'Latest Solution: ' } else { // It means YouTube has a new update not registered by uBlock. - document.getElementById('main-answer').innerHTML = "NO"; changeBgColor('no'); changeShortcutIconColor('no'); displayClassname('default', 'none'); displayClassname('not-aa-blocked', 'block'); displayTroubleshootLink(false); - document.getElementById('update-since-footer-p').innerHTML = 'YT script changed: ' } }) } diff --git a/modules/languaje.mjs b/modules/languaje.mjs new file mode 100644 index 0000000..e1e5846 --- /dev/null +++ b/modules/languaje.mjs @@ -0,0 +1,76 @@ +/* languaje.mjs +Controls which language is being displayed in use. It will use a "php-esque" query varibale in the url: +www.example.com/?lang=en + +The main language is gonna be english, so if no variable is provided it should display english (And maybe + change the URL?) + +Language codes are going to be using the IANA code (es, en, ja...) +https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry +It will detect the language and the region. If the region is not avaliable/not in the list it will pick another +*/ +// Avaliable languages. Manual change (so outdated languages can be removed) +const avaliable_lang_reg = ['en-EN']; + +function getLanguage(){ + // Get the language parameter from the URL + const url_params = new URLSearchParams(window.location.search); + const lang_param = url_params.get('lang') ?? 'en-EN'; // Default is English. + + console.log("Querried language is: ", lang_param); + console.log("AVALIABLE: ", avaliable_lang_reg); + + if (lang_param != 'en_EN'){ + setLanguage(lang_param) + } +} + +function setLanguage(lang) { + // Implement logic to set the language as needed + console.log('Language:', lang); + let language_file = './lang/' + lang + '.json' + loadJsonFile(language_file) + .then(trans_data => { + // Thinking about what the fuck I'm gonna write here. + console.log(trans_data); + + const translatable_elements = document.querySelectorAll('.translatable') + translatable_elements.forEach(element => { + let translation_key = element.dataset.translate; + if (trans_data[translation_key] != undefined){ + // If the key does not exist ignore it. + element.innerHTML = trans_data[translation_key]; + }; + + }) + }) + .catch(error => { + console.error('Error loading JSON: ', error) + }) +} + +async function loadJsonFile(filePath){ + // Basically gets a public json file in the server. + try { + const response = await fetch(filePath); + + if (!response.ok) { + throw new Error(`Failed to load JSON file: ${response.statusText}`); + } + + const jsonData = await response.json(); + return jsonData; + } catch (error) { + console.error(error.message); + } +} + +// [Not Used] Function that would be run manually before deploying the website, +// just in case the list of languages is huge. + +function avaliableLanguages(avaliable_lang_reg) { + // This will take avaliableLangReg and generate a list of avaliableLangs + return avaliable_lang_reg.map(tag => tag.split('-')[0]); +} + +export { getLanguage } \ No newline at end of file