From 818a70e106ab57f86722ce7b4c573d761cf3c768 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 13:22:13 -0500 Subject: [PATCH 01/19] ES linted // start on documentation --- Website/pages/documentation.vue | 6 ++++++ Website/pages/documentation/index.vue | 5 +++++ Website/pages/faq.vue | 3 +-- Website/pages/index.vue | 10 ++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 Website/pages/documentation.vue create mode 100644 Website/pages/documentation/index.vue diff --git a/Website/pages/documentation.vue b/Website/pages/documentation.vue new file mode 100644 index 0000000..219a9ee --- /dev/null +++ b/Website/pages/documentation.vue @@ -0,0 +1,6 @@ + diff --git a/Website/pages/documentation/index.vue b/Website/pages/documentation/index.vue new file mode 100644 index 0000000..31fbbae --- /dev/null +++ b/Website/pages/documentation/index.vue @@ -0,0 +1,5 @@ + diff --git a/Website/pages/faq.vue b/Website/pages/faq.vue index 9ce4693..9a75b79 100644 --- a/Website/pages/faq.vue +++ b/Website/pages/faq.vue @@ -49,8 +49,7 @@ export default { "The extension collects the video ID of the video you are watching, fetches the dislike (and other fields like views, likes etc) using our API. The extension then displays the dislike count and ratio on the page. If you dislike or like a video, that is recorded and sent to the database so an accurate dislike count can be extrapolated.", }, { - question: - "Can I share my dislke count with you?", + question: "Can I share my dislke count with you?", answer: "Coming soon. We are looking into using Oauth or a different read only API with a limited scope so creators can share their dislike counts verifiability. ", }, diff --git a/Website/pages/index.vue b/Website/pages/index.vue index b6aa094..03c9a0d 100644 --- a/Website/pages/index.vue +++ b/Website/pages/index.vue @@ -97,8 +97,14 @@ export default { { name: "Piepacker", link: "https://piepacker.com/" }, { name: "nodetube", link: "https://github.com/mayeaux/nodetube" }, { name: "trig404" }, - { name: "Peter33", link: "https://www.youtube.com/watch?v=G5kzUpWAusI" }, - { name: "Seed4.Me VPN", link: "https://www.seed4.me/users/register?gift=ReturnYoutubeDislike" }, + { + name: "Peter33", + link: "https://www.youtube.com/watch?v=G5kzUpWAusI", + }, + { + name: "Seed4.Me VPN", + link: "https://www.seed4.me/users/register?gift=ReturnYoutubeDislike", + }, ], }; }, From 7c3f24dcb24e43a377bc56c4597f7366d1fa5918 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 13:49:09 -0500 Subject: [PATCH 02/19] basic docs & lint --- Website/layouts/default.vue | 26 ++++------------ Website/nuxt.config.js | 9 ++++-- Website/pages/documentation.vue | 32 ++++++++++++++++++-- Website/pages/documentation/endpoints.vue | 6 ++++ Website/pages/documentation/fetching.vue | 6 ++++ Website/pages/documentation/index.vue | 3 +- Website/pages/documentation/url.vue | 6 ++++ Website/pages/documentation/usage-rights.vue | 6 ++++ 8 files changed, 69 insertions(+), 25 deletions(-) create mode 100644 Website/pages/documentation/endpoints.vue create mode 100644 Website/pages/documentation/fetching.vue create mode 100644 Website/pages/documentation/url.vue create mode 100644 Website/pages/documentation/usage-rights.vue diff --git a/Website/layouts/default.vue b/Website/layouts/default.vue index 828216f..a760691 100644 --- a/Website/layouts/default.vue +++ b/Website/layouts/default.vue @@ -31,26 +31,12 @@ export default { data: () => ({ links: [ - { - name: "Home", - path: "/", - }, - { - name: "Install", - path: "/install", - }, - { - name: "FAQ", - path: "/faq", - }, - { - name: "Donate", - path: "/donate", - }, - { - name: "Links", - path: "/links", - }, + { name: "Home", path: "/"}, + { name: "Install", path: "/install"}, + { name: "FAQ", path: "/faq"}, + { name: "Donate", path: "/donate"}, + { name: "Links", path: "/links"}, + { name: "API", path: "/documentation"}, ], }), }; diff --git a/Website/nuxt.config.js b/Website/nuxt.config.js index 9860f32..ab52a12 100644 --- a/Website/nuxt.config.js +++ b/Website/nuxt.config.js @@ -27,6 +27,10 @@ export default { ], }, + env: { + apiUrl: "https://returnyoutubedislikeapi.com" + }, + target: "static", css: [], plugins: [], @@ -52,7 +56,7 @@ export default { }, }, }, - +/* build: { extend(config, ctx) { // Run ESLint on save (dev-only) @@ -65,5 +69,6 @@ export default { }); } }, - }, + } +*/ }; diff --git a/Website/pages/documentation.vue b/Website/pages/documentation.vue index 219a9ee..e6d6b04 100644 --- a/Website/pages/documentation.vue +++ b/Website/pages/documentation.vue @@ -1,6 +1,34 @@ + + diff --git a/Website/pages/documentation/endpoints.vue b/Website/pages/documentation/endpoints.vue new file mode 100644 index 0000000..432fc8f --- /dev/null +++ b/Website/pages/documentation/endpoints.vue @@ -0,0 +1,6 @@ + diff --git a/Website/pages/documentation/fetching.vue b/Website/pages/documentation/fetching.vue new file mode 100644 index 0000000..432fc8f --- /dev/null +++ b/Website/pages/documentation/fetching.vue @@ -0,0 +1,6 @@ + diff --git a/Website/pages/documentation/index.vue b/Website/pages/documentation/index.vue index 31fbbae..432fc8f 100644 --- a/Website/pages/documentation/index.vue +++ b/Website/pages/documentation/index.vue @@ -1,5 +1,6 @@ diff --git a/Website/pages/documentation/url.vue b/Website/pages/documentation/url.vue new file mode 100644 index 0000000..432fc8f --- /dev/null +++ b/Website/pages/documentation/url.vue @@ -0,0 +1,6 @@ + diff --git a/Website/pages/documentation/usage-rights.vue b/Website/pages/documentation/usage-rights.vue new file mode 100644 index 0000000..432fc8f --- /dev/null +++ b/Website/pages/documentation/usage-rights.vue @@ -0,0 +1,6 @@ + From a57cf4eb6de0300ab896e675ceb73620a8be0fde Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 13:50:31 -0500 Subject: [PATCH 03/19] clean up code --- Website/pages/documentation.vue | 46 +++++++++++++------ .../{fetching.vue => index copy 3.vue} | 0 2 files changed, 33 insertions(+), 13 deletions(-) rename Website/pages/documentation/{fetching.vue => index copy 3.vue} (100%) diff --git a/Website/pages/documentation.vue b/Website/pages/documentation.vue index e6d6b04..89c9e4d 100644 --- a/Website/pages/documentation.vue +++ b/Website/pages/documentation.vue @@ -4,14 +4,18 @@ Sections - - + + + + + + - + @@ -19,16 +23,32 @@ diff --git a/Website/pages/documentation/fetching.vue b/Website/pages/documentation/index copy 3.vue similarity index 100% rename from Website/pages/documentation/fetching.vue rename to Website/pages/documentation/index copy 3.vue From 9d8a13b2a4823f1567ab8c6ecd060415ba466fa6 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 13:53:23 -0500 Subject: [PATCH 04/19] comment doc page --- Website/pages/documentation.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Website/pages/documentation.vue b/Website/pages/documentation.vue index 89c9e4d..2168887 100644 --- a/Website/pages/documentation.vue +++ b/Website/pages/documentation.vue @@ -1,8 +1,11 @@ + + \ No newline at end of file From 3c69d1f08f6704aeb9ec67c93a96293f3280c431 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 14:35:25 -0500 Subject: [PATCH 08/19] finish all --- Website/pages/documentation/endpoints.vue | 18 ++++++- Website/pages/documentation/fetching.vue | 58 ++++++++++++++++++++++- Website/pages/documentation/url.vue | 4 +- 3 files changed, 74 insertions(+), 6 deletions(-) diff --git a/Website/pages/documentation/endpoints.vue b/Website/pages/documentation/endpoints.vue index 432fc8f..6fa2bb4 100644 --- a/Website/pages/documentation/endpoints.vue +++ b/Website/pages/documentation/endpoints.vue @@ -1,6 +1,20 @@ + + \ No newline at end of file diff --git a/Website/pages/documentation/fetching.vue b/Website/pages/documentation/fetching.vue index 432fc8f..9badebb 100644 --- a/Website/pages/documentation/fetching.vue +++ b/Website/pages/documentation/fetching.vue @@ -1,6 +1,60 @@ + + + + \ No newline at end of file diff --git a/Website/pages/documentation/url.vue b/Website/pages/documentation/url.vue index 076b8b0..c5b5389 100644 --- a/Website/pages/documentation/url.vue +++ b/Website/pages/documentation/url.vue @@ -1,8 +1,8 @@ From 9b8e85742a9416e32015821ce4b95e1cd21caf47 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 14:36:38 -0500 Subject: [PATCH 09/19] Update README.md --- README.md | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index ed35ee6..32fb2af 100644 --- a/README.md +++ b/README.md @@ -36,35 +36,8 @@ You can learn more at our website at: [returnyoutubedislike.com](https://www.ret ## API documentation -Third party use of this open API is allowed with the following restrictions: - -- **Attribution**: This project should be clearly attributed with either a link to this repo or a link to [returnyoutubedislike.com](https://returnyoutubedislike.com/). -- **Rate Limiting**: There are per client rate limits in place of 100 per minute and 10'000 per day. This will return a *429* status code indicating that your application should back off. - -The API is accessible over the following base URL: -https://returnyoutubedislikeapi.com - -List of available endpoints is available here: -https://returnyoutubedislikeapi.com/swagger/index.html - -### Get votes -Example to get votes of a given YouTube video ID: -`/votes?videoId=kxOuG8jMIgI` - -```json -{ - "id": "kxOuG8jMIgI", - "dateCreated": "2021-12-20T12:25:54.418014Z", - "likes": 27326, - "dislikes": 498153, - "rating": 1.212014408444885, - "viewCount": 3149885, - "deleted": false -} -``` - -None existing YouTube ID will return status code *404* "Not Found". -Wrong formed YouTube ID will return *400* "Bad Request". +You can view all documentation on our website. +[https://returnyoutubedislike.com/documentation/](https://returnyoutubedislike.com/documentation/) ## HELP WANTED From ffa4173e707fedb619a64d2e2eae149722ab7c5a Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 14:39:54 -0500 Subject: [PATCH 10/19] linted --- Website/layouts/default.vue | 12 +-- Website/nuxt.config.js | 4 +- Website/pages/documentation.vue | 73 ++++++++--------- Website/pages/documentation/endpoints.vue | 15 ++-- Website/pages/documentation/fetching.vue | 84 ++++++++++++-------- Website/pages/documentation/index.vue | 4 +- Website/pages/documentation/url.vue | 15 ++-- Website/pages/documentation/usage-rights.vue | 19 +++-- 8 files changed, 127 insertions(+), 99 deletions(-) diff --git a/Website/layouts/default.vue b/Website/layouts/default.vue index a760691..f986e48 100644 --- a/Website/layouts/default.vue +++ b/Website/layouts/default.vue @@ -31,12 +31,12 @@ export default { data: () => ({ links: [ - { name: "Home", path: "/"}, - { name: "Install", path: "/install"}, - { name: "FAQ", path: "/faq"}, - { name: "Donate", path: "/donate"}, - { name: "Links", path: "/links"}, - { name: "API", path: "/documentation"}, + { name: "Home", path: "/" }, + { name: "Install", path: "/install" }, + { name: "FAQ", path: "/faq" }, + { name: "Donate", path: "/donate" }, + { name: "Links", path: "/links" }, + { name: "API", path: "/documentation" }, ], }), }; diff --git a/Website/nuxt.config.js b/Website/nuxt.config.js index ab52a12..20a53b3 100644 --- a/Website/nuxt.config.js +++ b/Website/nuxt.config.js @@ -28,7 +28,7 @@ export default { }, env: { - apiUrl: "https://returnyoutubedislikeapi.com" + apiUrl: "https://returnyoutubedislikeapi.com", }, target: "static", @@ -56,7 +56,7 @@ export default { }, }, }, -/* + /* build: { extend(config, ctx) { // Run ESLint on save (dev-only) diff --git a/Website/pages/documentation.vue b/Website/pages/documentation.vue index 545b156..ff21a68 100644 --- a/Website/pages/documentation.vue +++ b/Website/pages/documentation.vue @@ -1,16 +1,15 @@ diff --git a/Website/pages/documentation/endpoints.vue b/Website/pages/documentation/endpoints.vue index 6fa2bb4..ef94c10 100644 --- a/Website/pages/documentation/endpoints.vue +++ b/Website/pages/documentation/endpoints.vue @@ -1,9 +1,8 @@ @@ -13,8 +12,8 @@ export default { data() { return { apiUrl: apiUrl, - endpointUrl: apiUrl+'/swagger/index.html' - } - } -} - \ No newline at end of file + endpointUrl: apiUrl + "/swagger/index.html", + }; + }, +}; + diff --git a/Website/pages/documentation/fetching.vue b/Website/pages/documentation/fetching.vue index 9badebb..651f2b8 100644 --- a/Website/pages/documentation/fetching.vue +++ b/Website/pages/documentation/fetching.vue @@ -1,43 +1,61 @@ @@ -54,7 +72,7 @@ export default { data() { return { apiUrl: process.env.apiUrl, - } - } -} - \ No newline at end of file + }; + }, +}; + diff --git a/Website/pages/documentation/index.vue b/Website/pages/documentation/index.vue index 432fc8f..ad3cd1d 100644 --- a/Website/pages/documentation/index.vue +++ b/Website/pages/documentation/index.vue @@ -1,6 +1,8 @@ diff --git a/Website/pages/documentation/url.vue b/Website/pages/documentation/url.vue index c5b5389..e95f542 100644 --- a/Website/pages/documentation/url.vue +++ b/Website/pages/documentation/url.vue @@ -1,9 +1,8 @@ @@ -11,8 +10,8 @@ export default { data() { return { - apiUrl: process.env.apiUrl - } - } -} - \ No newline at end of file + apiUrl: process.env.apiUrl, + }; + }, +}; + diff --git a/Website/pages/documentation/usage-rights.vue b/Website/pages/documentation/usage-rights.vue index 22566ae..fd310e1 100644 --- a/Website/pages/documentation/usage-rights.vue +++ b/Website/pages/documentation/usage-rights.vue @@ -1,12 +1,21 @@ @@ -17,4 +26,4 @@ li { b { font-weight: 900 !important; } - \ No newline at end of file + From 5de8d7fc158712c7508f5c74a0ce953607a428a3 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 16:53:27 -0500 Subject: [PATCH 11/19] add nuxt devices --- .gitignore | 1 + Website/nuxt.config.js | 2 +- Website/package-lock.json | 33 +++++++++++++++++++++++++++++++++ Website/package.json | 1 + 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d0c5794..c15edbd 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ Extensions/combined/bundled-content-script.js # Dist Files Extensions/combined/dist/* package-lock.json +Website/package-lock.json diff --git a/Website/nuxt.config.js b/Website/nuxt.config.js index 20a53b3..b3fc675 100644 --- a/Website/nuxt.config.js +++ b/Website/nuxt.config.js @@ -35,7 +35,7 @@ export default { css: [], plugins: [], components: true, - buildModules: ["@nuxtjs/vuetify"], + buildModules: ["@nuxtjs/vuetify", '@nuxtjs/device'], modules: [], // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify diff --git a/Website/package-lock.json b/Website/package-lock.json index a9adf2f..4d2a3e1 100644 --- a/Website/package-lock.json +++ b/Website/package-lock.json @@ -13,6 +13,7 @@ "vuetify": "^2.5.5" }, "devDependencies": { + "@nuxtjs/device": "^2.1.0", "@nuxtjs/vuetify": "^1.12.1", "babel-eslint": "^10.1.0", "eslint": "^7.32.0", @@ -2643,6 +2644,21 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/@nuxtjs/device": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nuxtjs/device/-/device-2.1.0.tgz", + "integrity": "sha512-TYBdt1w2bmCCWp+MhgcBATZtqyUBi3nSdNpcLGILw5USLwCsC/yZtIkq9YisuEzuRnod9w/RZpoE80MxLftEuA==", + "dev": true, + "dependencies": { + "defu": "^3.2.2" + } + }, + "node_modules/@nuxtjs/device/node_modules/defu": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/defu/-/defu-3.2.2.tgz", + "integrity": "sha512-8UWj5lNv7HD+kB0e9w77Z7TdQlbUYDVWqITLHNqFIn6khrNHv5WQo38Dcm1f6HeNyZf0U7UbPf6WeZDSdCzGDQ==", + "dev": true + }, "node_modules/@nuxtjs/vuetify": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@nuxtjs/vuetify/-/vuetify-1.12.1.tgz", @@ -16628,6 +16644,23 @@ } } }, + "@nuxtjs/device": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nuxtjs/device/-/device-2.1.0.tgz", + "integrity": "sha512-TYBdt1w2bmCCWp+MhgcBATZtqyUBi3nSdNpcLGILw5USLwCsC/yZtIkq9YisuEzuRnod9w/RZpoE80MxLftEuA==", + "dev": true, + "requires": { + "defu": "^3.2.2" + }, + "dependencies": { + "defu": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/defu/-/defu-3.2.2.tgz", + "integrity": "sha512-8UWj5lNv7HD+kB0e9w77Z7TdQlbUYDVWqITLHNqFIn6khrNHv5WQo38Dcm1f6HeNyZf0U7UbPf6WeZDSdCzGDQ==", + "dev": true + } + } + }, "@nuxtjs/vuetify": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@nuxtjs/vuetify/-/vuetify-1.12.1.tgz", diff --git a/Website/package.json b/Website/package.json index c16dbf1..3fe652e 100644 --- a/Website/package.json +++ b/Website/package.json @@ -15,6 +15,7 @@ "vuetify": "^2.5.5" }, "devDependencies": { + "@nuxtjs/device": "^2.1.0", "@nuxtjs/vuetify": "^1.12.1", "babel-eslint": "^10.1.0", "eslint": "^7.32.0", From 72798a62d25a6d5dd92352efc7820256a6e0be47 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 18:42:27 -0500 Subject: [PATCH 12/19] debug information --- Website/nuxt.config.js | 6 ++++-- Website/package-lock.json | 27 +++++++++++++++++++++++++++ Website/package.json | 2 +- Website/pages/debug.vue | 28 ++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 Website/pages/debug.vue diff --git a/Website/nuxt.config.js b/Website/nuxt.config.js index b3fc675..e1b77b6 100644 --- a/Website/nuxt.config.js +++ b/Website/nuxt.config.js @@ -31,12 +31,14 @@ export default { apiUrl: "https://returnyoutubedislikeapi.com", }, + //server: { host: '0.0.0.0' }, //LINE FOR DEBUGGING ONLY + target: "static", css: [], plugins: [], components: true, - buildModules: ["@nuxtjs/vuetify", '@nuxtjs/device'], - modules: [], + buildModules: ["@nuxtjs/vuetify"], + modules: ['nuxt-user-agent'], // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify vuetify: { diff --git a/Website/package-lock.json b/Website/package-lock.json index 4d2a3e1..3dca403 100644 --- a/Website/package-lock.json +++ b/Website/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "core-js": "^3.15.1", "nuxt": "^2.15.7", + "nuxt-user-agent": "^1.2.2", "vuetify": "^2.5.5" }, "devDependencies": { @@ -8930,6 +8931,14 @@ "nuxt": "bin/nuxt.js" } }, + "node_modules/nuxt-user-agent": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nuxt-user-agent/-/nuxt-user-agent-1.2.2.tgz", + "integrity": "sha512-Z9d+r1/PzJAvrr4rX70IWvRyI3qw3RukAGrRZPZ9WeByuCWmVKiW8G1AhdkUOyrDrVoBUC59iLqIVkop/NjSuQ==", + "dependencies": { + "woothee": "^1.8.1" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -14564,6 +14573,11 @@ "node": ">=8" } }, + "node_modules/woothee": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/woothee/-/woothee-1.11.1.tgz", + "integrity": "sha512-KdArM3MsNa5tlSBSL29w9ouy9MXZoFPeUdPVnL4QZH3iyV8HsqnwbWw2YLiXEx2wAh0bM55dnl0+qDE6KHBlhQ==" + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -21537,6 +21551,14 @@ "@nuxt/webpack": "2.15.8" } }, + "nuxt-user-agent": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nuxt-user-agent/-/nuxt-user-agent-1.2.2.tgz", + "integrity": "sha512-Z9d+r1/PzJAvrr4rX70IWvRyI3qw3RukAGrRZPZ9WeByuCWmVKiW8G1AhdkUOyrDrVoBUC59iLqIVkop/NjSuQ==", + "requires": { + "woothee": "^1.8.1" + } + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -25950,6 +25972,11 @@ "string-width": "^4.0.0" } }, + "woothee": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/woothee/-/woothee-1.11.1.tgz", + "integrity": "sha512-KdArM3MsNa5tlSBSL29w9ouy9MXZoFPeUdPVnL4QZH3iyV8HsqnwbWw2YLiXEx2wAh0bM55dnl0+qDE6KHBlhQ==" + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/Website/package.json b/Website/package.json index 3fe652e..03b6ce9 100644 --- a/Website/package.json +++ b/Website/package.json @@ -12,10 +12,10 @@ "dependencies": { "core-js": "^3.15.1", "nuxt": "^2.15.7", + "nuxt-user-agent": "^1.2.2", "vuetify": "^2.5.5" }, "devDependencies": { - "@nuxtjs/device": "^2.1.0", "@nuxtjs/vuetify": "^1.12.1", "babel-eslint": "^10.1.0", "eslint": "^7.32.0", diff --git a/Website/pages/debug.vue b/Website/pages/debug.vue new file mode 100644 index 0000000..6876c57 --- /dev/null +++ b/Website/pages/debug.vue @@ -0,0 +1,28 @@ + + + \ No newline at end of file From 45f7e811e9dfc8c874de4815088e18ed36a8cf0c Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 18:45:11 -0500 Subject: [PATCH 13/19] copy button --- Website/pages/debug.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Website/pages/debug.vue b/Website/pages/debug.vue index 6876c57..8dd01ce 100644 --- a/Website/pages/debug.vue +++ b/Website/pages/debug.vue @@ -4,7 +4,7 @@ Debug Information - + Browser Information:
Browser: {{ device._parsed.name }}
Browser Vendor: {{ device._parsed.vendor }}
@@ -13,6 +13,10 @@ Operating System Version: {{ device._parsed.os_version }}
Device Type: {{ device._parsed.category }}
+ + + mdi-content-copyCopy +
From bb29bb54b4b455fd288461e2a9a592f44f7c980b Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 18:45:27 -0500 Subject: [PATCH 14/19] beautify --- Website/pages/debug.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Website/pages/debug.vue b/Website/pages/debug.vue index 8dd01ce..a231bc1 100644 --- a/Website/pages/debug.vue +++ b/Website/pages/debug.vue @@ -14,19 +14,22 @@ Device Type: {{ device._parsed.category }}
- - mdi-content-copyCopy + + + mdi-content-copyCopy + \ No newline at end of file + } + + From 7f82dba4b98d55d6d96dac9b564c8d2ba6c79ba5 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 18:46:11 -0500 Subject: [PATCH 15/19] beautify documentation --- Website/pages/documentation/endpoints.vue | 19 +++--- Website/pages/documentation/fetching.vue | 65 ++++++++------------ Website/pages/documentation/url.vue | 15 ++--- Website/pages/documentation/usage-rights.vue | 14 +++-- 4 files changed, 51 insertions(+), 62 deletions(-) diff --git a/Website/pages/documentation/endpoints.vue b/Website/pages/documentation/endpoints.vue index ef94c10..c1c69f5 100644 --- a/Website/pages/documentation/endpoints.vue +++ b/Website/pages/documentation/endpoints.vue @@ -7,13 +7,14 @@ diff --git a/Website/pages/documentation/fetching.vue b/Website/pages/documentation/fetching.vue index 651f2b8..5710670 100644 --- a/Website/pages/documentation/fetching.vue +++ b/Website/pages/documentation/fetching.vue @@ -3,35 +3,21 @@

Basic Fetching Tutorial

Example to get votes of a given YouTube video ID: - kxOuG8jMIgI

+ kxOuG8jMIgI

Example Request:

Request URL: -
- Request Method: -
HTTP/GET
- Headers:
+
+ Request Method: +
HTTP/GET
+ Headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9
Pragma: no-cache
Cache-Control: no-cache
- Connection: keep-alive

- Response:
+ Connection: keep-alive
+ Response:
{
@@ -47,12 +33,9 @@


- An invalid YouTube ID will return status code 404 "Not Found".
- An incorrectly formatted YouTube ID will return 400 "Bad - Request". + An invalid YouTube ID will return status code 404 "Not Found".
+ An incorrectly formatted YouTube ID will return 400 "Bad + Request".
@@ -60,19 +43,21 @@ diff --git a/Website/pages/documentation/url.vue b/Website/pages/documentation/url.vue index e95f542..97b78d1 100644 --- a/Website/pages/documentation/url.vue +++ b/Website/pages/documentation/url.vue @@ -7,11 +7,12 @@ diff --git a/Website/pages/documentation/usage-rights.vue b/Website/pages/documentation/usage-rights.vue index fd310e1..f384c05 100644 --- a/Website/pages/documentation/usage-rights.vue +++ b/Website/pages/documentation/usage-rights.vue @@ -20,10 +20,12 @@ From 0e6d1862715a06311724d18b9661df86bf8b6571 Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Mon, 27 Dec 2021 19:05:44 -0500 Subject: [PATCH 16/19] add debug info --- Extensions/combined/debug.js | 8 ++ .../dist/chrome/bundled-content-script.js | 89 +++++++++++++------ Extensions/combined/dist/chrome/manifest.json | 4 + Extensions/combined/dist/chrome/popup.html | 15 ++-- Extensions/combined/dist/chrome/popup.js | 50 ++++++++++- .../combined/dist/chrome/ryd.background.js | 66 ++++++++++++-- .../dist/firefox/bundled-content-script.js | 89 +++++++++++++------ .../combined/dist/firefox/manifest.json | 5 ++ Extensions/combined/dist/firefox/popup.html | 15 ++-- Extensions/combined/dist/firefox/popup.js | 50 ++++++++++- .../combined/dist/firefox/ryd.background.js | 66 ++++++++++++-- Extensions/combined/manifest-chrome.json | 4 + Extensions/combined/manifest-firefox.json | 5 ++ Website/nuxt.config.js | 2 +- Website/pages/debug.vue | 5 +- 15 files changed, 383 insertions(+), 90 deletions(-) create mode 100644 Extensions/combined/debug.js diff --git a/Extensions/combined/debug.js b/Extensions/combined/debug.js new file mode 100644 index 0000000..4bff57f --- /dev/null +++ b/Extensions/combined/debug.js @@ -0,0 +1,8 @@ +//--- Get Extension Information ---// +const extension = chrome.runtime.getManifest(); + +//--- Get Debug Elements ---// +const ver = document.getElementById("extension-version"); + +//--- Set Debug Elements ---// +ver.innerHTML = extension.version; \ No newline at end of file diff --git a/Extensions/combined/dist/chrome/bundled-content-script.js b/Extensions/combined/dist/chrome/bundled-content-script.js index 4685457..f7da4cd 100644 --- a/Extensions/combined/dist/chrome/bundled-content-script.js +++ b/Extensions/combined/dist/chrome/bundled-content-script.js @@ -96,11 +96,13 @@ function cLog(message, writer) { function sendVote(vote) { - getBrowser().runtime.sendMessage({ - message: "send_vote", - vote: vote, - videoId: getVideoId(window.location.href) - }); + if (extConfig.disableVoteSubmission !== true) { + getBrowser().runtime.sendMessage({ + message: "send_vote", + vote: vote, + videoId: getVideoId(window.location.href) + }); + } } function sendVideoIds() { @@ -118,7 +120,7 @@ function sendVideoIds() { }); } -function likeClicked(storedData) { +function likeClicked() { if (checkForSignInButton() === false) { if (storedData.previousState === DISLIKED_STATE) { sendVote(1); @@ -141,7 +143,7 @@ function likeClicked(storedData) { } } -function dislikeClicked(storedData) { +function dislikeClicked() { if (checkForSignInButton() == false) { if (storedData.previousState === NEUTRAL_STATE) { sendVote(-1); @@ -166,6 +168,26 @@ function dislikeClicked(storedData) { } } +function addLikeDislikeEventListener() { + var buttons = buttons_getButtons(); + + if (!window.returnDislikeButtonlistenersSet) { + buttons.children[0].addEventListener("click", likeClicked); + buttons.children[1].addEventListener("click", dislikeClicked); + window.returnDislikeButtonlistenersSet = true; + } +} + +function storageChangeHandler(changes, area) { + if (changes.disableVoteSubmission !== undefined) { + handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue); + } +} + +function handleDisableVoteSubmissionChangeEvent(value) { + extConfig.disableVoteSubmission = value; +} + ;// CONCATENATED MODULE: ./Extensions/combined/src/state.js @@ -175,6 +197,14 @@ function dislikeClicked(storedData) { var LIKED_STATE = "LIKED_STATE"; var DISLIKED_STATE = "DISLIKED_STATE"; var NEUTRAL_STATE = "NEUTRAL_STATE"; +var extConfig = { + disableVoteSubmission: false +}; +var storedData = { + likes: 0, + dislikes: 0, + previousState: NEUTRAL_STATE +}; function isMobile() { return location.hostname == "m.youtube.com"; @@ -262,13 +292,29 @@ function setState(storedData) { }); } -function setInitialState(storedData) { +function setInitialState() { setState(storedData); setTimeout(function () { sendVideoIds(); }, 1500); } +function initExtConfig() { + initializeDisableVoteSubmission(); +} + +function initializeDisableVoteSubmission() { + getBrowser().storage.sync.get(['disableVoteSubmission'], function (res) { + if (res.disableVoteSubmission === undefined) { + getBrowser().storage.sync.set({ + disableVoteSubmission: false + }); + } else { + extConfig.disableVoteSubmission = res.disableVoteSubmission; + } + }); +} + ;// CONCATENATED MODULE: ./Extensions/combined/src/buttons.js @@ -308,16 +354,15 @@ function checkForSignInButton() { ;// CONCATENATED MODULE: ./Extensions/combined/ryd.content-script.js +//--- Import Button Functions ---// + //--- Import State Functions ---// + + //--- Import Video & Browser Functions ---// - -var storedData = { - likes: 0, - dislikes: 0, - previousState: NEUTRAL_STATE -}; +initExtConfig(); var jsInitChecktimer = null; function setEventListeners(evt) { @@ -327,19 +372,9 @@ function setEventListeners(evt) { if ((_getButtons = buttons_getButtons()) !== null && _getButtons !== void 0 && _getButtons.offsetParent && isVideoLoaded()) { clearInterval(jsInitChecktimer); jsInitChecktimer = null; - var buttons = buttons_getButtons(); - - if (!window.returnDislikeButtonlistenersSet) { - buttons.children[0].addEventListener("click", function () { - return likeClicked(storedData); - }); - buttons.children[1].addEventListener("click", function () { - return dislikeClicked(storedData); - }); - window.returnDislikeButtonlistenersSet = true; - } - - setInitialState(storedData); + addLikeDislikeEventListener(); + setInitialState(); + getBrowser().storage.onChanged.addListener(storageChangeHandler); } } diff --git a/Extensions/combined/dist/chrome/manifest.json b/Extensions/combined/dist/chrome/manifest.json index bc00d83..d1cf586 100644 --- a/Extensions/combined/dist/chrome/manifest.json +++ b/Extensions/combined/dist/chrome/manifest.json @@ -27,6 +27,10 @@ "exclude_matches": ["*://*.music.youtube.com/*"], "js": ["bundled-content-script.js"], "css": ["content-style.css"] + }, + { + "matches": ["*://*.returnyoutubedislike.com/debug","http://localhost/debug"], + "js": ["debug.js"] } ], "externally_connectable": { diff --git a/Extensions/combined/dist/chrome/popup.html b/Extensions/combined/dist/chrome/popup.html index d97cd65..27910d2 100644 --- a/Extensions/combined/dist/chrome/popup.html +++ b/Extensions/combined/dist/chrome/popup.html @@ -13,17 +13,19 @@

Return YouTube Dislike

by Dmitrii Selivanov & Community

+



+

- +
@@ -32,16 +34,17 @@ Settings
+ Disable like/dislike submission + +
- +
-
kxOuG8jMIgI

+ kxOuG8jMIgI

Example Request:

Request URL: -
- Request Method: -
HTTP/GET
- Headers:
+
+ Request Method: +
HTTP/GET
+ Headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9
Pragma: no-cache
Cache-Control: no-cache
- Connection: keep-alive

- Response:
+ Connection: keep-alive

+ Response:
{
@@ -33,9 +47,12 @@


- An invalid YouTube ID will return status code 404 "Not Found".
- An incorrectly formatted YouTube ID will return 400 "Bad - Request". + An invalid YouTube ID will return status code 404 "Not Found".
+ An incorrectly formatted YouTube ID will return 400 "Bad + Request".
@@ -43,21 +60,19 @@ diff --git a/Website/pages/documentation/url.vue b/Website/pages/documentation/url.vue index 97b78d1..e95f542 100644 --- a/Website/pages/documentation/url.vue +++ b/Website/pages/documentation/url.vue @@ -7,12 +7,11 @@ diff --git a/Website/pages/documentation/usage-rights.vue b/Website/pages/documentation/usage-rights.vue index f384c05..09bf581 100644 --- a/Website/pages/documentation/usage-rights.vue +++ b/Website/pages/documentation/usage-rights.vue @@ -20,12 +20,11 @@ From 255fdb3e097cff754e25540ff975a619c8145f3d Mon Sep 17 00:00:00 2001 From: Front <27463495+Frontesque@users.noreply.github.com> Date: Fri, 31 Dec 2021 13:38:23 -0500 Subject: [PATCH 19/19] remove dist files --- .../dist/chrome/bundled-content-script.js | 396 ------------------ .../combined/dist/chrome/content-style.css | 26 -- .../combined/dist/chrome/icons/icon128.png | Bin 7093 -> 0 bytes .../combined/dist/chrome/icons/icon48.png | Bin 4454 -> 0 bytes Extensions/combined/dist/chrome/manifest.json | 45 -- Extensions/combined/dist/chrome/popup.css | 119 ------ Extensions/combined/dist/chrome/popup.html | 51 --- Extensions/combined/dist/chrome/popup.js | 103 ----- .../combined/dist/chrome/ryd.background.js | 272 ------------ .../dist/firefox/bundled-content-script.js | 396 ------------------ .../combined/dist/firefox/content-style.css | 26 -- .../combined/dist/firefox/icons/icon128.png | Bin 7093 -> 0 bytes .../combined/dist/firefox/icons/icon48.png | Bin 4454 -> 0 bytes .../combined/dist/firefox/manifest.json | 31 -- Extensions/combined/dist/firefox/popup.css | 119 ------ Extensions/combined/dist/firefox/popup.html | 51 --- Extensions/combined/dist/firefox/popup.js | 103 ----- .../combined/dist/firefox/ryd.background.js | 272 ------------ 18 files changed, 2010 deletions(-) delete mode 100644 Extensions/combined/dist/chrome/bundled-content-script.js delete mode 100644 Extensions/combined/dist/chrome/content-style.css delete mode 100644 Extensions/combined/dist/chrome/icons/icon128.png delete mode 100644 Extensions/combined/dist/chrome/icons/icon48.png delete mode 100644 Extensions/combined/dist/chrome/manifest.json delete mode 100644 Extensions/combined/dist/chrome/popup.css delete mode 100644 Extensions/combined/dist/chrome/popup.html delete mode 100644 Extensions/combined/dist/chrome/popup.js delete mode 100644 Extensions/combined/dist/chrome/ryd.background.js delete mode 100644 Extensions/combined/dist/firefox/bundled-content-script.js delete mode 100644 Extensions/combined/dist/firefox/content-style.css delete mode 100644 Extensions/combined/dist/firefox/icons/icon128.png delete mode 100644 Extensions/combined/dist/firefox/icons/icon48.png delete mode 100644 Extensions/combined/dist/firefox/manifest.json delete mode 100644 Extensions/combined/dist/firefox/popup.css delete mode 100644 Extensions/combined/dist/firefox/popup.html delete mode 100644 Extensions/combined/dist/firefox/popup.js delete mode 100644 Extensions/combined/dist/firefox/ryd.background.js diff --git a/Extensions/combined/dist/chrome/bundled-content-script.js b/Extensions/combined/dist/chrome/bundled-content-script.js deleted file mode 100644 index f7da4cd..0000000 --- a/Extensions/combined/dist/chrome/bundled-content-script.js +++ /dev/null @@ -1,396 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -var __webpack_exports__ = {}; - -;// CONCATENATED MODULE: ./Extensions/combined/src/bar.js - - -function createRateBar(likes, dislikes) { - var rateBar = document.getElementById("ryd-bar-container"); - var widthPx = buttons_getButtons().children[0].clientWidth + buttons_getButtons().children[1].clientWidth + 8; - var widthPercent = likes + dislikes > 0 ? likes / (likes + dislikes) * 100 : 50; - - if (!rateBar) { - (document.getElementById("menu-container") || document.querySelector("ytm-slim-video-action-bar-renderer")).insertAdjacentHTML("beforeend", "\n
\n
\n \n
\n
\n \n \n ").concat(likes.toLocaleString(), " / ").concat(dislikes.toLocaleString(), "\n \n \n ")); - } else { - document.getElementById("ryd-bar-container").style.width = widthPx + "px"; - document.getElementById("ryd-bar").style.width = widthPercent + "%"; - document.querySelector("#ryd-dislike-tooltip > #tooltip").innerHTML = "".concat(likes.toLocaleString(), " / ").concat(dislikes.toLocaleString()); - } -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/utils.js -function roundDown(num) { - if (num < 1000) return num; - - var _int = Math.floor(Math.log10(num) - 2); - - var decimal = _int + (_int % 3 ? 1 : 0); - var value = Math.floor(num / Math.pow(10, decimal)); - return value * Math.pow(10, decimal); -} - -function numberFormat(numberState) { - var userLocales; - - try { - var _URL, _URL$searchParams, _Array$from, _Array$from$find; - - userLocales = (_URL = new URL((_Array$from = Array.from(document.querySelectorAll("head > link[rel='search']"))) === null || _Array$from === void 0 ? void 0 : (_Array$from$find = _Array$from.find(function (n) { - var _n$getAttribute; - - return n === null || n === void 0 ? void 0 : (_n$getAttribute = n.getAttribute("href")) === null || _n$getAttribute === void 0 ? void 0 : _n$getAttribute.includes("?locale="); - })) === null || _Array$from$find === void 0 ? void 0 : _Array$from$find.getAttribute("href"))) === null || _URL === void 0 ? void 0 : (_URL$searchParams = _URL.searchParams) === null || _URL$searchParams === void 0 ? void 0 : _URL$searchParams.get("locale"); - } catch (_unused) {} - - var formatter = Intl.NumberFormat(document.documentElement.lang || userLocales || navigator.language, { - notation: "compact" - }); - return formatter.format(roundDown(numberState)); -} - -function getBrowser() { - if (typeof chrome !== "undefined" && typeof chrome.runtime !== "undefined") { - return chrome; - } else if (typeof browser !== "undefined" && typeof browser.runtime !== "undefined") { - return browser; - } else { - console.log("browser is not supported"); - return false; - } -} - -function getVideoId(url) { - var urlObject = new URL(url); - var pathname = urlObject.pathname; - - if (pathname.startsWith("/clip")) { - return document.querySelector("meta[itemprop='videoId']").content; - } else { - return urlObject.searchParams.get("v"); - } -} - -function isVideoLoaded() { - var videoId = getVideoId(window.location.href); - return document.querySelector("ytd-watch-flexy[video-id='".concat(videoId, "']")) !== null || // mobile: no video-id attribute - document.querySelector('#player[loading="false"]:not([hidden])') !== null; -} - -function cLog(message, writer) { - message = "[return youtube dislike]: ".concat(message); - - if (writer) { - writer(message); - } else { - console.log(message); - } -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/events.js - - - - - -function sendVote(vote) { - if (extConfig.disableVoteSubmission !== true) { - getBrowser().runtime.sendMessage({ - message: "send_vote", - vote: vote, - videoId: getVideoId(window.location.href) - }); - } -} - -function sendVideoIds() { - var links = Array.from(document.getElementsByClassName("yt-simple-endpoint ytd-compact-video-renderer")).concat(Array.from(document.getElementsByClassName("yt-simple-endpoint ytd-thumbnail"))); // Also try mobile - - if (links.length < 1) links = Array.from(document.querySelectorAll(".large-media-item-metadata > a, a.large-media-item-thumbnail-container")); - var ids = links.filter(function (x) { - return x.href && x.href.indexOf("/watch?v=") > 0; - }).map(function (x) { - return getVideoId(x.href); - }); - getBrowser().runtime.sendMessage({ - message: "send_links", - videoIds: ids - }); -} - -function likeClicked() { - if (checkForSignInButton() === false) { - if (storedData.previousState === DISLIKED_STATE) { - sendVote(1); - storedData.dislikes--; - storedData.likes++; - createRateBar(storedData.likes, storedData.dislikes); - setDislikes(numberFormat(storedData.dislikes)); - storedData.previousState = LIKED_STATE; - } else if (storedData.previousState === NEUTRAL_STATE) { - sendVote(1); - storedData.likes++; - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = LIKED_STATE; - } else if (storedData.previousState = LIKED_STATE) { - sendVote(0); - storedData.likes--; - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = NEUTRAL_STATE; - } - } -} - -function dislikeClicked() { - if (checkForSignInButton() == false) { - if (storedData.previousState === NEUTRAL_STATE) { - sendVote(-1); - storedData.dislikes++; - setDislikes(numberFormat(storedData.dislikes)); - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = DISLIKED_STATE; - } else if (storedData.previousState === DISLIKED_STATE) { - sendVote(0); - storedData.dislikes--; - setDislikes(numberFormat(storedData.dislikes)); - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = NEUTRAL_STATE; - } else if (storedData.previousState === LIKED_STATE) { - sendVote(-1); - storedData.likes--; - storedData.dislikes++; - setDislikes(numberFormat(storedData.dislikes)); - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = DISLIKED_STATE; - } - } -} - -function addLikeDislikeEventListener() { - var buttons = buttons_getButtons(); - - if (!window.returnDislikeButtonlistenersSet) { - buttons.children[0].addEventListener("click", likeClicked); - buttons.children[1].addEventListener("click", dislikeClicked); - window.returnDislikeButtonlistenersSet = true; - } -} - -function storageChangeHandler(changes, area) { - if (changes.disableVoteSubmission !== undefined) { - handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue); - } -} - -function handleDisableVoteSubmissionChangeEvent(value) { - extConfig.disableVoteSubmission = value; -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/state.js - - - - -var LIKED_STATE = "LIKED_STATE"; -var DISLIKED_STATE = "DISLIKED_STATE"; -var NEUTRAL_STATE = "NEUTRAL_STATE"; -var extConfig = { - disableVoteSubmission: false -}; -var storedData = { - likes: 0, - dislikes: 0, - previousState: NEUTRAL_STATE -}; - -function isMobile() { - return location.hostname == "m.youtube.com"; -} - -function isVideoLiked() { - if (isMobile()) { - return getLikeButton().querySelector("button").getAttribute("aria-label") == "true"; - } - - return getLikeButton().classList.contains("style-default-active"); -} - -function isVideoDisliked() { - if (isMobile()) { - return getDislikeButton().querySelector("button").getAttribute("aria-label") == "true"; - } - - return getDislikeButton().classList.contains("style-default-active"); -} - -function getState(storedData) { - if (isVideoLiked()) { - return { - current: LIKED_STATE, - previous: storedData.previousState - }; - } - - if (isVideoDisliked()) { - return { - current: DISLIKED_STATE, - previous: storedData.previousState - }; - } - - return { - current: NEUTRAL_STATE, - previous: storedData.previousState - }; -} //--- Sets The Likes And Dislikes Values ---// - - -function setLikes(likesCount) { - getButtons().children[0].querySelector("#text").innerText = likesCount; -} - -function setDislikes(dislikesCount) { - if (isMobile()) { - buttons_getButtons().children[1].querySelector(".button-renderer-text").innerText = dislikesCount; - return; - } - - buttons_getButtons().children[1].querySelector("#text").innerText = dislikesCount; -} - -function getLikeCountFromButton() { - var likesStr = getLikeButton().querySelector("button").getAttribute("aria-label").replace(/\D/g, ""); - return likesStr.length > 0 ? parseInt(likesStr) : false; -} - -function processResponse(response, storedData) { - var formattedDislike = numberFormat(response.dislikes); - setDislikes(formattedDislike); - storedData.dislikes = parseInt(response.dislikes); - storedData.likes = getLikeCountFromButton() || parseInt(response.likes); - createRateBar(storedData.likes, storedData.dislikes); -} - -function setState(storedData) { - storedData.previousState = isVideoDisliked() ? DISLIKED_STATE : isVideoLiked() ? LIKED_STATE : NEUTRAL_STATE; - var statsSet = false; - getBrowser().runtime.sendMessage({ - message: "set_state", - videoId: getVideoId(window.location.href), - state: getState(storedData).current, - likeCount: getLikeCountFromButton() || null - }, function (response) { - cLog("response from api:"); - cLog(JSON.stringify(response)); - - if (response !== undefined && !("traceId" in response) && !statsSet) { - processResponse(response, storedData); - } else {} - }); -} - -function setInitialState() { - setState(storedData); - setTimeout(function () { - sendVideoIds(); - }, 1500); -} - -function initExtConfig() { - initializeDisableVoteSubmission(); -} - -function initializeDisableVoteSubmission() { - getBrowser().storage.sync.get(['disableVoteSubmission'], function (res) { - if (res.disableVoteSubmission === undefined) { - getBrowser().storage.sync.set({ - disableVoteSubmission: false - }); - } else { - extConfig.disableVoteSubmission = res.disableVoteSubmission; - } - }); -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/buttons.js - - -function buttons_getButtons() { - var _document$getElementB; - - if (isMobile()) { - return document.querySelector(".slim-video-action-bar-actions"); - } //--- If Menu Element Is Displayed: ---// - - - if (((_document$getElementB = document.getElementById("menu-container")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.offsetParent) === null) { - return document.querySelector("ytd-menu-renderer.ytd-watch-metadata > div"); //--- If Menu Element Isnt Displayed: ---// - } else { - var _document$getElementB2; - - return (_document$getElementB2 = document.getElementById("menu-container")) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.querySelector("#top-level-buttons-computed"); - } -} - -function getLikeButton() { - return buttons_getButtons().children[0]; -} - -function getDislikeButton() { - return buttons_getButtons().children[1]; -} - -function checkForSignInButton() { - if (document.querySelector("a[href^='https://accounts.google.com/ServiceLogin']")) { - return true; - } else { - return false; - } -} - - -;// CONCATENATED MODULE: ./Extensions/combined/ryd.content-script.js -//--- Import Button Functions ---// - //--- Import State Functions ---// - - //--- Import Video & Browser Functions ---// - - - - -initExtConfig(); -var jsInitChecktimer = null; - -function setEventListeners(evt) { - function checkForJS_Finish() { - var _getButtons; - - if ((_getButtons = buttons_getButtons()) !== null && _getButtons !== void 0 && _getButtons.offsetParent && isVideoLoaded()) { - clearInterval(jsInitChecktimer); - jsInitChecktimer = null; - addLikeDislikeEventListener(); - setInitialState(); - getBrowser().storage.onChanged.addListener(storageChangeHandler); - } - } - - if (window.location.href.indexOf("watch?") >= 0) { - jsInitChecktimer = setInterval(checkForJS_Finish, 111); - } -} - -setEventListeners(); -document.addEventListener("yt-navigate-finish", function (event) { - if (jsInitChecktimer !== null) clearInterval(jsInitChecktimer); - window.returnDislikeButtonlistenersSet = false; - setEventListeners(); -}); -setTimeout(function () { - return sendVideoIds(); -}, 2500); -/******/ })() -; \ No newline at end of file diff --git a/Extensions/combined/dist/chrome/content-style.css b/Extensions/combined/dist/chrome/content-style.css deleted file mode 100644 index c06b29c..0000000 --- a/Extensions/combined/dist/chrome/content-style.css +++ /dev/null @@ -1,26 +0,0 @@ -#ryd-bar-container { - background: var(--yt-spec-icon-disabled); - border-radius: 2px; -} - -#ryd-bar { - background: var(--yt-spec-text-primary); - border-radius: 2px; - transition: all 0.15s ease-in-out; -} - -.ryd-tooltip { - position: relative; - display: block; - height: 2px; - top: 9px; -} - -.ryd-tooltip-bar-container { - width: 100%; - height: 2px; - position: absolute; - padding-top: 6px; - padding-bottom: 28px; - top: -6px; -} diff --git a/Extensions/combined/dist/chrome/icons/icon128.png b/Extensions/combined/dist/chrome/icons/icon128.png deleted file mode 100644 index 23b4958bac00cf7bf00637091ce41b29d82014c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7093 zcmV;m8%pGfP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3*ta^pA>M*rg!a|8m3^*C4(5p#n%{=5X`-Ex<^ z+lsPOq(}m}d<$Tw|NHND|KTU)R9#G^=9crtPi(P;&WC!v{pjQUKIX4@e!u+q$8Ybx zJrQ^p-sL`6;^VA5j=y|AzrJ&$Z%+91=>mCuOnCp`(jUje6+VopHE!|#r@sB$d)2-5 zo?VZbFywnu_aofPZTR9KN^&mCybAvkpUZhQUiIqN^zmBPyauo7n-5;D?W14LcfY;* z#ryP=F~*>w@E*bpa*kCgp@k`zc!~D%I}~ZMq)Lz(R79ea@H!TMp4-mzrmsACdA=Gv zH}hQbRa_srfuV#T;ZusnDRqu6i0Mne34p@2*vv-p^~7^$b-Z% z$be5NECv~(NG3OxI^x+}Q~ddENZ~$CtB{{0Sqiyn(n(f~iTWwAQbRpSiYd`$CDqhY zcUf}GDd$|W^;|DfVo4>JQfg_XSE;e4nro@Gw%S{0LQAHWTWPhm);rJa(e>21y7P_R zM;J2VNF$Fj>S&`+%4f!zW}ao%*=Ap1$%-qjyvnMpt*%}vC8tr7W-VH^Y2Vb^mK}H6 zd6!*x+x<0bkF0)q{UU4rk+pC#W#22WS>tFacB69(Z#a`IXJjlyPsWR7fPxN|v#a_T zgJsTgcC|oPq`)APs&tX)#_TCd(^q3_Od$RiF{R8 z>nRW^CXons@p%ocEiLN2c5U3jds@C1-8^&F#E@Fz$W^NyS;AN~2K%hDGkYBkVB1`J zwIUB*!#im>yy(2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eEjJ;!ZTu%|Ne)8LVxU~naT9_T0~Lyjdk}OoutDZak|arz fBuSDaJx>1uZ4Hz~LN5Q900000NkvXXu0mjf<(q04 diff --git a/Extensions/combined/dist/chrome/icons/icon48.png b/Extensions/combined/dist/chrome/icons/icon48.png deleted file mode 100644 index f2a5951c399c68b60c03e194c685dddd093710a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4454 zcmV-s5t;6ZP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O?T!b|X8kg#U9Dy#!9+upEx(^bX$g`vWs&`?_RX zb*r9LHdV?L2?BvYfN9qM{db%H@Dr0H6D5~aQ?mTT8mn)-Dfazm-Q)F{v+?|W{J8tC zGfyvg#=sb^4|BY)hWqo!{poFFq9+%eeELFoTgHD}IJf(AZ~Z?k>ee~?@u$51?mf%i z>)Kt52{)u`Q`ZvaF%36%ycEvY60gj!@IIecbwhfyXdBI&26{b zWE^f_WAw{sM(>9Y=d%*BuYLp@T!{K|+viZj3?=w5{0bpN6a1Sk?yOtSdcze~o{n3+ zV=~8AzI~aWZg}Oj_ptZ~2bbd~cLmscje}D+2K~!z1jOw-ZgL#_c)k6Y4}lFtP>!1m z8*H{;Q*?3f*a`;#f%}B#{!0$1c@S&BukMh&7_bt z=Tgc^bFSr(W0st9&L!8}N+_{NNhOz3YH8KiKuStYHP=#WZH+ZsG))@cZrssY_dWF3 zrKg^I>9w~3d`28H(#WHXI@ zy4zdS?x_Cq`i-c$J8J$!O7F{WQRCB`b)qwcQ=Sox84>f*5%H`M0MK4zW{Zo_YveR$ zwtBKcJVuJfW;)x9ON1~k=ViOM*u6*Y<+vGq{ZrihE0HrAy1x)PZ&vsewx2G@R|PH)q6%7^m~I3x?&|Qm(=dA|=7|-9$F+?ADe#W5b)gPu0y# ziVV_bq=^L~<{WG)Z4viHI&~7iuAUj-=LuUBIqz+0%DZDrFZ%z!YBqcLj(vT`$Xt6e z?a1BlK34RgojbH~m?F>f=x?^wbu zVWt)K+D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$$faeMTe6ZYqb`bM6u0cuQ zf_ad?3>Y58$*1^DhNs#N3~^lGnZSOUYAQPV3*DbK2pMv5^8f$<07*qoM6N<$f}yQzKL7v# diff --git a/Extensions/combined/dist/chrome/manifest.json b/Extensions/combined/dist/chrome/manifest.json deleted file mode 100644 index d1cf586..0000000 --- a/Extensions/combined/dist/chrome/manifest.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "Return YouTube Dislike", - "description": "Returns ability to see dislikes", - "version": "2.0.0.3", - "manifest_version": 3, - "background": { - "service_worker": "ryd.background.js" - }, - "icons": { - "48": "icons/icon48.png", - "128": "icons/icon128.png" - }, - "host_permissions": ["*://*.youtube.com/*"], - "permissions": [ - "storage" - ], - "action": { - "default_popup": "popup.html" - }, - "content_scripts": [ - { - "matches": [ - "*://youtube.com/*", - "*://www.youtube.com/*", - "*://m.youtube.com/*" - ], - "exclude_matches": ["*://*.music.youtube.com/*"], - "js": ["bundled-content-script.js"], - "css": ["content-style.css"] - }, - { - "matches": ["*://*.returnyoutubedislike.com/debug","http://localhost/debug"], - "js": ["debug.js"] - } - ], - "externally_connectable": { - "matches": ["*://*.youtube.com/*"] - }, - "web_accessible_resources": [ - { - "resources": ["ryd.script.js"], - "matches": ["*://*.youtube.com/*"] - } - ] -} diff --git a/Extensions/combined/dist/chrome/popup.css b/Extensions/combined/dist/chrome/popup.css deleted file mode 100644 index 3075989..0000000 --- a/Extensions/combined/dist/chrome/popup.css +++ /dev/null @@ -1,119 +0,0 @@ -/* Variables */ -:root { - --primary: #cc2929; - --accent: #581111; - - --background: #111; - --secondary: #272727; - --tertiary: #333333; - --lightGrey: #999; - --white: #fff; -} - -/* Window Styling */ -html, -body { - background-color: var(--background); - color: var(--white); - min-width: 300px; - padding: 0.5em; - font-family: 'Roboto', Arial, Helvetica, sans-serif; - font-size: 14px; -} - -h1 { - font-size: 26px; -} - -button { - color: var(--white); - background: var(--secondary); - cursor: pointer; - padding: 5px 16px; - border: none; - border-radius: 4px; - font-weight: 500; - box-shadow: 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px 0 rgb(0 0 0 / 14%), 0 1px 10px 0 rgb(0 0 0 / 12%); - transition: .4s; -} - -button:hover { - background: #444; -} - -#advancedToggle { - margin-top: 1em; - margin-bottom: 2em; -} - -#advancedSettings { - display: none; - border: 2px solid var(--secondary); - border-radius: 0.5rem; - padding: 1rem; -} - -#advancedLegend { - color: var(--tertiary) !important; - /* margin: auto; */ /* Center the label */ - /* padding: .25rem .5rem; */ - /* border-radius: .25rem; */ - /* border: .25rem solid var(--secondary); */ -} - -/* Switches */ -.switch { - position: relative; - display: inline-block; - width: 30px; - height: 17px; - margin-bottom: 1rem; -} - -.switch:last-of-type { - margin-bottom: 0; -} - -.switch input { - display: none; -} - -.slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: var(--secondary); - transition: 0.4s; - border-radius: 34px; -} - -.slider:before { - position: absolute; - content: ""; - height: 13px; - width: 13px; - left: 2px; - bottom: 2px; - background: var(--lightGrey); - transition: 0.4s; - border-radius: 50%; -} - -input:checked + .slider { - background: var(--accent); -} - -input:checked + .slider:before { - transform: translateX(13px); - background: var(--primary); -} - -.switchLabel { - margin-left: 0.5rem; - width: 250px !important; - transform: translateX(35px); - display: inline-block; -} diff --git a/Extensions/combined/dist/chrome/popup.html b/Extensions/combined/dist/chrome/popup.html deleted file mode 100644 index 27910d2..0000000 --- a/Extensions/combined/dist/chrome/popup.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Return YouTube Dislike - - - - - - -
- -

Return YouTube Dislike

-

by Dmitrii Selivanov & Community

-

- - - - - -

- - -
- -
- -
- -
- -
- Settings - - -
- - -
- - - diff --git a/Extensions/combined/dist/chrome/popup.js b/Extensions/combined/dist/chrome/popup.js deleted file mode 100644 index c0e7b78..0000000 --- a/Extensions/combined/dist/chrome/popup.js +++ /dev/null @@ -1,103 +0,0 @@ -/* Config */ -const config = { - advanced: false, - showAdvancedMessage: "Show Settings", - hideAdvancedMessage: "Hide Settings", - disableVoteSubmission: false, -} - - function initConfig() { - initializeVersionNumber(); - } - - function initializeVersionNumber() { - const version = chrome.runtime.getManifest().version; - document.getElementById('ext-version').innerHTML = 'v' + version; -} - - links: { - website: "https://returnyoutubedislike.com", - github: "https://github.com/Anarios/return-youtube-dislike", - discord: "https://discord.gg/mYnESY4Md5", - donate: 'https://returnyoutubedislike.com/donate', - faq: 'https://returnyoutubedislike.com/faq' - }, -}; - -/* Links */ -document.getElementById("link_website").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.website }); -}); - -document.getElementById("link_github").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.github }); -}); - -document.getElementById("link_discord").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.discord }); -}); - -document.getElementById("link_faq").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.faq }); -}); - -document.getElementById("link_donate").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.donate }); -}); - - -document.getElementById("disable_vote_submission").addEventListener("click", (ev) => { - chrome.storage.sync.set({ disableVoteSubmission: ev.target.checked }); -}); - -/* Advanced Toggle */ -const advancedToggle = document.getElementById("advancedToggle"); -advancedToggle.addEventListener("click", () => { - const adv = document.getElementById("advancedSettings"); - if (config.advanced) { - adv.style.display = "none"; - advancedToggle.innerHTML = config.showAdvancedMessage; - config.advanced = false; - } else { - adv.style.display = "block"; - advancedToggle.innerHTML = config.hideAdvancedMessage; - config.advanced = true; - } -}); - -initConfig(); - -function initConfig() { - initializeDisableVoteSubmission(); -} - -function initializeDisableVoteSubmission() { - chrome.storage.sync.get(['disableVoteSubmission'], (res) => { - handleDisableVoteSubmissionChangeEvent(res.disableVoteSubmission); - }); -} - -chrome.storage.onChanged.addListener(storageChangeHandler); - -function storageChangeHandler(changes, area) { - if (changes.disableVoteSubmission !== undefined) { - handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue); - } -} - -function handleDisableVoteSubmissionChangeEvent(value) { - config.disableVoteSubmission = value; - document.getElementById("disable_vote_submission").checked = value; -} - -/* popup-script.js -document.querySelector('#login') -.addEventListener('click', function () { - chrome.runtime.sendMessage({ message: 'get_auth_token' }); -}); - - -document.querySelector("#log_off").addEventListener("click", function () { - chrome.runtime.sendMessage({ message: "log_off" }); -}); -*/ diff --git a/Extensions/combined/dist/chrome/ryd.background.js b/Extensions/combined/dist/chrome/ryd.background.js deleted file mode 100644 index e332d8d..0000000 --- a/Extensions/combined/dist/chrome/ryd.background.js +++ /dev/null @@ -1,272 +0,0 @@ -const apiUrl = "https://returnyoutubedislikeapi.com"; -const voteDisabledIconName = 'icon_hold128.png'; -const defaultIconName = 'icon128.png'; -let api; - -/** stores extension's global config */ -let extConfig = { - disableVoteSubmission: false -} - -if (isChrome()) api = chrome; -else if (isFirefox()) api = browser; - -initExtConfig() - -api.runtime.onMessage.addListener((request, sender, sendResponse) => { - if (request.message === "get_auth_token") { - chrome.identity.getAuthToken({ interactive: true }, function (token) { - console.log(token); - chrome.identity.getProfileUserInfo(function (userInfo) { - console.log(JSON.stringify(userInfo)); - }); - }); - } else if (request.message === "log_off") { - // chrome.identity.clearAllCachedAuthTokens(() => console.log("logged off")); - } else if (request.message == "set_state") { - // chrome.identity.getAuthToken({ interactive: true }, function (token) { - let token = ""; - fetch(`${apiUrl}/votes?videoId=${request.videoId}&likeCount=${request.likeCount || ''}`, { - method: "GET", - headers: { - Accept: "application/json", - }, - }) - .then((response) => response.json()) - .then((response) => { - sendResponse(response); - }) - .catch(); - return true; - } else if (request.message == "send_links") { - toSend = toSend.concat(request.videoIds.filter((x) => !sentIds.has(x))); - if (toSend.length >= 20) { - fetch(`${apiUrl}/votes`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(toSend), - }); - for (const toSendUrl of toSend) { - sentIds.add(toSendUrl); - } - toSend = []; - } - } else if (request.message == "register") { - register(); - return true; - } else if (request.message == "send_vote") { - sendVote(request.videoId, request.vote); - return true; - } -}); - -async function sendVote(videoId, vote) { - api.storage.sync.get(null, async (storageResult) => { - if (!storageResult.userId || !storageResult.registrationConfirmed) { - await register(); - return; - } - fetch(`${apiUrl}/interact/vote`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - userId: storageResult.userId, - videoId, - value: vote, - }), - }) - .then(async (response) => { - if (response.status == 401) { - await register(); - await sendVote(videoId, vote); - return; - } - return response.json() - }) - .then((response) => { - solvePuzzle(response).then((solvedPuzzle) => { - fetch(`${apiUrl}/interact/confirmVote`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - ...solvedPuzzle, - userId: storageResult.userId, - videoId, - }), - }); - }); - }); - }); -} - -function register() { - let userId = generateUserID(); - api.storage.sync.set({ userId }); - return fetch(`${apiUrl}/puzzle/registration?userId=${userId}`, { - method: "GET", - headers: { - Accept: "application/json", - }, - }) - .then((response) => response.json()) - .then((response) => { - return solvePuzzle(response).then((solvedPuzzle) => { - return fetch(`${apiUrl}/puzzle/registration?userId=${userId}`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(solvedPuzzle), - }).then((response) => - response.json().then((result) => { - if (result === true) { - return api.storage.sync.set({ registrationConfirmed: true }); - } - }) - ); - }); - }) - .catch(); -} - -api.storage.sync.get(null, (res) => { - if (!res || !res.userId || !res.registrationConfirmed) { - register(); - } -}); - -const sentIds = new Set(); -let toSend = []; - -function sendUserSubmittedStatisticsToApi(statistics) { - fetch(`${apiUrl}/votes/user-submitted`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(statistics), - }); -} - -function countLeadingZeroes(uInt8View, limit) { - let zeroes = 0; - let value = 0; - for (let i = 0; i < uInt8View.length; i++) { - value = uInt8View[i]; - if (value === 0) { - zeroes += 8; - } else { - let count = 1; - if (value >>> 4 === 0) { - count += 4; - value <<= 4; - } - if (value >>> 6 === 0) { - count += 2; - value <<= 2; - } - zeroes += count - (value >>> 7); - break; - } - if (zeroes >= limit) { - break; - } - } - return zeroes; -} - -async function solvePuzzle(puzzle) { - let challenge = Uint8Array.from(atob(puzzle.challenge), (c) => - c.charCodeAt(0) - ); - let buffer = new ArrayBuffer(20); - let uInt8View = new Uint8Array(buffer); - let uInt32View = new Uint32Array(buffer); - let maxCount = Math.pow(2, puzzle.difficulty) * 5; - for (let i = 4; i < 20; i++) { - uInt8View[i] = challenge[i - 4]; - } - - for (let i = 0; i < maxCount; i++) { - uInt32View[0] = i; - let hash = await crypto.subtle.digest("SHA-512", buffer); - let hashUint8 = new Uint8Array(hash); - if (countLeadingZeroes(hashUint8) >= puzzle.difficulty) { - return { - solution: btoa(String.fromCharCode.apply(null, uInt8View.slice(0, 4))), - }; - } - } -} - -function generateUserID(length = 36) { - const charset = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - let result = ""; - if (crypto && crypto.getRandomValues) { - const values = new Uint32Array(length); - crypto.getRandomValues(values); - for (let i = 0; i < length; i++) { - result += charset[values[i] % charset.length]; - } - return result; - } else { - for (let i = 0; i < length; i++) { - result += charset[Math.floor(Math.random() * charset.length)]; - } - return result; - } -} - -function storageChangeHandler(changes, area) { - if (changes.disableVoteSubmission !== undefined) { - handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue); - } -} - -function handleDisableVoteSubmissionChangeEvent(value) { - extConfig.disableVoteSubmission = value; - if (value === true) { - changeIcon(voteDisabledIconName); - } else { - changeIcon(defaultIconName); - } -} - -function changeIcon(iconName) { - if (api.action !== undefined) api.action.setIcon({path: "/icons/" + iconName}); - else if (api.browserAction !== undefined) api.browserAction.setIcon({path: "/icons/" + iconName}); - else console.log('changing icon is not supported'); -} - -api.storage.onChanged.addListener(storageChangeHandler); - -function initExtConfig() { - initializeDisableVoteSubmission(); -} - -function initializeDisableVoteSubmission() { - api.storage.sync.get(['disableVoteSubmission'], (res) => { - if (res.disableVoteSubmission === undefined) { - api.storage.sync.set({disableVoteSubmission: false}); - } - else { - extConfig.disableVoteSubmission = res.disableVoteSubmission; - if (res.disableVoteSubmission) changeIcon(voteDisabledIconName); - } - }); -} - -function isChrome() { - return typeof chrome !== "undefined" && typeof chrome.runtime !== "undefined"; -} - -function isFirefox() { - return typeof browser !== "undefined" && typeof browser.runtime !== "undefined"; -} \ No newline at end of file diff --git a/Extensions/combined/dist/firefox/bundled-content-script.js b/Extensions/combined/dist/firefox/bundled-content-script.js deleted file mode 100644 index f7da4cd..0000000 --- a/Extensions/combined/dist/firefox/bundled-content-script.js +++ /dev/null @@ -1,396 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -var __webpack_exports__ = {}; - -;// CONCATENATED MODULE: ./Extensions/combined/src/bar.js - - -function createRateBar(likes, dislikes) { - var rateBar = document.getElementById("ryd-bar-container"); - var widthPx = buttons_getButtons().children[0].clientWidth + buttons_getButtons().children[1].clientWidth + 8; - var widthPercent = likes + dislikes > 0 ? likes / (likes + dislikes) * 100 : 50; - - if (!rateBar) { - (document.getElementById("menu-container") || document.querySelector("ytm-slim-video-action-bar-renderer")).insertAdjacentHTML("beforeend", "\n
\n
\n \n
\n
\n \n \n ").concat(likes.toLocaleString(), " / ").concat(dislikes.toLocaleString(), "\n \n \n ")); - } else { - document.getElementById("ryd-bar-container").style.width = widthPx + "px"; - document.getElementById("ryd-bar").style.width = widthPercent + "%"; - document.querySelector("#ryd-dislike-tooltip > #tooltip").innerHTML = "".concat(likes.toLocaleString(), " / ").concat(dislikes.toLocaleString()); - } -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/utils.js -function roundDown(num) { - if (num < 1000) return num; - - var _int = Math.floor(Math.log10(num) - 2); - - var decimal = _int + (_int % 3 ? 1 : 0); - var value = Math.floor(num / Math.pow(10, decimal)); - return value * Math.pow(10, decimal); -} - -function numberFormat(numberState) { - var userLocales; - - try { - var _URL, _URL$searchParams, _Array$from, _Array$from$find; - - userLocales = (_URL = new URL((_Array$from = Array.from(document.querySelectorAll("head > link[rel='search']"))) === null || _Array$from === void 0 ? void 0 : (_Array$from$find = _Array$from.find(function (n) { - var _n$getAttribute; - - return n === null || n === void 0 ? void 0 : (_n$getAttribute = n.getAttribute("href")) === null || _n$getAttribute === void 0 ? void 0 : _n$getAttribute.includes("?locale="); - })) === null || _Array$from$find === void 0 ? void 0 : _Array$from$find.getAttribute("href"))) === null || _URL === void 0 ? void 0 : (_URL$searchParams = _URL.searchParams) === null || _URL$searchParams === void 0 ? void 0 : _URL$searchParams.get("locale"); - } catch (_unused) {} - - var formatter = Intl.NumberFormat(document.documentElement.lang || userLocales || navigator.language, { - notation: "compact" - }); - return formatter.format(roundDown(numberState)); -} - -function getBrowser() { - if (typeof chrome !== "undefined" && typeof chrome.runtime !== "undefined") { - return chrome; - } else if (typeof browser !== "undefined" && typeof browser.runtime !== "undefined") { - return browser; - } else { - console.log("browser is not supported"); - return false; - } -} - -function getVideoId(url) { - var urlObject = new URL(url); - var pathname = urlObject.pathname; - - if (pathname.startsWith("/clip")) { - return document.querySelector("meta[itemprop='videoId']").content; - } else { - return urlObject.searchParams.get("v"); - } -} - -function isVideoLoaded() { - var videoId = getVideoId(window.location.href); - return document.querySelector("ytd-watch-flexy[video-id='".concat(videoId, "']")) !== null || // mobile: no video-id attribute - document.querySelector('#player[loading="false"]:not([hidden])') !== null; -} - -function cLog(message, writer) { - message = "[return youtube dislike]: ".concat(message); - - if (writer) { - writer(message); - } else { - console.log(message); - } -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/events.js - - - - - -function sendVote(vote) { - if (extConfig.disableVoteSubmission !== true) { - getBrowser().runtime.sendMessage({ - message: "send_vote", - vote: vote, - videoId: getVideoId(window.location.href) - }); - } -} - -function sendVideoIds() { - var links = Array.from(document.getElementsByClassName("yt-simple-endpoint ytd-compact-video-renderer")).concat(Array.from(document.getElementsByClassName("yt-simple-endpoint ytd-thumbnail"))); // Also try mobile - - if (links.length < 1) links = Array.from(document.querySelectorAll(".large-media-item-metadata > a, a.large-media-item-thumbnail-container")); - var ids = links.filter(function (x) { - return x.href && x.href.indexOf("/watch?v=") > 0; - }).map(function (x) { - return getVideoId(x.href); - }); - getBrowser().runtime.sendMessage({ - message: "send_links", - videoIds: ids - }); -} - -function likeClicked() { - if (checkForSignInButton() === false) { - if (storedData.previousState === DISLIKED_STATE) { - sendVote(1); - storedData.dislikes--; - storedData.likes++; - createRateBar(storedData.likes, storedData.dislikes); - setDislikes(numberFormat(storedData.dislikes)); - storedData.previousState = LIKED_STATE; - } else if (storedData.previousState === NEUTRAL_STATE) { - sendVote(1); - storedData.likes++; - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = LIKED_STATE; - } else if (storedData.previousState = LIKED_STATE) { - sendVote(0); - storedData.likes--; - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = NEUTRAL_STATE; - } - } -} - -function dislikeClicked() { - if (checkForSignInButton() == false) { - if (storedData.previousState === NEUTRAL_STATE) { - sendVote(-1); - storedData.dislikes++; - setDislikes(numberFormat(storedData.dislikes)); - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = DISLIKED_STATE; - } else if (storedData.previousState === DISLIKED_STATE) { - sendVote(0); - storedData.dislikes--; - setDislikes(numberFormat(storedData.dislikes)); - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = NEUTRAL_STATE; - } else if (storedData.previousState === LIKED_STATE) { - sendVote(-1); - storedData.likes--; - storedData.dislikes++; - setDislikes(numberFormat(storedData.dislikes)); - createRateBar(storedData.likes, storedData.dislikes); - storedData.previousState = DISLIKED_STATE; - } - } -} - -function addLikeDislikeEventListener() { - var buttons = buttons_getButtons(); - - if (!window.returnDislikeButtonlistenersSet) { - buttons.children[0].addEventListener("click", likeClicked); - buttons.children[1].addEventListener("click", dislikeClicked); - window.returnDislikeButtonlistenersSet = true; - } -} - -function storageChangeHandler(changes, area) { - if (changes.disableVoteSubmission !== undefined) { - handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue); - } -} - -function handleDisableVoteSubmissionChangeEvent(value) { - extConfig.disableVoteSubmission = value; -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/state.js - - - - -var LIKED_STATE = "LIKED_STATE"; -var DISLIKED_STATE = "DISLIKED_STATE"; -var NEUTRAL_STATE = "NEUTRAL_STATE"; -var extConfig = { - disableVoteSubmission: false -}; -var storedData = { - likes: 0, - dislikes: 0, - previousState: NEUTRAL_STATE -}; - -function isMobile() { - return location.hostname == "m.youtube.com"; -} - -function isVideoLiked() { - if (isMobile()) { - return getLikeButton().querySelector("button").getAttribute("aria-label") == "true"; - } - - return getLikeButton().classList.contains("style-default-active"); -} - -function isVideoDisliked() { - if (isMobile()) { - return getDislikeButton().querySelector("button").getAttribute("aria-label") == "true"; - } - - return getDislikeButton().classList.contains("style-default-active"); -} - -function getState(storedData) { - if (isVideoLiked()) { - return { - current: LIKED_STATE, - previous: storedData.previousState - }; - } - - if (isVideoDisliked()) { - return { - current: DISLIKED_STATE, - previous: storedData.previousState - }; - } - - return { - current: NEUTRAL_STATE, - previous: storedData.previousState - }; -} //--- Sets The Likes And Dislikes Values ---// - - -function setLikes(likesCount) { - getButtons().children[0].querySelector("#text").innerText = likesCount; -} - -function setDislikes(dislikesCount) { - if (isMobile()) { - buttons_getButtons().children[1].querySelector(".button-renderer-text").innerText = dislikesCount; - return; - } - - buttons_getButtons().children[1].querySelector("#text").innerText = dislikesCount; -} - -function getLikeCountFromButton() { - var likesStr = getLikeButton().querySelector("button").getAttribute("aria-label").replace(/\D/g, ""); - return likesStr.length > 0 ? parseInt(likesStr) : false; -} - -function processResponse(response, storedData) { - var formattedDislike = numberFormat(response.dislikes); - setDislikes(formattedDislike); - storedData.dislikes = parseInt(response.dislikes); - storedData.likes = getLikeCountFromButton() || parseInt(response.likes); - createRateBar(storedData.likes, storedData.dislikes); -} - -function setState(storedData) { - storedData.previousState = isVideoDisliked() ? DISLIKED_STATE : isVideoLiked() ? LIKED_STATE : NEUTRAL_STATE; - var statsSet = false; - getBrowser().runtime.sendMessage({ - message: "set_state", - videoId: getVideoId(window.location.href), - state: getState(storedData).current, - likeCount: getLikeCountFromButton() || null - }, function (response) { - cLog("response from api:"); - cLog(JSON.stringify(response)); - - if (response !== undefined && !("traceId" in response) && !statsSet) { - processResponse(response, storedData); - } else {} - }); -} - -function setInitialState() { - setState(storedData); - setTimeout(function () { - sendVideoIds(); - }, 1500); -} - -function initExtConfig() { - initializeDisableVoteSubmission(); -} - -function initializeDisableVoteSubmission() { - getBrowser().storage.sync.get(['disableVoteSubmission'], function (res) { - if (res.disableVoteSubmission === undefined) { - getBrowser().storage.sync.set({ - disableVoteSubmission: false - }); - } else { - extConfig.disableVoteSubmission = res.disableVoteSubmission; - } - }); -} - - -;// CONCATENATED MODULE: ./Extensions/combined/src/buttons.js - - -function buttons_getButtons() { - var _document$getElementB; - - if (isMobile()) { - return document.querySelector(".slim-video-action-bar-actions"); - } //--- If Menu Element Is Displayed: ---// - - - if (((_document$getElementB = document.getElementById("menu-container")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.offsetParent) === null) { - return document.querySelector("ytd-menu-renderer.ytd-watch-metadata > div"); //--- If Menu Element Isnt Displayed: ---// - } else { - var _document$getElementB2; - - return (_document$getElementB2 = document.getElementById("menu-container")) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.querySelector("#top-level-buttons-computed"); - } -} - -function getLikeButton() { - return buttons_getButtons().children[0]; -} - -function getDislikeButton() { - return buttons_getButtons().children[1]; -} - -function checkForSignInButton() { - if (document.querySelector("a[href^='https://accounts.google.com/ServiceLogin']")) { - return true; - } else { - return false; - } -} - - -;// CONCATENATED MODULE: ./Extensions/combined/ryd.content-script.js -//--- Import Button Functions ---// - //--- Import State Functions ---// - - //--- Import Video & Browser Functions ---// - - - - -initExtConfig(); -var jsInitChecktimer = null; - -function setEventListeners(evt) { - function checkForJS_Finish() { - var _getButtons; - - if ((_getButtons = buttons_getButtons()) !== null && _getButtons !== void 0 && _getButtons.offsetParent && isVideoLoaded()) { - clearInterval(jsInitChecktimer); - jsInitChecktimer = null; - addLikeDislikeEventListener(); - setInitialState(); - getBrowser().storage.onChanged.addListener(storageChangeHandler); - } - } - - if (window.location.href.indexOf("watch?") >= 0) { - jsInitChecktimer = setInterval(checkForJS_Finish, 111); - } -} - -setEventListeners(); -document.addEventListener("yt-navigate-finish", function (event) { - if (jsInitChecktimer !== null) clearInterval(jsInitChecktimer); - window.returnDislikeButtonlistenersSet = false; - setEventListeners(); -}); -setTimeout(function () { - return sendVideoIds(); -}, 2500); -/******/ })() -; \ No newline at end of file diff --git a/Extensions/combined/dist/firefox/content-style.css b/Extensions/combined/dist/firefox/content-style.css deleted file mode 100644 index c06b29c..0000000 --- a/Extensions/combined/dist/firefox/content-style.css +++ /dev/null @@ -1,26 +0,0 @@ -#ryd-bar-container { - background: var(--yt-spec-icon-disabled); - border-radius: 2px; -} - -#ryd-bar { - background: var(--yt-spec-text-primary); - border-radius: 2px; - transition: all 0.15s ease-in-out; -} - -.ryd-tooltip { - position: relative; - display: block; - height: 2px; - top: 9px; -} - -.ryd-tooltip-bar-container { - width: 100%; - height: 2px; - position: absolute; - padding-top: 6px; - padding-bottom: 28px; - top: -6px; -} diff --git a/Extensions/combined/dist/firefox/icons/icon128.png b/Extensions/combined/dist/firefox/icons/icon128.png deleted file mode 100644 index 23b4958bac00cf7bf00637091ce41b29d82014c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7093 zcmV;m8%pGfP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3*ta^pA>M*rg!a|8m3^*C4(5p#n%{=5X`-Ex<^ z+lsPOq(}m}d<$Tw|NHND|KTU)R9#G^=9crtPi(P;&WC!v{pjQUKIX4@e!u+q$8Ybx zJrQ^p-sL`6;^VA5j=y|AzrJ&$Z%+91=>mCuOnCp`(jUje6+VopHE!|#r@sB$d)2-5 zo?VZbFywnu_aofPZTR9KN^&mCybAvkpUZhQUiIqN^zmBPyauo7n-5;D?W14LcfY;* z#ryP=F~*>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ZvyM(QKZ_I#%H6<$_7~8)?YmX za}1m_V046jl%?TNfq^X%jNz_<>R{qO^2@v8za4Zs{?oz>Gzy=TM9}7Sm1L+AA0daeCQw{zj?c=Vyz-SMC(L4yRh;=Y<(~{J`NREXMz%Wb9 zUmM$vAj=sTX~7uR6XWME2!Lp{0hsCOHy4qWfITrz`(GIw@4Hk37|QW=aA%L?U<3G_ z0c&1TWOEM?$NIkwm>z7a3joIe_#T*Mllf`@!#lPc=pt9#Yyj(w&9Bz86o8>IF@Lv# zZZ^l#)*c`Z^?xrg*@K$`z&!wd3e3M@do~pS>1#hw?tz|7m!tZhXW&MTYW{u$&&dTh z8^B);^hjDfZ7cz~NdLbB6Fj&o0Newh0hr{$73JS}lz`n?O#2N6`Y7sdHh{+r^i|a3 z1;CIjnSaVae-~nETMv+p`u_(|=D}$J;2r>H0`pHP-^Q~9)J2%~&lua^p5g!i*CR6j ztbu`waJzOq$Q-k&*+!Ed%2eEjJ;!ZTu%|Ne)8LVxU~naT9_T0~Lyjdk}OoutDZak|arz fBuSDaJx>1uZ4Hz~LN5Q900000NkvXXu0mjf<(q04 diff --git a/Extensions/combined/dist/firefox/icons/icon48.png b/Extensions/combined/dist/firefox/icons/icon48.png deleted file mode 100644 index f2a5951c399c68b60c03e194c685dddd093710a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4454 zcmV-s5t;6ZP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O?T!b|X8kg#U9Dy#!9+upEx(^bX$g`vWs&`?_RX zb*r9LHdV?L2?BvYfN9qM{db%H@Dr0H6D5~aQ?mTT8mn)-Dfazm-Q)F{v+?|W{J8tC zGfyvg#=sb^4|BY)hWqo!{poFFq9+%eeELFoTgHD}IJf(AZ~Z?k>ee~?@u$51?mf%i z>)Kt52{)u`Q`ZvaF%36%ycEvY60gj!@IIecbwhfyXdBI&26{b zWE^f_WAw{sM(>9Y=d%*BuYLp@T!{K|+viZj3?=w5{0bpN6a1Sk?yO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BeT% z`5TqQyi`G682?`#TiG{=!f} zTgh;p<|q0=qz~VcXxww%s}b{LjFZ*74Vxz}zS4jgA&M0tUB%i|dXi?*W%P z!0?kU8ImLUX$r+6@P0<$lm~`xfxb1jxAs0xAAl@%wR{5{90KDd%3k+)cd)y+f6ui0 z`vF$?a-6>>xFG-l010qNS#tmYALal6ALaq1u(CS<000McNlirupDX{r>CL6UmXB}Gr%dw(H$L-&%@#(q|-|Dz%5r<(rH*&sKBIB zjR6oi2wZf(DbXs!X>}DQC!w`9^d7hgZ1bEkk${mAFbo(P0$mRtK%m9#N@%P0c9@xg zr6uU?4ZH`g0BwP^(A5PK6Oc>>3NRc<_O&$_9E6@8SYHpMiMYU7pwri^8yhe+Rhi7C zQlN7nZcbi*R4&8pER2r_R`F^8=X}XDHwU>K6pNv+1G_wBFbwGHgKRc*^Zynw_ot{# zMnu>BI+1;Hb0Uj-qMx5vayJ?&#ehFi2Y45CfJcgW5w`$$faeMTe6ZYqb`bM6u0cuQ zf_ad?3>Y58$*1^DhNs#N3~^lGnZSOUYAQPV3*DbK2pMv5^8f$<07*qoM6N<$f}yQzKL7v# diff --git a/Extensions/combined/dist/firefox/manifest.json b/Extensions/combined/dist/firefox/manifest.json deleted file mode 100644 index e0e8dba..0000000 --- a/Extensions/combined/dist/firefox/manifest.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "Return YouTube Dislike", - "description": "Returns ability to see dislikes", - "version": "2.0.0.3", - "manifest_version": 2, - "background": { - "scripts": ["ryd.background.js"] - }, - "icons": { - "48": "icons/icon48.png", - "128": "icons/icon128.png" - }, - "permissions": ["activeTab", "*://*.youtube.com/*", "storage"], - "browser_action": { - "default_popup": "popup.html" - }, - "content_scripts": [ - { - "matches": ["*://*.youtube.com/*"], - "exclude_matches": ["*://*.music.youtube.com/*"], - "run_at": "document_idle", - "css": ["content-style.css"], - "js": ["bundled-content-script.js"] - }, - { - "matches": ["*://*.returnyoutubedislike.com/debug","http://localhost/debug"], - "run_at": "document_idle", - "js": ["debug.js"] - } - ] -} diff --git a/Extensions/combined/dist/firefox/popup.css b/Extensions/combined/dist/firefox/popup.css deleted file mode 100644 index 3075989..0000000 --- a/Extensions/combined/dist/firefox/popup.css +++ /dev/null @@ -1,119 +0,0 @@ -/* Variables */ -:root { - --primary: #cc2929; - --accent: #581111; - - --background: #111; - --secondary: #272727; - --tertiary: #333333; - --lightGrey: #999; - --white: #fff; -} - -/* Window Styling */ -html, -body { - background-color: var(--background); - color: var(--white); - min-width: 300px; - padding: 0.5em; - font-family: 'Roboto', Arial, Helvetica, sans-serif; - font-size: 14px; -} - -h1 { - font-size: 26px; -} - -button { - color: var(--white); - background: var(--secondary); - cursor: pointer; - padding: 5px 16px; - border: none; - border-radius: 4px; - font-weight: 500; - box-shadow: 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px 0 rgb(0 0 0 / 14%), 0 1px 10px 0 rgb(0 0 0 / 12%); - transition: .4s; -} - -button:hover { - background: #444; -} - -#advancedToggle { - margin-top: 1em; - margin-bottom: 2em; -} - -#advancedSettings { - display: none; - border: 2px solid var(--secondary); - border-radius: 0.5rem; - padding: 1rem; -} - -#advancedLegend { - color: var(--tertiary) !important; - /* margin: auto; */ /* Center the label */ - /* padding: .25rem .5rem; */ - /* border-radius: .25rem; */ - /* border: .25rem solid var(--secondary); */ -} - -/* Switches */ -.switch { - position: relative; - display: inline-block; - width: 30px; - height: 17px; - margin-bottom: 1rem; -} - -.switch:last-of-type { - margin-bottom: 0; -} - -.switch input { - display: none; -} - -.slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: var(--secondary); - transition: 0.4s; - border-radius: 34px; -} - -.slider:before { - position: absolute; - content: ""; - height: 13px; - width: 13px; - left: 2px; - bottom: 2px; - background: var(--lightGrey); - transition: 0.4s; - border-radius: 50%; -} - -input:checked + .slider { - background: var(--accent); -} - -input:checked + .slider:before { - transform: translateX(13px); - background: var(--primary); -} - -.switchLabel { - margin-left: 0.5rem; - width: 250px !important; - transform: translateX(35px); - display: inline-block; -} diff --git a/Extensions/combined/dist/firefox/popup.html b/Extensions/combined/dist/firefox/popup.html deleted file mode 100644 index 27910d2..0000000 --- a/Extensions/combined/dist/firefox/popup.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Return YouTube Dislike - - - - - - -
- -

Return YouTube Dislike

-

by Dmitrii Selivanov & Community

-

- - - - - -

- - -
- -
- -
- -
- -
- Settings - - -
- - -
- - - diff --git a/Extensions/combined/dist/firefox/popup.js b/Extensions/combined/dist/firefox/popup.js deleted file mode 100644 index c0e7b78..0000000 --- a/Extensions/combined/dist/firefox/popup.js +++ /dev/null @@ -1,103 +0,0 @@ -/* Config */ -const config = { - advanced: false, - showAdvancedMessage: "Show Settings", - hideAdvancedMessage: "Hide Settings", - disableVoteSubmission: false, -} - - function initConfig() { - initializeVersionNumber(); - } - - function initializeVersionNumber() { - const version = chrome.runtime.getManifest().version; - document.getElementById('ext-version').innerHTML = 'v' + version; -} - - links: { - website: "https://returnyoutubedislike.com", - github: "https://github.com/Anarios/return-youtube-dislike", - discord: "https://discord.gg/mYnESY4Md5", - donate: 'https://returnyoutubedislike.com/donate', - faq: 'https://returnyoutubedislike.com/faq' - }, -}; - -/* Links */ -document.getElementById("link_website").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.website }); -}); - -document.getElementById("link_github").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.github }); -}); - -document.getElementById("link_discord").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.discord }); -}); - -document.getElementById("link_faq").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.faq }); -}); - -document.getElementById("link_donate").addEventListener("click", () => { - chrome.tabs.create({ url: config.links.donate }); -}); - - -document.getElementById("disable_vote_submission").addEventListener("click", (ev) => { - chrome.storage.sync.set({ disableVoteSubmission: ev.target.checked }); -}); - -/* Advanced Toggle */ -const advancedToggle = document.getElementById("advancedToggle"); -advancedToggle.addEventListener("click", () => { - const adv = document.getElementById("advancedSettings"); - if (config.advanced) { - adv.style.display = "none"; - advancedToggle.innerHTML = config.showAdvancedMessage; - config.advanced = false; - } else { - adv.style.display = "block"; - advancedToggle.innerHTML = config.hideAdvancedMessage; - config.advanced = true; - } -}); - -initConfig(); - -function initConfig() { - initializeDisableVoteSubmission(); -} - -function initializeDisableVoteSubmission() { - chrome.storage.sync.get(['disableVoteSubmission'], (res) => { - handleDisableVoteSubmissionChangeEvent(res.disableVoteSubmission); - }); -} - -chrome.storage.onChanged.addListener(storageChangeHandler); - -function storageChangeHandler(changes, area) { - if (changes.disableVoteSubmission !== undefined) { - handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue); - } -} - -function handleDisableVoteSubmissionChangeEvent(value) { - config.disableVoteSubmission = value; - document.getElementById("disable_vote_submission").checked = value; -} - -/* popup-script.js -document.querySelector('#login') -.addEventListener('click', function () { - chrome.runtime.sendMessage({ message: 'get_auth_token' }); -}); - - -document.querySelector("#log_off").addEventListener("click", function () { - chrome.runtime.sendMessage({ message: "log_off" }); -}); -*/ diff --git a/Extensions/combined/dist/firefox/ryd.background.js b/Extensions/combined/dist/firefox/ryd.background.js deleted file mode 100644 index e332d8d..0000000 --- a/Extensions/combined/dist/firefox/ryd.background.js +++ /dev/null @@ -1,272 +0,0 @@ -const apiUrl = "https://returnyoutubedislikeapi.com"; -const voteDisabledIconName = 'icon_hold128.png'; -const defaultIconName = 'icon128.png'; -let api; - -/** stores extension's global config */ -let extConfig = { - disableVoteSubmission: false -} - -if (isChrome()) api = chrome; -else if (isFirefox()) api = browser; - -initExtConfig() - -api.runtime.onMessage.addListener((request, sender, sendResponse) => { - if (request.message === "get_auth_token") { - chrome.identity.getAuthToken({ interactive: true }, function (token) { - console.log(token); - chrome.identity.getProfileUserInfo(function (userInfo) { - console.log(JSON.stringify(userInfo)); - }); - }); - } else if (request.message === "log_off") { - // chrome.identity.clearAllCachedAuthTokens(() => console.log("logged off")); - } else if (request.message == "set_state") { - // chrome.identity.getAuthToken({ interactive: true }, function (token) { - let token = ""; - fetch(`${apiUrl}/votes?videoId=${request.videoId}&likeCount=${request.likeCount || ''}`, { - method: "GET", - headers: { - Accept: "application/json", - }, - }) - .then((response) => response.json()) - .then((response) => { - sendResponse(response); - }) - .catch(); - return true; - } else if (request.message == "send_links") { - toSend = toSend.concat(request.videoIds.filter((x) => !sentIds.has(x))); - if (toSend.length >= 20) { - fetch(`${apiUrl}/votes`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(toSend), - }); - for (const toSendUrl of toSend) { - sentIds.add(toSendUrl); - } - toSend = []; - } - } else if (request.message == "register") { - register(); - return true; - } else if (request.message == "send_vote") { - sendVote(request.videoId, request.vote); - return true; - } -}); - -async function sendVote(videoId, vote) { - api.storage.sync.get(null, async (storageResult) => { - if (!storageResult.userId || !storageResult.registrationConfirmed) { - await register(); - return; - } - fetch(`${apiUrl}/interact/vote`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - userId: storageResult.userId, - videoId, - value: vote, - }), - }) - .then(async (response) => { - if (response.status == 401) { - await register(); - await sendVote(videoId, vote); - return; - } - return response.json() - }) - .then((response) => { - solvePuzzle(response).then((solvedPuzzle) => { - fetch(`${apiUrl}/interact/confirmVote`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - ...solvedPuzzle, - userId: storageResult.userId, - videoId, - }), - }); - }); - }); - }); -} - -function register() { - let userId = generateUserID(); - api.storage.sync.set({ userId }); - return fetch(`${apiUrl}/puzzle/registration?userId=${userId}`, { - method: "GET", - headers: { - Accept: "application/json", - }, - }) - .then((response) => response.json()) - .then((response) => { - return solvePuzzle(response).then((solvedPuzzle) => { - return fetch(`${apiUrl}/puzzle/registration?userId=${userId}`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(solvedPuzzle), - }).then((response) => - response.json().then((result) => { - if (result === true) { - return api.storage.sync.set({ registrationConfirmed: true }); - } - }) - ); - }); - }) - .catch(); -} - -api.storage.sync.get(null, (res) => { - if (!res || !res.userId || !res.registrationConfirmed) { - register(); - } -}); - -const sentIds = new Set(); -let toSend = []; - -function sendUserSubmittedStatisticsToApi(statistics) { - fetch(`${apiUrl}/votes/user-submitted`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(statistics), - }); -} - -function countLeadingZeroes(uInt8View, limit) { - let zeroes = 0; - let value = 0; - for (let i = 0; i < uInt8View.length; i++) { - value = uInt8View[i]; - if (value === 0) { - zeroes += 8; - } else { - let count = 1; - if (value >>> 4 === 0) { - count += 4; - value <<= 4; - } - if (value >>> 6 === 0) { - count += 2; - value <<= 2; - } - zeroes += count - (value >>> 7); - break; - } - if (zeroes >= limit) { - break; - } - } - return zeroes; -} - -async function solvePuzzle(puzzle) { - let challenge = Uint8Array.from(atob(puzzle.challenge), (c) => - c.charCodeAt(0) - ); - let buffer = new ArrayBuffer(20); - let uInt8View = new Uint8Array(buffer); - let uInt32View = new Uint32Array(buffer); - let maxCount = Math.pow(2, puzzle.difficulty) * 5; - for (let i = 4; i < 20; i++) { - uInt8View[i] = challenge[i - 4]; - } - - for (let i = 0; i < maxCount; i++) { - uInt32View[0] = i; - let hash = await crypto.subtle.digest("SHA-512", buffer); - let hashUint8 = new Uint8Array(hash); - if (countLeadingZeroes(hashUint8) >= puzzle.difficulty) { - return { - solution: btoa(String.fromCharCode.apply(null, uInt8View.slice(0, 4))), - }; - } - } -} - -function generateUserID(length = 36) { - const charset = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - let result = ""; - if (crypto && crypto.getRandomValues) { - const values = new Uint32Array(length); - crypto.getRandomValues(values); - for (let i = 0; i < length; i++) { - result += charset[values[i] % charset.length]; - } - return result; - } else { - for (let i = 0; i < length; i++) { - result += charset[Math.floor(Math.random() * charset.length)]; - } - return result; - } -} - -function storageChangeHandler(changes, area) { - if (changes.disableVoteSubmission !== undefined) { - handleDisableVoteSubmissionChangeEvent(changes.disableVoteSubmission.newValue); - } -} - -function handleDisableVoteSubmissionChangeEvent(value) { - extConfig.disableVoteSubmission = value; - if (value === true) { - changeIcon(voteDisabledIconName); - } else { - changeIcon(defaultIconName); - } -} - -function changeIcon(iconName) { - if (api.action !== undefined) api.action.setIcon({path: "/icons/" + iconName}); - else if (api.browserAction !== undefined) api.browserAction.setIcon({path: "/icons/" + iconName}); - else console.log('changing icon is not supported'); -} - -api.storage.onChanged.addListener(storageChangeHandler); - -function initExtConfig() { - initializeDisableVoteSubmission(); -} - -function initializeDisableVoteSubmission() { - api.storage.sync.get(['disableVoteSubmission'], (res) => { - if (res.disableVoteSubmission === undefined) { - api.storage.sync.set({disableVoteSubmission: false}); - } - else { - extConfig.disableVoteSubmission = res.disableVoteSubmission; - if (res.disableVoteSubmission) changeIcon(voteDisabledIconName); - } - }); -} - -function isChrome() { - return typeof chrome !== "undefined" && typeof chrome.runtime !== "undefined"; -} - -function isFirefox() { - return typeof browser !== "undefined" && typeof browser.runtime !== "undefined"; -} \ No newline at end of file